veritatisdoloremque
Version:
Monorepo for the Firebase JavaScript SDK
194 lines (177 loc) • 5.36 kB
Markdown
## API Report File for "@firebase/database"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { FirebaseApp } from '@firebase/app';
// @public (undocumented)
export interface Database {
// (undocumented)
app: FirebaseApp;
// (undocumented)
goOffline(): void;
// (undocumented)
goOnline(): void;
// (undocumented)
ref(path?: string | Reference): Reference;
// (undocumented)
refFromURL(url: string): Reference;
// (undocumented)
useEmulator(host: string, port: number): void;
}
// @public (undocumented)
export interface DataSnapshot {
// (undocumented)
child(path: string): DataSnapshot;
// (undocumented)
exists(): boolean;
// (undocumented)
exportVal(): any;
// (undocumented)
forEach(action: (a: DataSnapshot) => boolean | void): boolean;
// (undocumented)
getPriority(): string | number | null;
// (undocumented)
hasChild(path: string): boolean;
// (undocumented)
hasChildren(): boolean;
// (undocumented)
key: string | null;
// (undocumented)
numChildren(): number;
// (undocumented)
ref: Reference;
// (undocumented)
toJSON(): object | null;
// (undocumented)
val(): any;
}
// @public (undocumented)
export function enableLogging(
logger?: boolean | ((a: string) => any),
persistent?: boolean
): any;
// @public (undocumented)
export type EventType =
| 'value'
| 'child_added'
| 'child_changed'
| 'child_moved'
| 'child_removed';
// @public (undocumented)
export function getDatabase(app: FirebaseApp, url?: string): Database;
// @public (undocumented)
export interface OnDisconnect {
// (undocumented)
cancel(onComplete?: (a: Error | null) => any): Promise<void>;
// (undocumented)
remove(onComplete?: (a: Error | null) => any): Promise<void>;
// (undocumented)
set(value: any, onComplete?: (a: Error | null) => any): Promise<void>;
// (undocumented)
setWithPriority(
value: any,
priority: number | string | null,
onComplete?: (a: Error | null) => any
): Promise<any>;
// (undocumented)
update(values: object, onComplete?: (a: Error | null) => any): Promise<any>;
}
// @public (undocumented)
export interface Query {
// (undocumented)
endAt(value: number | string | boolean | null, key?: string): Query;
// (undocumented)
equalTo(value: number | string | boolean | null, key?: string): Query;
// (undocumented)
get(): Promise<DataSnapshot>;
// (undocumented)
isEqual(other: Query | null): boolean;
// (undocumented)
limitToFirst(limit: number): Query;
// (undocumented)
limitToLast(limit: number): Query;
// (undocumented)
off(
eventType?: EventType,
callback?: (a: DataSnapshot, b?: string | null) => any,
context?: object | null
): void;
// (undocumented)
on(
eventType: EventType,
callback: (a: DataSnapshot, b?: string | null) => any,
cancelCallbackOrContext?: ((a: Error) => any) | object | null,
context?: object | null
): (a: DataSnapshot, b?: string | null) => any;
// (undocumented)
once(
eventType: EventType,
successCallback?: (a: DataSnapshot, b?: string | null) => any,
failureCallbackOrContext?: ((a: Error) => void) | object | null,
context?: object | null
): Promise<DataSnapshot>;
// (undocumented)
orderByChild(path: string): Query;
// (undocumented)
orderByKey(): Query;
// (undocumented)
orderByPriority(): Query;
// (undocumented)
orderByValue(): Query;
// (undocumented)
ref: Reference;
// (undocumented)
startAt(value: number | string | boolean | null, key?: string): Query;
// (undocumented)
toJSON(): object;
// (undocumented)
toString(): string;
}
// @public (undocumented)
export interface Reference extends Query {
// (undocumented)
child(path: string): Reference;
// (undocumented)
key: string | null;
// (undocumented)
onDisconnect(): OnDisconnect;
// (undocumented)
parent: Reference | null;
// (undocumented)
push(value?: any, onComplete?: (a: Error | null) => any): ThenableReference;
// (undocumented)
remove(onComplete?: (a: Error | null) => any): Promise<any>;
// (undocumented)
root: Reference;
// (undocumented)
set(value: any, onComplete?: (a: Error | null) => any): Promise<any>;
// (undocumented)
setPriority(
priority: string | number | null,
onComplete: (a: Error | null) => any
): Promise<any>;
// (undocumented)
setWithPriority(
newVal: any,
newPriority: string | number | null,
onComplete?: (a: Error | null) => any
): Promise<any>;
// (undocumented)
transaction(
transactionUpdate: (a: any) => any,
onComplete?: (a: Error | null, b: boolean, c: DataSnapshot | null) => any,
applyLocally?: boolean
): Promise<any>;
// (undocumented)
update(values: object, onComplete?: (a: Error | null) => any): Promise<any>;
}
// @public (undocumented)
export const ServerValue: {
TIMESTAMP: object;
increment(delta: number): object;
};
// @public (undocumented)
export interface ThenableReference
extends Reference,
Pick<Promise<Reference>, 'then' | 'catch'> {}
// (No @packageDocumentation comment for this package)
```