@firebase/database 0.8.3-canary.fb90580e5 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -16
- package/dist/index.esm.js +34 -163
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm2017.js +34 -161
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +34 -163
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/src/api/Query.d.ts +0 -2
- package/dist/src/core/AuthTokenProvider.d.ts +2 -2
- package/dist/src/core/Repo.d.ts +21 -10
- package/dist/src/core/RepoManager.d.ts +2 -8
- package/dist/src/core/util/NextPushId.d.ts +0 -2
- package/dist/src/core/util/util.d.ts +0 -8
- package/dist/src/core/view/QueryParams.d.ts +0 -6
- package/package.json +13 -16
- package/dist/exp/exp/index.d.ts +0 -29
- package/dist/exp/index.d.ts +0 -49
- package/dist/exp/index.esm.js +0 -15735
- package/dist/exp/index.esm.js.map +0 -1
- package/dist/exp/index.esm2017.js +0 -15139
- package/dist/exp/index.esm2017.js.map +0 -1
- package/dist/exp/index.node.cjs.js +0 -15746
- package/dist/exp/index.node.cjs.js.map +0 -1
- package/dist/exp/index.node.d.ts +0 -83
- package/dist/exp/src/api/DataSnapshot.d.ts +0 -99
- package/dist/exp/src/api/Database.d.ts +0 -87
- package/dist/exp/src/api/Query.d.ts +0 -193
- package/dist/exp/src/api/Reference.d.ts +0 -106
- package/dist/exp/src/api/TransactionResult.d.ts +0 -30
- package/dist/exp/src/api/internal.d.ts +0 -55
- package/dist/exp/src/api/onDisconnect.d.ts +0 -60
- package/dist/exp/src/api/test_access.d.ts +0 -42
- package/dist/exp/src/core/AuthTokenProvider.d.ts +0 -50
- package/dist/exp/src/core/CompoundWrite.d.ts +0 -77
- package/dist/exp/src/core/PersistentConnection.d.ts +0 -148
- package/dist/exp/src/core/ReadonlyRestClient.d.ts +0 -73
- package/dist/exp/src/core/Repo.d.ts +0 -121
- package/dist/exp/src/core/RepoInfo.d.ts +0 -59
- package/dist/exp/src/core/RepoManager.d.ts +0 -78
- package/dist/exp/src/core/Repo_transaction.d.ts +0 -33
- package/dist/exp/src/core/ServerActions.d.ts +0 -85
- package/dist/exp/src/core/SnapshotHolder.d.ts +0 -28
- package/dist/exp/src/core/SparseSnapshotTree.d.ts +0 -61
- package/dist/exp/src/core/SyncPoint.d.ts +0 -84
- package/dist/exp/src/core/SyncTree.d.ts +0 -236
- package/dist/exp/src/core/WriteTree.d.ts +0 -295
- package/dist/exp/src/core/operation/AckUserWrite.d.ts +0 -42
- package/dist/exp/src/core/operation/ListenComplete.d.ts +0 -32
- package/dist/exp/src/core/operation/Merge.d.ts +0 -46
- package/dist/exp/src/core/operation/Operation.d.ts +0 -78
- package/dist/exp/src/core/operation/Overwrite.d.ts +0 -35
- package/dist/exp/src/core/snap/ChildrenNode.d.ts +0 -180
- package/dist/exp/src/core/snap/IndexMap.d.ts +0 -43
- package/dist/exp/src/core/snap/LeafNode.d.ts +0 -107
- package/dist/exp/src/core/snap/Node.d.ts +0 -148
- package/dist/exp/src/core/snap/childSet.d.ts +0 -34
- package/dist/exp/src/core/snap/comparators.d.ts +0 -19
- package/dist/exp/src/core/snap/indexes/Index.d.ts +0 -69
- package/dist/exp/src/core/snap/indexes/KeyIndex.d.ts +0 -54
- package/dist/exp/src/core/snap/indexes/PathIndex.d.ts +0 -54
- package/dist/exp/src/core/snap/indexes/PriorityIndex.d.ts +0 -58
- package/dist/exp/src/core/snap/indexes/ValueIndex.d.ts +0 -56
- package/dist/exp/src/core/snap/nodeFromJSON.d.ts +0 -25
- package/dist/exp/src/core/snap/snap.d.ts +0 -29
- package/dist/exp/src/core/stats/StatsCollection.d.ts +0 -28
- package/dist/exp/src/core/stats/StatsListener.d.ts +0 -31
- package/dist/exp/src/core/stats/StatsManager.d.ts +0 -24
- package/dist/exp/src/core/stats/StatsReporter.d.ts +0 -33
- package/dist/exp/src/core/storage/DOMStorageWrapper.d.ts +0 -55
- package/dist/exp/src/core/storage/MemoryStorage.d.ts +0 -29
- package/dist/exp/src/core/storage/storage.d.ts +0 -22
- package/dist/exp/src/core/util/EventEmitter.d.ts +0 -45
- package/dist/exp/src/core/util/ImmutableTree.d.ts +0 -157
- package/dist/exp/src/core/util/NextPushId.d.ts +0 -33
- package/dist/exp/src/core/util/OnlineMonitor.d.ts +0 -40
- package/dist/exp/src/core/util/Path.d.ts +0 -132
- package/dist/exp/src/core/util/ServerValues.d.ts +0 -66
- package/dist/exp/src/core/util/SortedMap.d.ts +0 -362
- package/dist/exp/src/core/util/Tree.d.ts +0 -134
- package/dist/exp/src/core/util/VisibilityMonitor.d.ts +0 -30
- package/dist/exp/src/core/util/libs/parser.d.ts +0 -37
- package/dist/exp/src/core/util/misc.d.ts +0 -19
- package/dist/exp/src/core/util/util.d.ts +0 -232
- package/dist/exp/src/core/util/validation.d.ts +0 -108
- package/dist/exp/src/core/version.d.ts +0 -19
- package/dist/exp/src/core/view/CacheNode.d.ts +0 -59
- package/dist/exp/src/core/view/Change.d.ts +0 -74
- package/dist/exp/src/core/view/ChildChangeAccumulator.d.ts +0 -22
- package/dist/exp/src/core/view/CompleteChildSource.d.ts +0 -91
- package/dist/exp/src/core/view/Event.d.ts +0 -102
- package/dist/exp/src/core/view/EventGenerator.d.ts +0 -77
- package/dist/exp/src/core/view/EventQueue.d.ts +0 -99
- package/dist/exp/src/core/view/EventRegistration.d.ts +0 -154
- package/dist/exp/src/core/view/QueryParams.d.ts +0 -176
- package/dist/exp/src/core/view/View.d.ts +0 -97
- package/dist/exp/src/core/view/ViewCache.d.ts +0 -70
- package/dist/exp/src/core/view/ViewProcessor.d.ts +0 -166
- package/dist/exp/src/core/view/filter/IndexedFilter.d.ts +0 -54
- package/dist/exp/src/core/view/filter/LimitedFilter.d.ts +0 -94
- package/dist/exp/src/core/view/filter/NodeFilter.d.ts +0 -75
- package/dist/exp/src/core/view/filter/RangedFilter.d.ts +0 -109
- package/dist/exp/src/exp/Database.d.ts +0 -95
- package/dist/exp/src/realtime/BrowserPollConnection.d.ts +0 -208
- package/dist/exp/src/realtime/Connection.d.ts +0 -119
- package/dist/exp/src/realtime/Constants.d.ts +0 -26
- package/dist/exp/src/realtime/Transport.d.ts +0 -62
- package/dist/exp/src/realtime/TransportManager.d.ts +0 -55
- package/dist/exp/src/realtime/WebSocketConnection.d.ts +0 -133
- package/dist/exp/src/realtime/polling/PacketReceiver.d.ts +0 -41
- package/dist/exp/test/browser/crawler_support.test.d.ts +0 -17
- package/dist/exp/test/compound_write.test.d.ts +0 -17
- package/dist/exp/test/connection.test.d.ts +0 -17
- package/dist/exp/test/database.test.d.ts +0 -17
- package/dist/exp/test/datasnapshot.test.d.ts +0 -17
- package/dist/exp/test/exp/integration.test.d.ts +0 -17
- package/dist/exp/test/helpers/EventAccumulator.d.ts +0 -34
- package/dist/exp/test/helpers/events.d.ts +0 -37
- package/dist/exp/test/helpers/util.d.ts +0 -50
- package/dist/exp/test/info.test.d.ts +0 -17
- package/dist/exp/test/node.test.d.ts +0 -17
- package/dist/exp/test/order.test.d.ts +0 -17
- package/dist/exp/test/order_by.test.d.ts +0 -17
- package/dist/exp/test/path.test.d.ts +0 -17
- package/dist/exp/test/promise.test.d.ts +0 -17
- package/dist/exp/test/pushid.test.d.ts +0 -17
- package/dist/exp/test/query.test.d.ts +0 -17
- package/dist/exp/test/repoinfo.test.d.ts +0 -17
- package/dist/exp/test/servervalues.test.d.ts +0 -17
- package/dist/exp/test/sortedmap.test.d.ts +0 -17
- package/dist/exp/test/sparsesnapshottree.test.d.ts +0 -17
- package/dist/exp/test/transaction.test.d.ts +0 -17
- package/dist/src/exp/Database.d.ts +0 -95
- package/dist/test/exp/integration.test.d.ts +0 -17
- package/dist/test/pushid.test.d.ts +0 -17
package/dist/exp/index.node.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { FirebaseNamespace, FirebaseApp } from '@firebase/app-types';
|
|
18
|
-
import { Database } from './src/api/Database';
|
|
19
|
-
import { DataSnapshot } from './src/api/DataSnapshot';
|
|
20
|
-
import { Query } from './src/api/Query';
|
|
21
|
-
import { Reference } from './src/api/Reference';
|
|
22
|
-
import { enableLogging } from './src/core/util/util';
|
|
23
|
-
import * as INTERNAL from './src/api/internal';
|
|
24
|
-
import * as TEST_ACCESS from './src/api/test_access';
|
|
25
|
-
import * as types from '@firebase/database-types';
|
|
26
|
-
declare const ServerValue: {
|
|
27
|
-
TIMESTAMP: {
|
|
28
|
-
'.sv': string;
|
|
29
|
-
};
|
|
30
|
-
increment: (delta: number) => {
|
|
31
|
-
'.sv': {
|
|
32
|
-
increment: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* A one off register function which returns a database based on the app and
|
|
38
|
-
* passed database URL. (Used by the Admin SDK)
|
|
39
|
-
*
|
|
40
|
-
* @param app A valid FirebaseApp-like object
|
|
41
|
-
* @param url A valid Firebase databaseURL
|
|
42
|
-
* @param version custom version e.g. firebase-admin version
|
|
43
|
-
* @param nodeAdmin true if the SDK is being initialized from Firebase Admin.
|
|
44
|
-
*/
|
|
45
|
-
export declare function initStandalone(app: FirebaseApp, url: string, version: string, nodeAdmin?: boolean): {
|
|
46
|
-
instance: types.Database;
|
|
47
|
-
namespace: {
|
|
48
|
-
Reference: typeof Reference;
|
|
49
|
-
Query: typeof Query;
|
|
50
|
-
Database: typeof Database;
|
|
51
|
-
DataSnapshot: typeof DataSnapshot;
|
|
52
|
-
enableLogging: (logger_?: boolean | ((a: string) => void), persistent?: boolean) => void;
|
|
53
|
-
INTERNAL: typeof INTERNAL;
|
|
54
|
-
ServerValue: {
|
|
55
|
-
TIMESTAMP: {
|
|
56
|
-
'.sv': string;
|
|
57
|
-
};
|
|
58
|
-
increment: (delta: number) => {
|
|
59
|
-
'.sv': {
|
|
60
|
-
increment: number;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
TEST_ACCESS: typeof TEST_ACCESS;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export declare function registerDatabase(instance: FirebaseNamespace): void;
|
|
68
|
-
export { Database, Query, Reference, enableLogging, ServerValue };
|
|
69
|
-
export { DataSnapshot } from './src/api/DataSnapshot';
|
|
70
|
-
export { OnDisconnect } from './src/api/onDisconnect';
|
|
71
|
-
declare module '@firebase/app-types' {
|
|
72
|
-
interface FirebaseNamespace {
|
|
73
|
-
database?: {
|
|
74
|
-
(app?: FirebaseApp): types.FirebaseDatabase;
|
|
75
|
-
enableLogging: typeof types.enableLogging;
|
|
76
|
-
ServerValue: types.ServerValue;
|
|
77
|
-
Database: typeof types.FirebaseDatabase;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
interface FirebaseApp {
|
|
81
|
-
database?(): types.FirebaseDatabase;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Node } from '../core/snap/Node';
|
|
18
|
-
import { Reference } from './Reference';
|
|
19
|
-
import { Index } from '../core/snap/indexes/Index';
|
|
20
|
-
/**
|
|
21
|
-
* Class representing a firebase data snapshot. It wraps a SnapshotNode and
|
|
22
|
-
* surfaces the public methods (val, forEach, etc.) we want to expose.
|
|
23
|
-
*/
|
|
24
|
-
export declare class DataSnapshot {
|
|
25
|
-
private readonly node_;
|
|
26
|
-
private readonly ref_;
|
|
27
|
-
private readonly index_;
|
|
28
|
-
/**
|
|
29
|
-
* @param {!Node} node_ A SnapshotNode to wrap.
|
|
30
|
-
* @param {!Reference} ref_ The ref of the location this snapshot came from.
|
|
31
|
-
* @param {!Index} index_ The iteration order for this snapshot
|
|
32
|
-
*/
|
|
33
|
-
constructor(node_: Node, ref_: Reference, index_: Index);
|
|
34
|
-
/**
|
|
35
|
-
* Retrieves the snapshot contents as JSON. Returns null if the snapshot is
|
|
36
|
-
* empty.
|
|
37
|
-
*
|
|
38
|
-
* @return {*} JSON representation of the DataSnapshot contents, or null if empty.
|
|
39
|
-
*/
|
|
40
|
-
val(): unknown;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting
|
|
43
|
-
* the entire node contents.
|
|
44
|
-
* @return {*} JSON representation of the DataSnapshot contents, or null if empty.
|
|
45
|
-
*/
|
|
46
|
-
exportVal(): unknown;
|
|
47
|
-
toJSON(): unknown;
|
|
48
|
-
/**
|
|
49
|
-
* Returns whether the snapshot contains a non-null value.
|
|
50
|
-
*
|
|
51
|
-
* @return {boolean} Whether the snapshot contains a non-null value, or is empty.
|
|
52
|
-
*/
|
|
53
|
-
exists(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Returns a DataSnapshot of the specified child node's contents.
|
|
56
|
-
*
|
|
57
|
-
* @param {!string} childPathString Path to a child.
|
|
58
|
-
* @return {!DataSnapshot} DataSnapshot for child node.
|
|
59
|
-
*/
|
|
60
|
-
child(childPathString: string): DataSnapshot;
|
|
61
|
-
/**
|
|
62
|
-
* Returns whether the snapshot contains a child at the specified path.
|
|
63
|
-
*
|
|
64
|
-
* @param {!string} childPathString Path to a child.
|
|
65
|
-
* @return {boolean} Whether the child exists.
|
|
66
|
-
*/
|
|
67
|
-
hasChild(childPathString: string): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Returns the priority of the object, or null if no priority was set.
|
|
70
|
-
*
|
|
71
|
-
* @return {string|number|null} The priority.
|
|
72
|
-
*/
|
|
73
|
-
getPriority(): string | number | null;
|
|
74
|
-
/**
|
|
75
|
-
* Iterates through child nodes and calls the specified action for each one.
|
|
76
|
-
*
|
|
77
|
-
* @param {function(!DataSnapshot)} action Callback function to be called
|
|
78
|
-
* for each child.
|
|
79
|
-
* @return {boolean} True if forEach was canceled by action returning true for
|
|
80
|
-
* one of the child nodes.
|
|
81
|
-
*/
|
|
82
|
-
forEach(action: (d: DataSnapshot) => boolean | void): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Returns whether this DataSnapshot has children.
|
|
85
|
-
* @return {boolean} True if the DataSnapshot contains 1 or more child nodes.
|
|
86
|
-
*/
|
|
87
|
-
hasChildren(): boolean;
|
|
88
|
-
get key(): string;
|
|
89
|
-
/**
|
|
90
|
-
* Returns the number of children for this DataSnapshot.
|
|
91
|
-
* @return {number} The number of children that this DataSnapshot contains.
|
|
92
|
-
*/
|
|
93
|
-
numChildren(): number;
|
|
94
|
-
/**
|
|
95
|
-
* @return {Reference} The Firebase reference for the location this snapshot's data came from.
|
|
96
|
-
*/
|
|
97
|
-
getRef(): Reference;
|
|
98
|
-
get ref(): Reference;
|
|
99
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Reference } from './Reference';
|
|
18
|
-
import { Repo } from '../core/Repo';
|
|
19
|
-
import { FirebaseApp } from '@firebase/app-types';
|
|
20
|
-
import { FirebaseService } from '@firebase/app-types/private';
|
|
21
|
-
/**
|
|
22
|
-
* Class representing a firebase database.
|
|
23
|
-
* @implements {FirebaseService}
|
|
24
|
-
*/
|
|
25
|
-
export declare class Database implements FirebaseService {
|
|
26
|
-
private repoInternal_;
|
|
27
|
-
/** Track if the instance has been used (root or repo accessed) */
|
|
28
|
-
private instanceStarted_;
|
|
29
|
-
/** Backing state for root_ */
|
|
30
|
-
private rootInternal_?;
|
|
31
|
-
static readonly ServerValue: {
|
|
32
|
-
TIMESTAMP: {
|
|
33
|
-
'.sv': string;
|
|
34
|
-
};
|
|
35
|
-
increment: (delta: number) => {
|
|
36
|
-
'.sv': {
|
|
37
|
-
increment: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* The constructor should not be called by users of our public API.
|
|
43
|
-
* @param {!Repo} repoInternal_
|
|
44
|
-
*/
|
|
45
|
-
constructor(repoInternal_: Repo);
|
|
46
|
-
INTERNAL: {
|
|
47
|
-
delete: () => Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
private get repo_();
|
|
50
|
-
get root_(): Reference;
|
|
51
|
-
get app(): FirebaseApp;
|
|
52
|
-
/**
|
|
53
|
-
* Modify this instance to communicate with the Realtime Database emulator.
|
|
54
|
-
*
|
|
55
|
-
* <p>Note: This method must be called before performing any other operation.
|
|
56
|
-
*
|
|
57
|
-
* @param host the emulator host (ex: localhost)
|
|
58
|
-
* @param port the emulator port (ex: 8080)
|
|
59
|
-
*/
|
|
60
|
-
useEmulator(host: string, port: number): void;
|
|
61
|
-
/**
|
|
62
|
-
* Returns a reference to the root or to the path specified in the provided
|
|
63
|
-
* argument.
|
|
64
|
-
*
|
|
65
|
-
* @param {string|Reference=} path The relative string path or an existing
|
|
66
|
-
* Reference to a database location.
|
|
67
|
-
* @throws If a Reference is provided, throws if it does not belong to the
|
|
68
|
-
* same project.
|
|
69
|
-
* @return {!Reference} Firebase reference.
|
|
70
|
-
*/
|
|
71
|
-
ref(path?: string): Reference;
|
|
72
|
-
ref(path?: Reference): Reference;
|
|
73
|
-
/**
|
|
74
|
-
* Returns a reference to the root or the path specified in url.
|
|
75
|
-
* We throw a exception if the url is not in the same domain as the
|
|
76
|
-
* current repo.
|
|
77
|
-
* @param {string} url
|
|
78
|
-
* @return {!Reference} Firebase reference.
|
|
79
|
-
*/
|
|
80
|
-
refFromURL(url: string): Reference;
|
|
81
|
-
/**
|
|
82
|
-
* @param {string} apiName
|
|
83
|
-
*/
|
|
84
|
-
private checkDeleted_;
|
|
85
|
-
goOffline(): void;
|
|
86
|
-
goOnline(): void;
|
|
87
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Path } from '../core/util/Path';
|
|
18
|
-
import { Repo } from '../core/Repo';
|
|
19
|
-
import { QueryParams } from '../core/view/QueryParams';
|
|
20
|
-
import { Reference } from './Reference';
|
|
21
|
-
import { DataSnapshot } from './DataSnapshot';
|
|
22
|
-
export interface SnapshotCallback {
|
|
23
|
-
(a: DataSnapshot, b?: string | null): unknown;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* A Query represents a filter to be applied to a firebase location. This object purely represents the
|
|
27
|
-
* query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js.
|
|
28
|
-
*
|
|
29
|
-
* Since every Firebase reference is a query, Firebase inherits from this object.
|
|
30
|
-
*/
|
|
31
|
-
export declare class Query {
|
|
32
|
-
repo: Repo;
|
|
33
|
-
path: Path;
|
|
34
|
-
private queryParams_;
|
|
35
|
-
private orderByCalled_;
|
|
36
|
-
static set __referenceConstructor(val: new (repo: Repo, path: Path) => Query);
|
|
37
|
-
static get __referenceConstructor(): new (repo: Repo, path: Path) => Query;
|
|
38
|
-
constructor(repo: Repo, path: Path, queryParams_: QueryParams, orderByCalled_: boolean);
|
|
39
|
-
/**
|
|
40
|
-
* Validates start/end values for queries.
|
|
41
|
-
* @param {!QueryParams} params
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
private static validateQueryEndpoints_;
|
|
45
|
-
/**
|
|
46
|
-
* Validates that limit* has been called with the correct combination of parameters
|
|
47
|
-
* @param {!QueryParams} params
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
private static validateLimit_;
|
|
51
|
-
/**
|
|
52
|
-
* Validates that no other order by call has been made
|
|
53
|
-
* @param {!string} fnName
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
private validateNoPreviousOrderByCall_;
|
|
57
|
-
/**
|
|
58
|
-
* @return {!QueryParams}
|
|
59
|
-
*/
|
|
60
|
-
getQueryParams(): QueryParams;
|
|
61
|
-
/**
|
|
62
|
-
* @return {!Reference}
|
|
63
|
-
*/
|
|
64
|
-
getRef(): Reference;
|
|
65
|
-
/**
|
|
66
|
-
* @param {!string} eventType
|
|
67
|
-
* @param {!function(DataSnapshot, string=)} callback
|
|
68
|
-
* @param {(function(Error)|Object)=} cancelCallbackOrContext
|
|
69
|
-
* @param {Object=} context
|
|
70
|
-
* @return {!function(DataSnapshot, string=)}
|
|
71
|
-
*/
|
|
72
|
-
on(eventType: string, callback: SnapshotCallback, cancelCallbackOrContext?: ((a: Error) => unknown) | object | null, context?: object | null): SnapshotCallback;
|
|
73
|
-
/**
|
|
74
|
-
* @param {!function(!DataSnapshot)} callback
|
|
75
|
-
* @param {?function(Error)} cancelCallback
|
|
76
|
-
* @param {?Object} context
|
|
77
|
-
* @protected
|
|
78
|
-
*/
|
|
79
|
-
protected onValueEvent(callback: (a: DataSnapshot) => void, cancelCallback: ((a: Error) => void) | null, context: object | null): void;
|
|
80
|
-
/**
|
|
81
|
-
* @param {!Object.<string, !function(!DataSnapshot, ?string)>} callbacks
|
|
82
|
-
* @param {?function(Error)} cancelCallback
|
|
83
|
-
* @param {?Object} context
|
|
84
|
-
* @protected
|
|
85
|
-
*/
|
|
86
|
-
onChildEvent(callbacks: {
|
|
87
|
-
[k: string]: SnapshotCallback;
|
|
88
|
-
}, cancelCallback: ((a: Error) => unknown) | null, context: object | null): void;
|
|
89
|
-
/**
|
|
90
|
-
* @param {string=} eventType
|
|
91
|
-
* @param {(function(!DataSnapshot, ?string=))=} callback
|
|
92
|
-
* @param {Object=} context
|
|
93
|
-
*/
|
|
94
|
-
off(eventType?: string, callback?: SnapshotCallback, context?: object | null): void;
|
|
95
|
-
/**
|
|
96
|
-
* Get the server-value for this query, or return a cached value if not connected.
|
|
97
|
-
*/
|
|
98
|
-
get(): Promise<DataSnapshot>;
|
|
99
|
-
/**
|
|
100
|
-
* Attaches a listener, waits for the first event, and then removes the listener
|
|
101
|
-
* @param {!string} eventType
|
|
102
|
-
* @param {!function(!DataSnapshot, string=)} userCallback
|
|
103
|
-
* @param failureCallbackOrContext
|
|
104
|
-
* @param context
|
|
105
|
-
* @return {!firebase.Promise}
|
|
106
|
-
*/
|
|
107
|
-
once(eventType: string, userCallback?: SnapshotCallback, failureCallbackOrContext?: ((a: Error) => void) | object | null, context?: object | null): Promise<DataSnapshot>;
|
|
108
|
-
/**
|
|
109
|
-
* Set a limit and anchor it to the start of the window.
|
|
110
|
-
* @param {!number} limit
|
|
111
|
-
* @return {!Query}
|
|
112
|
-
*/
|
|
113
|
-
limitToFirst(limit: number): Query;
|
|
114
|
-
/**
|
|
115
|
-
* Set a limit and anchor it to the end of the window.
|
|
116
|
-
* @param {!number} limit
|
|
117
|
-
* @return {!Query}
|
|
118
|
-
*/
|
|
119
|
-
limitToLast(limit: number): Query;
|
|
120
|
-
/**
|
|
121
|
-
* Given a child path, return a new query ordered by the specified grandchild path.
|
|
122
|
-
* @param {!string} path
|
|
123
|
-
* @return {!Query}
|
|
124
|
-
*/
|
|
125
|
-
orderByChild(path: string): Query;
|
|
126
|
-
/**
|
|
127
|
-
* Return a new query ordered by the KeyIndex
|
|
128
|
-
* @return {!Query}
|
|
129
|
-
*/
|
|
130
|
-
orderByKey(): Query;
|
|
131
|
-
/**
|
|
132
|
-
* Return a new query ordered by the PriorityIndex
|
|
133
|
-
* @return {!Query}
|
|
134
|
-
*/
|
|
135
|
-
orderByPriority(): Query;
|
|
136
|
-
/**
|
|
137
|
-
* Return a new query ordered by the ValueIndex
|
|
138
|
-
* @return {!Query}
|
|
139
|
-
*/
|
|
140
|
-
orderByValue(): Query;
|
|
141
|
-
/**
|
|
142
|
-
* @param {number|string|boolean|null} value
|
|
143
|
-
* @param {?string=} name
|
|
144
|
-
* @return {!Query}
|
|
145
|
-
*/
|
|
146
|
-
startAt(value?: number | string | boolean | null, name?: string | null): Query;
|
|
147
|
-
startAfter(value?: number | string | boolean | null, name?: string | null): Query;
|
|
148
|
-
/**
|
|
149
|
-
* @param {number|string|boolean|null} value
|
|
150
|
-
* @param {?string=} name
|
|
151
|
-
* @return {!Query}
|
|
152
|
-
*/
|
|
153
|
-
endAt(value?: number | string | boolean | null, name?: string | null): Query;
|
|
154
|
-
endBefore(value?: number | string | boolean | null, name?: string | null): Query;
|
|
155
|
-
/**
|
|
156
|
-
* Load the selection of children with exactly the specified value, and, optionally,
|
|
157
|
-
* the specified name.
|
|
158
|
-
* @param {number|string|boolean|null} value
|
|
159
|
-
* @param {string=} name
|
|
160
|
-
* @return {!Query}
|
|
161
|
-
*/
|
|
162
|
-
equalTo(value: number | string | boolean | null, name?: string): Query;
|
|
163
|
-
/**
|
|
164
|
-
* @return {!string} URL for this location.
|
|
165
|
-
*/
|
|
166
|
-
toString(): string;
|
|
167
|
-
toJSON(): string;
|
|
168
|
-
/**
|
|
169
|
-
* An object representation of the query parameters used by this Query.
|
|
170
|
-
* @return {!Object}
|
|
171
|
-
*/
|
|
172
|
-
queryObject(): object;
|
|
173
|
-
/**
|
|
174
|
-
* @return {!string}
|
|
175
|
-
*/
|
|
176
|
-
queryIdentifier(): string;
|
|
177
|
-
/**
|
|
178
|
-
* Return true if this query and the provided query are equivalent; otherwise, return false.
|
|
179
|
-
* @param {Query} other
|
|
180
|
-
* @return {boolean}
|
|
181
|
-
*/
|
|
182
|
-
isEqual(other: Query): boolean;
|
|
183
|
-
/**
|
|
184
|
-
* Helper used by .on and .once to extract the context and or cancel arguments.
|
|
185
|
-
* @param {!string} fnName The function name (on or once)
|
|
186
|
-
* @param {(function(Error)|Object)=} cancelOrContext
|
|
187
|
-
* @param {Object=} context
|
|
188
|
-
* @return {{cancel: ?function(Error), context: ?Object}}
|
|
189
|
-
* @private
|
|
190
|
-
*/
|
|
191
|
-
private static getCancelAndContextArgs_;
|
|
192
|
-
get ref(): Reference;
|
|
193
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { OnDisconnect } from './onDisconnect';
|
|
18
|
-
import { TransactionResult } from './TransactionResult';
|
|
19
|
-
import { Query } from './Query';
|
|
20
|
-
import { Repo } from '../core/Repo';
|
|
21
|
-
import { Path } from '../core/util/Path';
|
|
22
|
-
import { Database } from './Database';
|
|
23
|
-
import { DataSnapshot } from './DataSnapshot';
|
|
24
|
-
export interface ReferenceConstructor {
|
|
25
|
-
new (repo: Repo, path: Path): Reference;
|
|
26
|
-
}
|
|
27
|
-
export declare class Reference extends Query {
|
|
28
|
-
then: Promise<Reference>['then'];
|
|
29
|
-
catch: Promise<Reference>['catch'];
|
|
30
|
-
/**
|
|
31
|
-
* Call options:
|
|
32
|
-
* new Reference(Repo, Path) or
|
|
33
|
-
* new Reference(url: string, string|RepoManager)
|
|
34
|
-
*
|
|
35
|
-
* Externally - this is the firebase.database.Reference type.
|
|
36
|
-
*
|
|
37
|
-
* @param {!Repo} repo
|
|
38
|
-
* @param {(!Path)} path
|
|
39
|
-
* @extends {Query}
|
|
40
|
-
*/
|
|
41
|
-
constructor(repo: Repo, path: Path);
|
|
42
|
-
/** @return {?string} */
|
|
43
|
-
getKey(): string | null;
|
|
44
|
-
/**
|
|
45
|
-
* @param {!(string|Path)} pathString
|
|
46
|
-
* @return {!Reference}
|
|
47
|
-
*/
|
|
48
|
-
child(pathString: string | Path): Reference;
|
|
49
|
-
/** @return {?Reference} */
|
|
50
|
-
getParent(): Reference | null;
|
|
51
|
-
/** @return {!Reference} */
|
|
52
|
-
getRoot(): Reference;
|
|
53
|
-
/** @return {!Database} */
|
|
54
|
-
databaseProp(): Database;
|
|
55
|
-
/**
|
|
56
|
-
* @param {*} newVal
|
|
57
|
-
* @param {function(?Error)=} onComplete
|
|
58
|
-
* @return {!Promise}
|
|
59
|
-
*/
|
|
60
|
-
set(newVal: unknown, onComplete?: (a: Error | null) => void): Promise<unknown>;
|
|
61
|
-
/**
|
|
62
|
-
* @param {!Object} objectToMerge
|
|
63
|
-
* @param {function(?Error)=} onComplete
|
|
64
|
-
* @return {!Promise}
|
|
65
|
-
*/
|
|
66
|
-
update(objectToMerge: object, onComplete?: (a: Error | null) => void): Promise<unknown>;
|
|
67
|
-
/**
|
|
68
|
-
* @param {*} newVal
|
|
69
|
-
* @param {string|number|null} newPriority
|
|
70
|
-
* @param {function(?Error)=} onComplete
|
|
71
|
-
* @return {!Promise}
|
|
72
|
-
*/
|
|
73
|
-
setWithPriority(newVal: unknown, newPriority: string | number | null, onComplete?: (a: Error | null) => void): Promise<unknown>;
|
|
74
|
-
/**
|
|
75
|
-
* @param {function(?Error)=} onComplete
|
|
76
|
-
* @return {!Promise}
|
|
77
|
-
*/
|
|
78
|
-
remove(onComplete?: (a: Error | null) => void): Promise<unknown>;
|
|
79
|
-
/**
|
|
80
|
-
* @param {function(*):*} transactionUpdate
|
|
81
|
-
* @param {(function(?Error, boolean, ?DataSnapshot))=} onComplete
|
|
82
|
-
* @param {boolean=} applyLocally
|
|
83
|
-
* @return {!Promise}
|
|
84
|
-
*/
|
|
85
|
-
transaction(transactionUpdate: (a: unknown) => unknown, onComplete?: (a: Error | null, b: boolean, c: DataSnapshot | null) => void, applyLocally?: boolean): Promise<TransactionResult>;
|
|
86
|
-
/**
|
|
87
|
-
* @param {string|number|null} priority
|
|
88
|
-
* @param {function(?Error)=} onComplete
|
|
89
|
-
* @return {!Promise}
|
|
90
|
-
*/
|
|
91
|
-
setPriority(priority: string | number | null, onComplete?: (a: Error | null) => void): Promise<unknown>;
|
|
92
|
-
/**
|
|
93
|
-
* @param {*=} value
|
|
94
|
-
* @param {function(?Error)=} onComplete
|
|
95
|
-
* @return {!Reference}
|
|
96
|
-
*/
|
|
97
|
-
push(value?: unknown, onComplete?: (a: Error | null) => void): Reference;
|
|
98
|
-
/**
|
|
99
|
-
* @return {!OnDisconnect}
|
|
100
|
-
*/
|
|
101
|
-
onDisconnect(): OnDisconnect;
|
|
102
|
-
get database(): Database;
|
|
103
|
-
get key(): string | null;
|
|
104
|
-
get parent(): Reference | null;
|
|
105
|
-
get root(): Reference;
|
|
106
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { DataSnapshot } from './DataSnapshot';
|
|
18
|
-
export declare class TransactionResult {
|
|
19
|
-
committed: boolean;
|
|
20
|
-
snapshot: DataSnapshot;
|
|
21
|
-
/**
|
|
22
|
-
* A type for the resolve value of Firebase.transaction.
|
|
23
|
-
* @constructor
|
|
24
|
-
* @dict
|
|
25
|
-
* @param {boolean} committed
|
|
26
|
-
* @param {DataSnapshot} snapshot
|
|
27
|
-
*/
|
|
28
|
-
constructor(committed: boolean, snapshot: DataSnapshot);
|
|
29
|
-
toJSON(): object;
|
|
30
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Reference } from './Reference';
|
|
18
|
-
import { FirebaseApp } from '@firebase/app-types';
|
|
19
|
-
import { FirebaseAuthInternal } from '@firebase/auth-interop-types';
|
|
20
|
-
import * as types from '@firebase/database-types';
|
|
21
|
-
/**
|
|
22
|
-
* INTERNAL methods for internal-use only (tests, etc.).
|
|
23
|
-
*
|
|
24
|
-
* Customers shouldn't use these or else should be aware that they could break at any time.
|
|
25
|
-
*
|
|
26
|
-
* @const
|
|
27
|
-
*/
|
|
28
|
-
export declare const forceLongPolling: () => void;
|
|
29
|
-
export declare const forceWebSockets: () => void;
|
|
30
|
-
export declare const isWebSocketsAvailable: () => boolean;
|
|
31
|
-
export declare const setSecurityDebugCallback: (ref: Reference, callback: (a: object) => void) => void;
|
|
32
|
-
export declare const stats: (ref: Reference, showDelta?: boolean) => void;
|
|
33
|
-
export declare const statsIncrementCounter: (ref: Reference, metric: string) => void;
|
|
34
|
-
export declare const dataUpdateCount: (ref: Reference) => number;
|
|
35
|
-
export declare const interceptServerData: (ref: Reference, callback: (a: string, b: unknown) => void) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Used by console to create a database based on the app,
|
|
38
|
-
* passed database URL and a custom auth implementation.
|
|
39
|
-
*
|
|
40
|
-
* @param app A valid FirebaseApp-like object
|
|
41
|
-
* @param url A valid Firebase databaseURL
|
|
42
|
-
* @param version custom version e.g. firebase-admin version
|
|
43
|
-
* @param customAuthImpl custom auth implementation
|
|
44
|
-
*/
|
|
45
|
-
export declare function initStandalone<T>({ app, url, version, customAuthImpl, namespace, nodeAdmin }: {
|
|
46
|
-
app: FirebaseApp;
|
|
47
|
-
url: string;
|
|
48
|
-
version: string;
|
|
49
|
-
customAuthImpl: FirebaseAuthInternal;
|
|
50
|
-
namespace: T;
|
|
51
|
-
nodeAdmin?: boolean;
|
|
52
|
-
}): {
|
|
53
|
-
instance: types.Database;
|
|
54
|
-
namespace: T;
|
|
55
|
-
};
|