@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
|
@@ -1,134 +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 './Path';
|
|
18
|
-
/**
|
|
19
|
-
* Node in a Tree.
|
|
20
|
-
*/
|
|
21
|
-
export declare class TreeNode<T> {
|
|
22
|
-
children: {
|
|
23
|
-
[name: string]: TreeNode<T>;
|
|
24
|
-
};
|
|
25
|
-
childCount: number;
|
|
26
|
-
value: T | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A light-weight tree, traversable by path. Nodes can have both values and children.
|
|
30
|
-
* Nodes are not enumerated (by forEachChild) unless they have a value or non-empty
|
|
31
|
-
* children.
|
|
32
|
-
*/
|
|
33
|
-
export declare class Tree<T> {
|
|
34
|
-
private name_;
|
|
35
|
-
private parent_;
|
|
36
|
-
private node_;
|
|
37
|
-
/**
|
|
38
|
-
* @template T
|
|
39
|
-
* @param {string=} name_ Optional name of the node.
|
|
40
|
-
* @param {Tree=} parent_ Optional parent node.
|
|
41
|
-
* @param {TreeNode=} node_ Optional node to wrap.
|
|
42
|
-
*/
|
|
43
|
-
constructor(name_?: string, parent_?: Tree<T> | null, node_?: TreeNode<T>);
|
|
44
|
-
/**
|
|
45
|
-
* Returns a sub-Tree for the given path.
|
|
46
|
-
*
|
|
47
|
-
* @param {!(string|Path)} pathObj Path to look up.
|
|
48
|
-
* @return {!Tree.<T>} Tree for path.
|
|
49
|
-
*/
|
|
50
|
-
subTree(pathObj: string | Path): Tree<T>;
|
|
51
|
-
/**
|
|
52
|
-
* Returns the data associated with this tree node.
|
|
53
|
-
*
|
|
54
|
-
* @return {?T} The data or null if no data exists.
|
|
55
|
-
*/
|
|
56
|
-
getValue(): T | null;
|
|
57
|
-
/**
|
|
58
|
-
* Sets data to this tree node.
|
|
59
|
-
*
|
|
60
|
-
* @param {!T} value Value to set.
|
|
61
|
-
*/
|
|
62
|
-
setValue(value: T): void;
|
|
63
|
-
/**
|
|
64
|
-
* Clears the contents of the tree node (its value and all children).
|
|
65
|
-
*/
|
|
66
|
-
clear(): void;
|
|
67
|
-
/**
|
|
68
|
-
* @return {boolean} Whether the tree has any children.
|
|
69
|
-
*/
|
|
70
|
-
hasChildren(): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* @return {boolean} Whether the tree is empty (no value or children).
|
|
73
|
-
*/
|
|
74
|
-
isEmpty(): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Calls action for each child of this tree node.
|
|
77
|
-
*
|
|
78
|
-
* @param {function(!Tree.<T>)} action Action to be called for each child.
|
|
79
|
-
*/
|
|
80
|
-
forEachChild(action: (tree: Tree<T>) => void): void;
|
|
81
|
-
/**
|
|
82
|
-
* Does a depth-first traversal of this node's descendants, calling action for each one.
|
|
83
|
-
*
|
|
84
|
-
* @param {function(!Tree.<T>)} action Action to be called for each child.
|
|
85
|
-
* @param {boolean=} includeSelf Whether to call action on this node as well. Defaults to
|
|
86
|
-
* false.
|
|
87
|
-
* @param {boolean=} childrenFirst Whether to call action on children before calling it on
|
|
88
|
-
* parent.
|
|
89
|
-
*/
|
|
90
|
-
forEachDescendant(action: (tree: Tree<T>) => void, includeSelf?: boolean, childrenFirst?: boolean): void;
|
|
91
|
-
/**
|
|
92
|
-
* Calls action on each ancestor node.
|
|
93
|
-
*
|
|
94
|
-
* @param {function(!Tree.<T>)} action Action to be called on each parent; return
|
|
95
|
-
* true to abort.
|
|
96
|
-
* @param {boolean=} includeSelf Whether to call action on this node as well.
|
|
97
|
-
* @return {boolean} true if the action callback returned true.
|
|
98
|
-
*/
|
|
99
|
-
forEachAncestor(action: (tree: Tree<T>) => unknown, includeSelf?: boolean): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Does a depth-first traversal of this node's descendants. When a descendant with a value
|
|
102
|
-
* is found, action is called on it and traversal does not continue inside the node.
|
|
103
|
-
* Action is *not* called on this node.
|
|
104
|
-
*
|
|
105
|
-
* @param {function(!Tree.<T>)} action Action to be called for each child.
|
|
106
|
-
*/
|
|
107
|
-
forEachImmediateDescendantWithValue(action: (tree: Tree<T>) => void): void;
|
|
108
|
-
/**
|
|
109
|
-
* @return {!Path} The path of this tree node, as a Path.
|
|
110
|
-
*/
|
|
111
|
-
path(): Path;
|
|
112
|
-
/**
|
|
113
|
-
* @return {string} The name of the tree node.
|
|
114
|
-
*/
|
|
115
|
-
name(): string;
|
|
116
|
-
/**
|
|
117
|
-
* @return {?Tree} The parent tree node, or null if this is the root of the tree.
|
|
118
|
-
*/
|
|
119
|
-
parent(): Tree<T> | null;
|
|
120
|
-
/**
|
|
121
|
-
* Adds or removes this child from its parent based on whether it's empty or not.
|
|
122
|
-
*
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
private updateParents_;
|
|
126
|
-
/**
|
|
127
|
-
* Adds or removes the passed child to this tree node, depending on whether it's empty.
|
|
128
|
-
*
|
|
129
|
-
* @param {string} childName The name of the child to update.
|
|
130
|
-
* @param {!Tree.<T>} child The child to update.
|
|
131
|
-
* @private
|
|
132
|
-
*/
|
|
133
|
-
private updateChild_;
|
|
134
|
-
}
|
|
@@ -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 { EventEmitter } from './EventEmitter';
|
|
18
|
-
/**
|
|
19
|
-
* @extends {EventEmitter}
|
|
20
|
-
*/
|
|
21
|
-
export declare class VisibilityMonitor extends EventEmitter {
|
|
22
|
-
private visible_;
|
|
23
|
-
static getInstance(): VisibilityMonitor;
|
|
24
|
-
constructor();
|
|
25
|
-
/**
|
|
26
|
-
* @param {!string} eventType
|
|
27
|
-
* @return {Array.<boolean>}
|
|
28
|
-
*/
|
|
29
|
-
getInitialEvent(eventType: string): boolean[];
|
|
30
|
-
}
|
|
@@ -1,37 +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 '../Path';
|
|
18
|
-
import { RepoInfo } from '../../RepoInfo';
|
|
19
|
-
export declare const parseRepoInfo: (dataURL: string, nodeAdmin: boolean) => {
|
|
20
|
-
repoInfo: RepoInfo;
|
|
21
|
-
path: Path;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param {!string} dataURL
|
|
26
|
-
* @return {{host: string, port: number, domain: string, subdomain: string, secure: boolean, scheme: string, pathString: string, namespace: string}}
|
|
27
|
-
*/
|
|
28
|
-
export declare const parseDatabaseURL: (dataURL: string) => {
|
|
29
|
-
host: string;
|
|
30
|
-
port: number;
|
|
31
|
-
domain: string;
|
|
32
|
-
subdomain: string;
|
|
33
|
-
secure: boolean;
|
|
34
|
-
scheme: string;
|
|
35
|
-
pathString: string;
|
|
36
|
-
namespace: string;
|
|
37
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
export interface Indexable {
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
}
|
|
@@ -1,232 +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 { Query } from '../../api/Query';
|
|
18
|
-
/**
|
|
19
|
-
* Returns a locally-unique ID (generated by just incrementing up from 0 each time its called).
|
|
20
|
-
* @type {function(): number} Generated ID.
|
|
21
|
-
*/
|
|
22
|
-
export declare const LUIDGenerator: () => number;
|
|
23
|
-
/**
|
|
24
|
-
* Sha1 hash of the input string
|
|
25
|
-
* @param {!string} str The string to hash
|
|
26
|
-
* @return {!string} The resulting hash
|
|
27
|
-
*/
|
|
28
|
-
export declare const sha1: (str: string) => string;
|
|
29
|
-
/**
|
|
30
|
-
* Use this for all debug messages in Firebase.
|
|
31
|
-
* @type {?function(string)}
|
|
32
|
-
*/
|
|
33
|
-
export declare let logger: ((a: string) => void) | null;
|
|
34
|
-
/**
|
|
35
|
-
* The implementation of Firebase.enableLogging (defined here to break dependencies)
|
|
36
|
-
* @param {boolean|?function(string)} logger_ A flag to turn on logging, or a custom logger
|
|
37
|
-
* @param {boolean=} persistent Whether or not to persist logging settings across refreshes
|
|
38
|
-
*/
|
|
39
|
-
export declare const enableLogging: (logger_?: boolean | ((a: string) => void), persistent?: boolean) => void;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {...(string|Arguments)} varArgs
|
|
43
|
-
*/
|
|
44
|
-
export declare const log: (...varArgs: unknown[]) => void;
|
|
45
|
-
/**
|
|
46
|
-
* @param {!string} prefix
|
|
47
|
-
* @return {function(...[*])}
|
|
48
|
-
*/
|
|
49
|
-
export declare const logWrapper: (prefix: string) => (...varArgs: unknown[]) => void;
|
|
50
|
-
/**
|
|
51
|
-
* @param {...string} varArgs
|
|
52
|
-
*/
|
|
53
|
-
export declare const error: (...varArgs: string[]) => void;
|
|
54
|
-
/**
|
|
55
|
-
* @param {...string} varArgs
|
|
56
|
-
*/
|
|
57
|
-
export declare const fatal: (...varArgs: string[]) => never;
|
|
58
|
-
/**
|
|
59
|
-
* @param {...*} varArgs
|
|
60
|
-
*/
|
|
61
|
-
export declare const warn: (...varArgs: unknown[]) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Logs a warning if the containing page uses https. Called when a call to new Firebase
|
|
64
|
-
* does not use https.
|
|
65
|
-
*/
|
|
66
|
-
export declare const warnIfPageIsSecure: () => void;
|
|
67
|
-
/**
|
|
68
|
-
* @param {!String} methodName
|
|
69
|
-
*/
|
|
70
|
-
export declare const warnAboutUnsupportedMethod: (methodName: string) => void;
|
|
71
|
-
/**
|
|
72
|
-
* Returns true if data is NaN, or +/- Infinity.
|
|
73
|
-
* @param {*} data
|
|
74
|
-
* @return {boolean}
|
|
75
|
-
*/
|
|
76
|
-
export declare const isInvalidJSONNumber: (data: unknown) => boolean;
|
|
77
|
-
/**
|
|
78
|
-
* @param {function()} fn
|
|
79
|
-
*/
|
|
80
|
-
export declare const executeWhenDOMReady: (fn: () => void) => void;
|
|
81
|
-
/**
|
|
82
|
-
* Minimum key name. Invalid for actual data, used as a marker to sort before any valid names
|
|
83
|
-
* @type {!string}
|
|
84
|
-
*/
|
|
85
|
-
export declare const MIN_NAME = "[MIN_NAME]";
|
|
86
|
-
/**
|
|
87
|
-
* Maximum key name. Invalid for actual data, used as a marker to sort above any valid names
|
|
88
|
-
* @type {!string}
|
|
89
|
-
*/
|
|
90
|
-
export declare const MAX_NAME = "[MAX_NAME]";
|
|
91
|
-
/**
|
|
92
|
-
* Compares valid Firebase key names, plus min and max name
|
|
93
|
-
* @param {!string} a
|
|
94
|
-
* @param {!string} b
|
|
95
|
-
* @return {!number}
|
|
96
|
-
*/
|
|
97
|
-
export declare const nameCompare: (a: string, b: string) => number;
|
|
98
|
-
/**
|
|
99
|
-
* @param {!string} a
|
|
100
|
-
* @param {!string} b
|
|
101
|
-
* @return {!number} comparison result.
|
|
102
|
-
*/
|
|
103
|
-
export declare const stringCompare: (a: string, b: string) => number;
|
|
104
|
-
/**
|
|
105
|
-
* @param {string} key
|
|
106
|
-
* @param {Object} obj
|
|
107
|
-
* @return {*}
|
|
108
|
-
*/
|
|
109
|
-
export declare const requireKey: (key: string, obj: {
|
|
110
|
-
[k: string]: unknown;
|
|
111
|
-
}) => unknown;
|
|
112
|
-
/**
|
|
113
|
-
* @param {*} obj
|
|
114
|
-
* @return {string}
|
|
115
|
-
*/
|
|
116
|
-
export declare const ObjectToUniqueKey: (obj: unknown) => string;
|
|
117
|
-
/**
|
|
118
|
-
* Splits a string into a number of smaller segments of maximum size
|
|
119
|
-
* @param {!string} str The string
|
|
120
|
-
* @param {!number} segsize The maximum number of chars in the string.
|
|
121
|
-
* @return {Array.<string>} The string, split into appropriately-sized chunks
|
|
122
|
-
*/
|
|
123
|
-
export declare const splitStringBySize: (str: string, segsize: number) => string[];
|
|
124
|
-
/**
|
|
125
|
-
* Apply a function to each (key, value) pair in an object or
|
|
126
|
-
* apply a function to each (index, value) pair in an array
|
|
127
|
-
* @param obj The object or array to iterate over
|
|
128
|
-
* @param fn The function to apply
|
|
129
|
-
*/
|
|
130
|
-
export declare function each(obj: object, fn: (k: string, v: unknown) => void): void;
|
|
131
|
-
/**
|
|
132
|
-
* Like goog.bind, but doesn't bother to create a closure if opt_context is null/undefined.
|
|
133
|
-
* @param {function(*)} callback Callback function.
|
|
134
|
-
* @param {?Object=} context Optional context to bind to.
|
|
135
|
-
* @return {function(*)}
|
|
136
|
-
*/
|
|
137
|
-
export declare const bindCallback: (callback: (a: unknown) => void, context?: object | null) => (a: unknown) => void;
|
|
138
|
-
/**
|
|
139
|
-
* Borrowed from http://hg.secondlife.com/llsd/src/tip/js/typedarray.js (MIT License)
|
|
140
|
-
* I made one modification at the end and removed the NaN / Infinity
|
|
141
|
-
* handling (since it seemed broken [caused an overflow] and we don't need it). See MJL comments.
|
|
142
|
-
* @param {!number} v A double
|
|
143
|
-
* @return {string}
|
|
144
|
-
*/
|
|
145
|
-
export declare const doubleToIEEE754String: (v: number) => string;
|
|
146
|
-
/**
|
|
147
|
-
* Used to detect if we're in a Chrome content script (which executes in an
|
|
148
|
-
* isolated environment where long-polling doesn't work).
|
|
149
|
-
* @return {boolean}
|
|
150
|
-
*/
|
|
151
|
-
export declare const isChromeExtensionContentScript: () => boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Used to detect if we're in a Windows 8 Store app.
|
|
154
|
-
* @return {boolean}
|
|
155
|
-
*/
|
|
156
|
-
export declare const isWindowsStoreApp: () => boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Converts a server error code to a Javascript Error
|
|
159
|
-
* @param {!string} code
|
|
160
|
-
* @param {!Query} query
|
|
161
|
-
* @return {Error}
|
|
162
|
-
*/
|
|
163
|
-
export declare const errorForServerCode: (code: string, query: Query) => Error;
|
|
164
|
-
/**
|
|
165
|
-
* Used to test for integer-looking strings
|
|
166
|
-
* @type {RegExp}
|
|
167
|
-
* @private
|
|
168
|
-
*/
|
|
169
|
-
export declare const INTEGER_REGEXP_: RegExp;
|
|
170
|
-
/**
|
|
171
|
-
* For use in keys, the minimum possible 32-bit integer.
|
|
172
|
-
*/
|
|
173
|
-
export declare const INTEGER_32_MIN = -2147483648;
|
|
174
|
-
/**
|
|
175
|
-
* For use in kyes, the maximum possible 32-bit integer.
|
|
176
|
-
*/
|
|
177
|
-
export declare const INTEGER_32_MAX = 2147483647;
|
|
178
|
-
/**
|
|
179
|
-
* If the string contains a 32-bit integer, return it. Else return null.
|
|
180
|
-
* @param {!string} str
|
|
181
|
-
* @return {?number}
|
|
182
|
-
*/
|
|
183
|
-
export declare const tryParseInt: (str: string) => number | null;
|
|
184
|
-
/**
|
|
185
|
-
* Helper to run some code but catch any exceptions and re-throw them later.
|
|
186
|
-
* Useful for preventing user callbacks from breaking internal code.
|
|
187
|
-
*
|
|
188
|
-
* Re-throwing the exception from a setTimeout is a little evil, but it's very
|
|
189
|
-
* convenient (we don't have to try to figure out when is a safe point to
|
|
190
|
-
* re-throw it), and the behavior seems reasonable:
|
|
191
|
-
*
|
|
192
|
-
* * If you aren't pausing on exceptions, you get an error in the console with
|
|
193
|
-
* the correct stack trace.
|
|
194
|
-
* * If you're pausing on all exceptions, the debugger will pause on your
|
|
195
|
-
* exception and then again when we rethrow it.
|
|
196
|
-
* * If you're only pausing on uncaught exceptions, the debugger will only pause
|
|
197
|
-
* on us re-throwing it.
|
|
198
|
-
*
|
|
199
|
-
* @param {!function()} fn The code to guard.
|
|
200
|
-
*/
|
|
201
|
-
export declare const exceptionGuard: (fn: () => void) => void;
|
|
202
|
-
/**
|
|
203
|
-
* Helper function to safely call opt_callback with the specified arguments. It:
|
|
204
|
-
* 1. Turns into a no-op if opt_callback is null or undefined.
|
|
205
|
-
* 2. Wraps the call inside exceptionGuard to prevent exceptions from breaking our state.
|
|
206
|
-
*
|
|
207
|
-
* @param {?Function=} callback Optional onComplete callback.
|
|
208
|
-
* @param {...*} varArgs Arbitrary args to be passed to opt_onComplete
|
|
209
|
-
*/
|
|
210
|
-
export declare const callUserCallback: (callback?: Function | null, ...varArgs: unknown[]) => void;
|
|
211
|
-
/**
|
|
212
|
-
* @return {boolean} true if we think we're currently being crawled.
|
|
213
|
-
*/
|
|
214
|
-
export declare const beingCrawled: () => boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Export a property of an object using a getter function.
|
|
217
|
-
*
|
|
218
|
-
* @param {!Object} object
|
|
219
|
-
* @param {string} name
|
|
220
|
-
* @param {!function(): *} fnGet
|
|
221
|
-
*/
|
|
222
|
-
export declare const exportPropGetter: (object: object, name: string, fnGet: () => unknown) => void;
|
|
223
|
-
/**
|
|
224
|
-
* Same as setTimeout() except on Node.JS it will /not/ prevent the process from exiting.
|
|
225
|
-
*
|
|
226
|
-
* It is removed with clearTimeout() as normal.
|
|
227
|
-
*
|
|
228
|
-
* @param {Function} fn Function to run.
|
|
229
|
-
* @param {number} time Milliseconds to wait before running.
|
|
230
|
-
* @return {number|Object} The setTimeout() return value.
|
|
231
|
-
*/
|
|
232
|
-
export declare const setTimeoutNonBlocking: (fn: () => void, time: number) => number | object;
|
|
@@ -1,108 +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, ValidationPath } from './Path';
|
|
18
|
-
import { RepoInfo } from '../RepoInfo';
|
|
19
|
-
/**
|
|
20
|
-
* True for invalid Firebase keys
|
|
21
|
-
* @type {RegExp}
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
export declare const INVALID_KEY_REGEX_: RegExp;
|
|
25
|
-
/**
|
|
26
|
-
* True for invalid Firebase paths.
|
|
27
|
-
* Allows '/' in paths.
|
|
28
|
-
* @type {RegExp}
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
export declare const INVALID_PATH_REGEX_: RegExp;
|
|
32
|
-
/**
|
|
33
|
-
* Maximum number of characters to allow in leaf value
|
|
34
|
-
* @type {number}
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
export declare const MAX_LEAF_SIZE_: number;
|
|
38
|
-
/**
|
|
39
|
-
* @param {*} key
|
|
40
|
-
* @return {boolean}
|
|
41
|
-
*/
|
|
42
|
-
export declare const isValidKey: (key: unknown) => boolean;
|
|
43
|
-
/**
|
|
44
|
-
* @param {string} pathString
|
|
45
|
-
* @return {boolean}
|
|
46
|
-
*/
|
|
47
|
-
export declare const isValidPathString: (pathString: string) => boolean;
|
|
48
|
-
/**
|
|
49
|
-
* @param {string} pathString
|
|
50
|
-
* @return {boolean}
|
|
51
|
-
*/
|
|
52
|
-
export declare const isValidRootPathString: (pathString: string) => boolean;
|
|
53
|
-
/**
|
|
54
|
-
* @param {*} priority
|
|
55
|
-
* @return {boolean}
|
|
56
|
-
*/
|
|
57
|
-
export declare const isValidPriority: (priority: unknown) => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Pre-validate a datum passed as an argument to Firebase function.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} fnName
|
|
62
|
-
* @param {number} argumentNumber
|
|
63
|
-
* @param {*} data
|
|
64
|
-
* @param {!Path} path
|
|
65
|
-
* @param {boolean} optional
|
|
66
|
-
*/
|
|
67
|
-
export declare const validateFirebaseDataArg: (fnName: string, argumentNumber: number, data: unknown, path: Path, optional: boolean) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Validate a data object client-side before sending to server.
|
|
70
|
-
*
|
|
71
|
-
* @param {string} errorPrefix
|
|
72
|
-
* @param {*} data
|
|
73
|
-
* @param {!Path|!ValidationPath} path_
|
|
74
|
-
*/
|
|
75
|
-
export declare const validateFirebaseData: (errorPrefix: string, data: unknown, path_: Path | ValidationPath) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Pre-validate paths passed in the firebase function.
|
|
78
|
-
*
|
|
79
|
-
* @param {string} errorPrefix
|
|
80
|
-
* @param {Array<!Path>} mergePaths
|
|
81
|
-
*/
|
|
82
|
-
export declare const validateFirebaseMergePaths: (errorPrefix: string, mergePaths: Path[]) => void;
|
|
83
|
-
/**
|
|
84
|
-
* pre-validate an object passed as an argument to firebase function (
|
|
85
|
-
* must be an object - e.g. for firebase.update()).
|
|
86
|
-
*
|
|
87
|
-
* @param {string} fnName
|
|
88
|
-
* @param {number} argumentNumber
|
|
89
|
-
* @param {*} data
|
|
90
|
-
* @param {!Path} path
|
|
91
|
-
* @param {boolean} optional
|
|
92
|
-
*/
|
|
93
|
-
export declare const validateFirebaseMergeDataArg: (fnName: string, argumentNumber: number, data: unknown, path: Path, optional: boolean) => void;
|
|
94
|
-
export declare const validatePriority: (fnName: string, argumentNumber: number, priority: unknown, optional: boolean) => void;
|
|
95
|
-
export declare const validateEventType: (fnName: string, argumentNumber: number, eventType: string, optional: boolean) => void;
|
|
96
|
-
export declare const validateKey: (fnName: string, argumentNumber: number, key: string, optional: boolean) => void;
|
|
97
|
-
export declare const validatePathString: (fnName: string, argumentNumber: number, pathString: string, optional: boolean) => void;
|
|
98
|
-
export declare const validateRootPathString: (fnName: string, argumentNumber: number, pathString: string, optional: boolean) => void;
|
|
99
|
-
export declare const validateWritablePath: (fnName: string, path: Path) => void;
|
|
100
|
-
export declare const validateUrl: (fnName: string, argumentNumber: number, parsedUrl: {
|
|
101
|
-
repoInfo: RepoInfo;
|
|
102
|
-
path: Path;
|
|
103
|
-
}) => void;
|
|
104
|
-
export declare const validateCredential: (fnName: string, argumentNumber: number, cred: unknown, optional: boolean) => void;
|
|
105
|
-
export declare const validateBoolean: (fnName: string, argumentNumber: number, bool: unknown, optional: boolean) => void;
|
|
106
|
-
export declare const validateString: (fnName: string, argumentNumber: number, string: unknown, optional: boolean) => void;
|
|
107
|
-
export declare const validateObject: (fnName: string, argumentNumber: number, obj: unknown, optional: boolean) => void;
|
|
108
|
-
export declare const validateObjectContainsKey: (fnName: string, argumentNumber: number, obj: unknown, key: string, optional: boolean, optType?: string) => void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
/** The semver (www.semver.org) version of the SDK. */
|
|
18
|
-
export declare let SDK_VERSION: string;
|
|
19
|
-
export declare function setSDKVersion(version: string): void;
|
|
@@ -1,59 +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 '../snap/Node';
|
|
18
|
-
import { Path } from '../util/Path';
|
|
19
|
-
/**
|
|
20
|
-
* A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully
|
|
21
|
-
* initialized in the sense that we know at one point in time this represented a valid state of the world, e.g.
|
|
22
|
-
* initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks
|
|
23
|
-
* whether a node potentially had children removed due to a filter.
|
|
24
|
-
*/
|
|
25
|
-
export declare class CacheNode {
|
|
26
|
-
private node_;
|
|
27
|
-
private fullyInitialized_;
|
|
28
|
-
private filtered_;
|
|
29
|
-
/**
|
|
30
|
-
* @param {!Node} node_
|
|
31
|
-
* @param {boolean} fullyInitialized_
|
|
32
|
-
* @param {boolean} filtered_
|
|
33
|
-
*/
|
|
34
|
-
constructor(node_: Node, fullyInitialized_: boolean, filtered_: boolean);
|
|
35
|
-
/**
|
|
36
|
-
* Returns whether this node was fully initialized with either server data or a complete overwrite by the client
|
|
37
|
-
* @return {boolean}
|
|
38
|
-
*/
|
|
39
|
-
isFullyInitialized(): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Returns whether this node is potentially missing children due to a filter applied to the node
|
|
42
|
-
* @return {boolean}
|
|
43
|
-
*/
|
|
44
|
-
isFiltered(): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* @param {!Path} path
|
|
47
|
-
* @return {boolean}
|
|
48
|
-
*/
|
|
49
|
-
isCompleteForPath(path: Path): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* @param {!string} key
|
|
52
|
-
* @return {boolean}
|
|
53
|
-
*/
|
|
54
|
-
isCompleteForChild(key: string): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* @return {!Node}
|
|
57
|
-
*/
|
|
58
|
-
getNode(): Node;
|
|
59
|
-
}
|