Skip to content

Update database type names #5136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 0 additions & 235 deletions common/api-review/database-exp.api.md

This file was deleted.

60 changes: 30 additions & 30 deletions common/api-review/database.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ import { EmulatorMockTokenOptions } from '@firebase/util';
import { FirebaseApp } from '@firebase/app';

// @public
export function child(parent: Reference, path: string): Reference;
export function child(parent: DatabaseReference, path: string): DatabaseReference;

// @public
export class Database {
readonly app: FirebaseApp;
readonly 'type' = "database";
}

// @public
export interface DatabaseReference extends Query {
readonly key: string | null;
readonly parent: DatabaseReference | null;
readonly root: DatabaseReference;
}

// @public
export function connectDatabaseEmulator(db: FirebaseDatabase, host: string, port: number, options?: {
Expand All @@ -25,7 +38,7 @@ export class DataSnapshot {
hasChildren(): boolean;
get key(): string | null;
get priority(): string | number | null;
readonly ref: Reference;
readonly ref: DatabaseReference;
get size(): number;
toJSON(): object | null;
val(): any;
Expand All @@ -49,23 +62,17 @@ export function equalTo(value: number | string | boolean | null, key?: string):
// @public
export type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed';

// @public
export class FirebaseDatabase {
readonly app: FirebaseApp;
readonly 'type' = "database";
}

// @public
export function get(query: Query): Promise<DataSnapshot>;

// @public
export function getDatabase(app?: FirebaseApp, url?: string): FirebaseDatabase;
export function getDatabase(app?: FirebaseApp, url?: string): Database;

// @public
export function goOffline(db: FirebaseDatabase): void;
export function goOffline(db: Database): void;

// @public
export function goOnline(db: FirebaseDatabase): void;
export function goOnline(db: Database): void;

// @public
export function increment(delta: number): object;
Expand Down Expand Up @@ -130,7 +137,7 @@ export class OnDisconnect {
}

// @public
export function onDisconnect(ref: Reference): OnDisconnect;
export function onDisconnect(ref: DatabaseReference): OnDisconnect;

// @public
export function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe;
Expand All @@ -154,12 +161,12 @@ export function orderByPriority(): QueryConstraint;
export function orderByValue(): QueryConstraint;

// @public
export function push(parent: Reference, value?: unknown): ThenableReference;
export function push(parent: DatabaseReference, value?: unknown): ThenableReference;

// @public
export interface Query {
isEqual(other: Query | null): boolean;
readonly ref: Reference;
readonly ref: DatabaseReference;
toJSON(): string;
toString(): string;
}
Expand All @@ -176,35 +183,28 @@ export abstract class QueryConstraint {
export type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo';

// @public
export function ref(db: FirebaseDatabase, path?: string): Reference;

// @public
export interface Reference extends Query {
readonly key: string | null;
readonly parent: Reference | null;
readonly root: Reference;
}
export function ref(db: Database, path?: string): DatabaseReference;

// @public
export function refFromURL(db: FirebaseDatabase, url: string): Reference;
export function refFromURL(db: Database, url: string): DatabaseReference;

// @public
export function remove(ref: Reference): Promise<void>;
export function remove(ref: DatabaseReference): Promise<void>;

// @public
export function runTransaction(ref: Reference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise<TransactionResult>;
export function runTransaction(ref: DatabaseReference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise<TransactionResult>;

// @public
export function serverTimestamp(): object;

// @public
export function set(ref: Reference, value: unknown): Promise<void>;
export function set(ref: DatabaseReference, value: unknown): Promise<void>;

// @public
export function setPriority(ref: Reference, priority: string | number | null): Promise<void>;
export function setPriority(ref: DatabaseReference, priority: string | number | null): Promise<void>;

// @public
export function setWithPriority(ref: Reference, value: unknown, priority: string | number | null): Promise<void>;
export function setWithPriority(ref: DatabaseReference, value: unknown, priority: string | number | null): Promise<void>;

// @public
export function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint;
Expand All @@ -213,7 +213,7 @@ export function startAfter(value: number | string | boolean | null, key?: string
export function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint;

// @public
export interface ThenableReference extends Reference, Pick<Promise<Reference>, 'then' | 'catch'> {
export interface ThenableReference extends DatabaseReference, Pick<Promise<DatabaseReference>, 'then' | 'catch'> {
}

// @public
Expand All @@ -232,7 +232,7 @@ export class TransactionResult {
export type Unsubscribe = () => void;

// @public
export function update(ref: Reference, values: object): Promise<void>;
export function update(ref: DatabaseReference, values: object): Promise<void>;


```
5 changes: 1 addition & 4 deletions packages-exp/app-check-exp/src/internal-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ export function addTokenListener(

// Create the refresher but don't start it if `isTokenAutoRefreshEnabled`
// is not true.
if (
!newState.tokenRefresher.isRunning() &&
state.isTokenAutoRefreshEnabled
) {
if (!newState.tokenRefresher.isRunning() && state.isTokenAutoRefreshEnabled) {
newState.tokenRefresher.start();
}

Expand Down
Loading