|
| 1 | +## API Report File for "@firebase/database-exp" |
| 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'; |
| 8 | + |
| 9 | +// @public (undocumented) |
| 10 | +export class DataSnapshot { |
| 11 | + child(path: string): DataSnapshot; |
| 12 | + exists(): boolean; |
| 13 | + exportVal(): any; |
| 14 | + forEach(action: (child: DataSnapshot) => boolean | void): boolean; |
| 15 | + hasChild(path: string): boolean; |
| 16 | + hasChildren(): boolean; |
| 17 | + get key(): string | null; |
| 18 | + get priority(): string | number | null; |
| 19 | + readonly ref: Reference; |
| 20 | + get size(): number; |
| 21 | + toJSON(): object | null; |
| 22 | + val(): any; |
| 23 | +} |
| 24 | + |
| 25 | +// @public |
| 26 | +export function enableLogging(enabled: boolean, persistent?: boolean): any; |
| 27 | + |
| 28 | +// @public |
| 29 | +export function enableLogging(logger: (message: string) => unknown): any; |
| 30 | + |
| 31 | +// @public |
| 32 | +export function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; |
| 33 | + |
| 34 | +// @public |
| 35 | +export function endBefore(value: number | string | boolean | null, key?: string): QueryConstraint; |
| 36 | + |
| 37 | +// @public |
| 38 | +export function equalTo(value: number | string | boolean | null, key?: string): QueryConstraint; |
| 39 | + |
| 40 | +// @public |
| 41 | +export type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed'; |
| 42 | + |
| 43 | +// @public |
| 44 | +export class FirebaseDatabase { |
| 45 | + readonly app: FirebaseApp; |
| 46 | + readonly 'type' = "database"; |
| 47 | +} |
| 48 | + |
| 49 | +// @public |
| 50 | +export function get(query: Query): Promise<DataSnapshot>; |
| 51 | + |
| 52 | +// @public |
| 53 | +export function getDatabase(app?: FirebaseApp, url?: string): FirebaseDatabase; |
| 54 | + |
| 55 | +// @public |
| 56 | +export function goOffline(db: FirebaseDatabase): void; |
| 57 | + |
| 58 | +// @public |
| 59 | +export function goOnline(db: FirebaseDatabase): void; |
| 60 | + |
| 61 | +// @public |
| 62 | +export function increment(delta: number): object; |
| 63 | + |
| 64 | +// @public |
| 65 | +export function limitToFirst(limit: number): QueryConstraint; |
| 66 | + |
| 67 | +// @public |
| 68 | +export function limitToLast(limit: number): QueryConstraint; |
| 69 | + |
| 70 | +// @public |
| 71 | +export interface ListenOptions { |
| 72 | + readonly onlyOnce?: boolean; |
| 73 | +} |
| 74 | + |
| 75 | +// @public |
| 76 | +export function off(query: Query, eventType?: EventType, callback?: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown): void; |
| 77 | + |
| 78 | +// @public |
| 79 | +export function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName?: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; |
| 80 | + |
| 81 | +// @public |
| 82 | +export function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; |
| 83 | + |
| 84 | +// @public |
| 85 | +export function onChildAdded(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; |
| 86 | + |
| 87 | +// @public |
| 88 | +export function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; |
| 89 | + |
| 90 | +// @public |
| 91 | +export function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; |
| 92 | + |
| 93 | +// @public |
| 94 | +export function onChildChanged(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; |
| 95 | + |
| 96 | +// @public |
| 97 | +export function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; |
| 98 | + |
| 99 | +// @public |
| 100 | +export function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, options: ListenOptions): Unsubscribe; |
| 101 | + |
| 102 | +// @public |
| 103 | +export function onChildMoved(query: Query, callback: (snapshot: DataSnapshot, previousChildName: string | null) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; |
| 104 | + |
| 105 | +// @public |
| 106 | +export function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; |
| 107 | + |
| 108 | +// @public |
| 109 | +export function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; |
| 110 | + |
| 111 | +// @public |
| 112 | +export function onChildRemoved(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; |
| 113 | + |
| 114 | +// @public |
| 115 | +export class OnDisconnect { |
| 116 | + cancel(): Promise<void>; |
| 117 | + remove(): Promise<void>; |
| 118 | + set(value: unknown): Promise<void>; |
| 119 | + setWithPriority(value: unknown, priority: number | string | null): Promise<void>; |
| 120 | + update(values: object): Promise<void>; |
| 121 | +} |
| 122 | + |
| 123 | +// @public |
| 124 | +export function onDisconnect(ref: Reference): OnDisconnect; |
| 125 | + |
| 126 | +// @public |
| 127 | +export function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback?: (error: Error) => unknown): Unsubscribe; |
| 128 | + |
| 129 | +// @public |
| 130 | +export function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, options: ListenOptions): Unsubscribe; |
| 131 | + |
| 132 | +// @public |
| 133 | +export function onValue(query: Query, callback: (snapshot: DataSnapshot) => unknown, cancelCallback: (error: Error) => unknown, options: ListenOptions): Unsubscribe; |
| 134 | + |
| 135 | +// @public |
| 136 | +export function orderByChild(path: string): QueryConstraint; |
| 137 | + |
| 138 | +// @public |
| 139 | +export function orderByKey(): QueryConstraint; |
| 140 | + |
| 141 | +// @public |
| 142 | +export function orderByPriority(): QueryConstraint; |
| 143 | + |
| 144 | +// @public |
| 145 | +export function orderByValue(): QueryConstraint; |
| 146 | + |
| 147 | +// @public |
| 148 | +export function push(parent: Reference, value?: unknown): ThenableReference; |
| 149 | + |
| 150 | +// @public |
| 151 | +export interface Query { |
| 152 | + isEqual(other: Query | null): boolean; |
| 153 | + readonly ref: Reference; |
| 154 | + toJSON(): string; |
| 155 | + toString(): string; |
| 156 | +} |
| 157 | + |
| 158 | +// @public |
| 159 | +export function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; |
| 160 | + |
| 161 | +// @public |
| 162 | +export abstract class QueryConstraint { |
| 163 | + abstract readonly type: QueryConstraintType; |
| 164 | +} |
| 165 | + |
| 166 | +// @public |
| 167 | +export type QueryConstraintType = 'endAt' | 'endBefore' | 'startAt' | 'startAfter' | 'limitToFirst' | 'limitToLast' | 'orderByChild' | 'orderByKey' | 'orderByPriority' | 'orderByValue' | 'equalTo'; |
| 168 | + |
| 169 | +// @public |
| 170 | +export function ref(db: FirebaseDatabase, path?: string): Reference; |
| 171 | + |
| 172 | +// @public |
| 173 | +export interface Reference extends Query { |
| 174 | + readonly key: string | null; |
| 175 | + readonly parent: Reference | null; |
| 176 | + readonly root: Reference; |
| 177 | +} |
| 178 | + |
| 179 | +// @public |
| 180 | +export function refFromURL(db: FirebaseDatabase, url: string): Reference; |
| 181 | + |
| 182 | +// @public |
| 183 | +export function remove(ref: Reference): Promise<void>; |
| 184 | + |
| 185 | +// @public |
| 186 | +export function runTransaction(ref: Reference, transactionUpdate: (currentData: any) => unknown, options?: TransactionOptions): Promise<TransactionResult>; |
| 187 | + |
| 188 | +// @public |
| 189 | +export function serverTimestamp(): object; |
| 190 | + |
| 191 | +// @public |
| 192 | +export function set(ref: Reference, value: unknown): Promise<void>; |
| 193 | + |
| 194 | +// @public |
| 195 | +export function setPriority(ref: Reference, priority: string | number | null): Promise<void>; |
| 196 | + |
| 197 | +// @public |
| 198 | +export function setWithPriority(ref: Reference, value: unknown, priority: string | number | null): Promise<void>; |
| 199 | + |
| 200 | +// @public |
| 201 | +export function startAfter(value: number | string | boolean | null, key?: string): QueryConstraint; |
| 202 | + |
| 203 | +// @public |
| 204 | +export function startAt(value?: number | string | boolean | null, key?: string): QueryConstraint; |
| 205 | + |
| 206 | +// @public |
| 207 | +export interface ThenableReference extends Reference, Pick<Promise<Reference>, 'then' | 'catch'> { |
| 208 | +} |
| 209 | + |
| 210 | +// @public |
| 211 | +export interface TransactionOptions { |
| 212 | + readonly applyLocally?: boolean; |
| 213 | +} |
| 214 | + |
| 215 | +// @public |
| 216 | +export class TransactionResult { |
| 217 | + readonly committed: boolean; |
| 218 | + readonly snapshot: DataSnapshot; |
| 219 | + toJSON(): object; |
| 220 | +} |
| 221 | + |
| 222 | +// @public |
| 223 | +export type Unsubscribe = () => void; |
| 224 | + |
| 225 | +// @public |
| 226 | +export function update(ref: Reference, values: object): Promise<void>; |
| 227 | + |
| 228 | +// @public |
| 229 | +export function useDatabaseEmulator(db: FirebaseDatabase, host: string, port: number): void; |
| 230 | + |
| 231 | + |
| 232 | +// (No @packageDocumentation comment for this package) |
| 233 | + |
| 234 | +``` |
0 commit comments