|
| 1 | +## API Report File for "@firebase/database" |
| 2 | + |
| 3 | +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). |
| 4 | +
|
| 5 | +```ts |
| 6 | + |
| 7 | +import { FirebaseApp } from '@firebase/app-types'; |
| 8 | + |
| 9 | +// @public (undocumented) |
| 10 | +export interface Database { |
| 11 | + // (undocumented) |
| 12 | + app: FirebaseApp; |
| 13 | + // (undocumented) |
| 14 | + goOffline(): void; |
| 15 | + // (undocumented) |
| 16 | + goOnline(): void; |
| 17 | + // (undocumented) |
| 18 | + ref(path?: string | Reference): Reference; |
| 19 | + // (undocumented) |
| 20 | + refFromURL(url: string): Reference; |
| 21 | + // (undocumented) |
| 22 | + useEmulator(host: string, port: number): void; |
| 23 | +} |
| 24 | + |
| 25 | +// @public (undocumented) |
| 26 | +export interface DataSnapshot { |
| 27 | + // (undocumented) |
| 28 | + child(path: string): DataSnapshot; |
| 29 | + // (undocumented) |
| 30 | + exists(): boolean; |
| 31 | + // (undocumented) |
| 32 | + exportVal(): any; |
| 33 | + // (undocumented) |
| 34 | + forEach(action: (a: DataSnapshot) => boolean | void): boolean; |
| 35 | + // (undocumented) |
| 36 | + getPriority(): string | number | null; |
| 37 | + // (undocumented) |
| 38 | + hasChild(path: string): boolean; |
| 39 | + // (undocumented) |
| 40 | + hasChildren(): boolean; |
| 41 | + // (undocumented) |
| 42 | + key: string | null; |
| 43 | + // (undocumented) |
| 44 | + numChildren(): number; |
| 45 | + // (undocumented) |
| 46 | + ref: Reference; |
| 47 | + // (undocumented) |
| 48 | + toJSON(): object | null; |
| 49 | + // (undocumented) |
| 50 | + val(): any; |
| 51 | +} |
| 52 | + |
| 53 | +// @public (undocumented) |
| 54 | +export function enableLogging( |
| 55 | + logger?: boolean | ((a: string) => any), |
| 56 | + persistent?: boolean |
| 57 | +): any; |
| 58 | + |
| 59 | +// @public (undocumented) |
| 60 | +export type EventType = |
| 61 | + | 'value' |
| 62 | + | 'child_added' |
| 63 | + | 'child_changed' |
| 64 | + | 'child_moved' |
| 65 | + | 'child_removed'; |
| 66 | + |
| 67 | +// @public (undocumented) |
| 68 | +export function getDatabase(app: FirebaseApp, url?: string): Database; |
| 69 | + |
| 70 | +// @public (undocumented) |
| 71 | +export interface OnDisconnect { |
| 72 | + // (undocumented) |
| 73 | + cancel(onComplete?: (a: Error | null) => any): Promise<void>; |
| 74 | + // (undocumented) |
| 75 | + remove(onComplete?: (a: Error | null) => any): Promise<void>; |
| 76 | + // (undocumented) |
| 77 | + set(value: any, onComplete?: (a: Error | null) => any): Promise<void>; |
| 78 | + // (undocumented) |
| 79 | + setWithPriority( |
| 80 | + value: any, |
| 81 | + priority: number | string | null, |
| 82 | + onComplete?: (a: Error | null) => any |
| 83 | + ): Promise<any>; |
| 84 | + // (undocumented) |
| 85 | + update(values: object, onComplete?: (a: Error | null) => any): Promise<any>; |
| 86 | +} |
| 87 | + |
| 88 | +// @public (undocumented) |
| 89 | +export interface Query { |
| 90 | + // (undocumented) |
| 91 | + endAt(value: number | string | boolean | null, key?: string): Query; |
| 92 | + // (undocumented) |
| 93 | + equalTo(value: number | string | boolean | null, key?: string): Query; |
| 94 | + // (undocumented) |
| 95 | + get(): Promise<DataSnapshot>; |
| 96 | + // (undocumented) |
| 97 | + isEqual(other: Query | null): boolean; |
| 98 | + // (undocumented) |
| 99 | + limitToFirst(limit: number): Query; |
| 100 | + // (undocumented) |
| 101 | + limitToLast(limit: number): Query; |
| 102 | + // (undocumented) |
| 103 | + off( |
| 104 | + eventType?: EventType, |
| 105 | + callback?: (a: DataSnapshot, b?: string | null) => any, |
| 106 | + context?: object | null |
| 107 | + ): void; |
| 108 | + // (undocumented) |
| 109 | + on( |
| 110 | + eventType: EventType, |
| 111 | + callback: (a: DataSnapshot, b?: string | null) => any, |
| 112 | + cancelCallbackOrContext?: ((a: Error) => any) | object | null, |
| 113 | + context?: object | null |
| 114 | + ): (a: DataSnapshot, b?: string | null) => any; |
| 115 | + // (undocumented) |
| 116 | + once( |
| 117 | + eventType: EventType, |
| 118 | + successCallback?: (a: DataSnapshot, b?: string | null) => any, |
| 119 | + failureCallbackOrContext?: ((a: Error) => void) | object | null, |
| 120 | + context?: object | null |
| 121 | + ): Promise<DataSnapshot>; |
| 122 | + // (undocumented) |
| 123 | + orderByChild(path: string): Query; |
| 124 | + // (undocumented) |
| 125 | + orderByKey(): Query; |
| 126 | + // (undocumented) |
| 127 | + orderByPriority(): Query; |
| 128 | + // (undocumented) |
| 129 | + orderByValue(): Query; |
| 130 | + // (undocumented) |
| 131 | + ref: Reference; |
| 132 | + // (undocumented) |
| 133 | + startAt(value: number | string | boolean | null, key?: string): Query; |
| 134 | + // (undocumented) |
| 135 | + toJSON(): object; |
| 136 | + // (undocumented) |
| 137 | + toString(): string; |
| 138 | +} |
| 139 | + |
| 140 | +// @public (undocumented) |
| 141 | +export interface Reference extends Query { |
| 142 | + // (undocumented) |
| 143 | + child(path: string): Reference; |
| 144 | + // (undocumented) |
| 145 | + key: string | null; |
| 146 | + // (undocumented) |
| 147 | + onDisconnect(): OnDisconnect; |
| 148 | + // (undocumented) |
| 149 | + parent: Reference | null; |
| 150 | + // (undocumented) |
| 151 | + push(value?: any, onComplete?: (a: Error | null) => any): ThenableReference; |
| 152 | + // (undocumented) |
| 153 | + remove(onComplete?: (a: Error | null) => any): Promise<any>; |
| 154 | + // (undocumented) |
| 155 | + root: Reference; |
| 156 | + // (undocumented) |
| 157 | + set(value: any, onComplete?: (a: Error | null) => any): Promise<any>; |
| 158 | + // (undocumented) |
| 159 | + setPriority( |
| 160 | + priority: string | number | null, |
| 161 | + onComplete: (a: Error | null) => any |
| 162 | + ): Promise<any>; |
| 163 | + // (undocumented) |
| 164 | + setWithPriority( |
| 165 | + newVal: any, |
| 166 | + newPriority: string | number | null, |
| 167 | + onComplete?: (a: Error | null) => any |
| 168 | + ): Promise<any>; |
| 169 | + // (undocumented) |
| 170 | + transaction( |
| 171 | + transactionUpdate: (a: any) => any, |
| 172 | + onComplete?: (a: Error | null, b: boolean, c: DataSnapshot | null) => any, |
| 173 | + applyLocally?: boolean |
| 174 | + ): Promise<any>; |
| 175 | + // (undocumented) |
| 176 | + update(values: object, onComplete?: (a: Error | null) => any): Promise<any>; |
| 177 | +} |
| 178 | + |
| 179 | +// @public (undocumented) |
| 180 | +export interface ServerValue { |
| 181 | + // (undocumented) |
| 182 | + increment(delta: number): object; |
| 183 | + // (undocumented) |
| 184 | + TIMESTAMP: object; |
| 185 | +} |
| 186 | + |
| 187 | +// @public (undocumented) |
| 188 | +export interface ThenableReference |
| 189 | + extends Reference, |
| 190 | + Pick<Promise<Reference>, 'then' | 'catch'> { } |
| 191 | + |
| 192 | + |
| 193 | +// (No @packageDocumentation comment for this package) |
| 194 | + |
| 195 | +``` |
0 commit comments