@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,180 +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 { SortedMap, SortedMapIterator } from '../util/SortedMap';
|
|
18
|
-
import { Node, NamedNode } from './Node';
|
|
19
|
-
import { IndexMap } from './IndexMap';
|
|
20
|
-
import { Index } from './indexes/Index';
|
|
21
|
-
import { Path } from '../util/Path';
|
|
22
|
-
export interface ChildrenNodeConstructor {
|
|
23
|
-
new (children_: SortedMap<string, Node>, priorityNode_: Node | null, indexMap_: IndexMap): ChildrenNode;
|
|
24
|
-
EMPTY_NODE: ChildrenNode;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* ChildrenNode is a class for storing internal nodes in a DataSnapshot
|
|
28
|
-
* (i.e. nodes with children). It implements Node and stores the
|
|
29
|
-
* list of children in the children property, sorted by child name.
|
|
30
|
-
*
|
|
31
|
-
* @constructor
|
|
32
|
-
* @implements {Node}
|
|
33
|
-
*/
|
|
34
|
-
export declare class ChildrenNode implements Node {
|
|
35
|
-
private readonly children_;
|
|
36
|
-
private readonly priorityNode_;
|
|
37
|
-
private indexMap_;
|
|
38
|
-
private lazyHash_;
|
|
39
|
-
static get EMPTY_NODE(): ChildrenNode;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {!SortedMap.<string, !Node>} children_ List of children
|
|
43
|
-
* of this node..
|
|
44
|
-
* @param {?Node} priorityNode_ The priority of this node (as a snapshot node).
|
|
45
|
-
* @param {!IndexMap} indexMap_
|
|
46
|
-
*/
|
|
47
|
-
constructor(children_: SortedMap<string, Node>, priorityNode_: Node | null, indexMap_: IndexMap);
|
|
48
|
-
/** @inheritDoc */
|
|
49
|
-
isLeafNode(): boolean;
|
|
50
|
-
/** @inheritDoc */
|
|
51
|
-
getPriority(): Node;
|
|
52
|
-
/** @inheritDoc */
|
|
53
|
-
updatePriority(newPriorityNode: Node): Node;
|
|
54
|
-
/** @inheritDoc */
|
|
55
|
-
getImmediateChild(childName: string): Node;
|
|
56
|
-
/** @inheritDoc */
|
|
57
|
-
getChild(path: Path): Node;
|
|
58
|
-
/** @inheritDoc */
|
|
59
|
-
hasChild(childName: string): boolean;
|
|
60
|
-
/** @inheritDoc */
|
|
61
|
-
updateImmediateChild(childName: string, newChildNode: Node): Node;
|
|
62
|
-
/** @inheritDoc */
|
|
63
|
-
updateChild(path: Path, newChildNode: Node): Node;
|
|
64
|
-
/** @inheritDoc */
|
|
65
|
-
isEmpty(): boolean;
|
|
66
|
-
/** @inheritDoc */
|
|
67
|
-
numChildren(): number;
|
|
68
|
-
/**
|
|
69
|
-
* @private
|
|
70
|
-
* @type {RegExp}
|
|
71
|
-
*/
|
|
72
|
-
private static INTEGER_REGEXP_;
|
|
73
|
-
/** @inheritDoc */
|
|
74
|
-
val(exportFormat?: boolean): object;
|
|
75
|
-
/** @inheritDoc */
|
|
76
|
-
hash(): string;
|
|
77
|
-
/** @inheritDoc */
|
|
78
|
-
getPredecessorChildName(childName: string, childNode: Node, index: Index): string;
|
|
79
|
-
/**
|
|
80
|
-
* @param {!Index} indexDefinition
|
|
81
|
-
* @return {?string}
|
|
82
|
-
*/
|
|
83
|
-
getFirstChildName(indexDefinition: Index): string | null;
|
|
84
|
-
/**
|
|
85
|
-
* @param {!Index} indexDefinition
|
|
86
|
-
* @return {?NamedNode}
|
|
87
|
-
*/
|
|
88
|
-
getFirstChild(indexDefinition: Index): NamedNode | null;
|
|
89
|
-
/**
|
|
90
|
-
* Given an index, return the key name of the largest value we have, according to that index
|
|
91
|
-
* @param {!Index} indexDefinition
|
|
92
|
-
* @return {?string}
|
|
93
|
-
*/
|
|
94
|
-
getLastChildName(indexDefinition: Index): string | null;
|
|
95
|
-
/**
|
|
96
|
-
* @param {!Index} indexDefinition
|
|
97
|
-
* @return {?NamedNode}
|
|
98
|
-
*/
|
|
99
|
-
getLastChild(indexDefinition: Index): NamedNode | null;
|
|
100
|
-
/**
|
|
101
|
-
* @inheritDoc
|
|
102
|
-
*/
|
|
103
|
-
forEachChild(index: Index, action: (key: string, node: Node) => boolean | void): boolean;
|
|
104
|
-
/**
|
|
105
|
-
* @param {!Index} indexDefinition
|
|
106
|
-
* @return {SortedMapIterator}
|
|
107
|
-
*/
|
|
108
|
-
getIterator(indexDefinition: Index): SortedMapIterator<string | NamedNode, Node, NamedNode>;
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @param {!NamedNode} startPost
|
|
112
|
-
* @param {!Index} indexDefinition
|
|
113
|
-
* @return {!SortedMapIterator}
|
|
114
|
-
*/
|
|
115
|
-
getIteratorFrom(startPost: NamedNode, indexDefinition: Index): SortedMapIterator<string | NamedNode, Node, NamedNode>;
|
|
116
|
-
/**
|
|
117
|
-
* @param {!Index} indexDefinition
|
|
118
|
-
* @return {!SortedMapIterator}
|
|
119
|
-
*/
|
|
120
|
-
getReverseIterator(indexDefinition: Index): SortedMapIterator<string | NamedNode, Node, NamedNode>;
|
|
121
|
-
/**
|
|
122
|
-
* @param {!NamedNode} endPost
|
|
123
|
-
* @param {!Index} indexDefinition
|
|
124
|
-
* @return {!SortedMapIterator}
|
|
125
|
-
*/
|
|
126
|
-
getReverseIteratorFrom(endPost: NamedNode, indexDefinition: Index): SortedMapIterator<string | NamedNode, Node, NamedNode>;
|
|
127
|
-
/**
|
|
128
|
-
* @inheritDoc
|
|
129
|
-
*/
|
|
130
|
-
compareTo(other: ChildrenNode): number;
|
|
131
|
-
/**
|
|
132
|
-
* @inheritDoc
|
|
133
|
-
*/
|
|
134
|
-
withIndex(indexDefinition: Index): Node;
|
|
135
|
-
/**
|
|
136
|
-
* @inheritDoc
|
|
137
|
-
*/
|
|
138
|
-
isIndexed(index: Index): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* @inheritDoc
|
|
141
|
-
*/
|
|
142
|
-
equals(other: Node): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Returns a SortedMap ordered by index, or null if the default (by-key) ordering can be used
|
|
145
|
-
* instead.
|
|
146
|
-
*
|
|
147
|
-
* @private
|
|
148
|
-
* @param {!Index} indexDefinition
|
|
149
|
-
* @return {?SortedMap.<NamedNode, Node>}
|
|
150
|
-
*/
|
|
151
|
-
private resolveIndex_;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* @constructor
|
|
155
|
-
* @extends {ChildrenNode}
|
|
156
|
-
* @private
|
|
157
|
-
*/
|
|
158
|
-
export declare class MaxNode extends ChildrenNode {
|
|
159
|
-
constructor();
|
|
160
|
-
compareTo(other: Node): number;
|
|
161
|
-
equals(other: Node): boolean;
|
|
162
|
-
getPriority(): MaxNode;
|
|
163
|
-
getImmediateChild(childName: string): ChildrenNode;
|
|
164
|
-
isEmpty(): boolean;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Marker that will sort higher than any other snapshot.
|
|
168
|
-
* @type {!MAX_NODE}
|
|
169
|
-
* @const
|
|
170
|
-
*/
|
|
171
|
-
export declare const MAX_NODE: MaxNode;
|
|
172
|
-
/**
|
|
173
|
-
* Document NamedNode extensions
|
|
174
|
-
*/
|
|
175
|
-
declare module './Node' {
|
|
176
|
-
interface NamedNode {
|
|
177
|
-
MIN: NamedNode;
|
|
178
|
-
MAX: NamedNode;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
@@ -1,43 +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 { NamedNode, Node } from './Node';
|
|
18
|
-
import { SortedMap } from '../util/SortedMap';
|
|
19
|
-
import { Index } from './indexes/Index';
|
|
20
|
-
export declare class IndexMap {
|
|
21
|
-
private indexes_;
|
|
22
|
-
private indexSet_;
|
|
23
|
-
/**
|
|
24
|
-
* The default IndexMap for nodes without a priority
|
|
25
|
-
*/
|
|
26
|
-
static get Default(): IndexMap;
|
|
27
|
-
constructor(indexes_: {
|
|
28
|
-
[k: string]: SortedMap<NamedNode, Node> | /*FallbackType*/ object;
|
|
29
|
-
}, indexSet_: {
|
|
30
|
-
[k: string]: Index;
|
|
31
|
-
});
|
|
32
|
-
get(indexKey: string): SortedMap<NamedNode, Node> | null;
|
|
33
|
-
hasIndex(indexDefinition: Index): boolean;
|
|
34
|
-
addIndex(indexDefinition: Index, existingChildren: SortedMap<string, Node>): IndexMap;
|
|
35
|
-
/**
|
|
36
|
-
* Ensure that this node is properly tracked in any indexes that we're maintaining
|
|
37
|
-
*/
|
|
38
|
-
addToIndexes(namedNode: NamedNode, existingChildren: SortedMap<string, Node>): IndexMap;
|
|
39
|
-
/**
|
|
40
|
-
* Create a new IndexMap instance with the given value removed
|
|
41
|
-
*/
|
|
42
|
-
removeFromIndexes(namedNode: NamedNode, existingChildren: SortedMap<string, Node>): IndexMap;
|
|
43
|
-
}
|
|
@@ -1,107 +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 './Node';
|
|
18
|
-
import { Path } from '../util/Path';
|
|
19
|
-
import { Index } from './indexes/Index';
|
|
20
|
-
import { ChildrenNodeConstructor } from './ChildrenNode';
|
|
21
|
-
import { Indexable } from '../util/misc';
|
|
22
|
-
/**
|
|
23
|
-
* LeafNode is a class for storing leaf nodes in a DataSnapshot. It
|
|
24
|
-
* implements Node and stores the value of the node (a string,
|
|
25
|
-
* number, or boolean) accessible via getValue().
|
|
26
|
-
*/
|
|
27
|
-
export declare class LeafNode implements Node {
|
|
28
|
-
private readonly value_;
|
|
29
|
-
private priorityNode_;
|
|
30
|
-
static set __childrenNodeConstructor(val: ChildrenNodeConstructor);
|
|
31
|
-
static get __childrenNodeConstructor(): ChildrenNodeConstructor;
|
|
32
|
-
/**
|
|
33
|
-
* The sort order for comparing leaf nodes of different types. If two leaf nodes have
|
|
34
|
-
* the same type, the comparison falls back to their value
|
|
35
|
-
* @type {Array.<!string>}
|
|
36
|
-
* @const
|
|
37
|
-
*/
|
|
38
|
-
static VALUE_TYPE_ORDER: string[];
|
|
39
|
-
private lazyHash_;
|
|
40
|
-
/**
|
|
41
|
-
* @implements {Node}
|
|
42
|
-
* @param {!(string|number|boolean|Object)} value_ The value to store in this leaf node.
|
|
43
|
-
* The object type is possible in the event of a deferred value
|
|
44
|
-
* @param {!Node=} priorityNode_ The priority of this node.
|
|
45
|
-
*/
|
|
46
|
-
constructor(value_: string | number | boolean | Indexable, priorityNode_?: Node);
|
|
47
|
-
/** @inheritDoc */
|
|
48
|
-
isLeafNode(): boolean;
|
|
49
|
-
/** @inheritDoc */
|
|
50
|
-
getPriority(): Node;
|
|
51
|
-
/** @inheritDoc */
|
|
52
|
-
updatePriority(newPriorityNode: Node): Node;
|
|
53
|
-
/** @inheritDoc */
|
|
54
|
-
getImmediateChild(childName: string): Node;
|
|
55
|
-
/** @inheritDoc */
|
|
56
|
-
getChild(path: Path): Node;
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
hasChild(): boolean;
|
|
61
|
-
/** @inheritDoc */
|
|
62
|
-
getPredecessorChildName(childName: string, childNode: Node): null;
|
|
63
|
-
/** @inheritDoc */
|
|
64
|
-
updateImmediateChild(childName: string, newChildNode: Node): Node;
|
|
65
|
-
/** @inheritDoc */
|
|
66
|
-
updateChild(path: Path, newChildNode: Node): Node;
|
|
67
|
-
/** @inheritDoc */
|
|
68
|
-
isEmpty(): boolean;
|
|
69
|
-
/** @inheritDoc */
|
|
70
|
-
numChildren(): number;
|
|
71
|
-
/** @inheritDoc */
|
|
72
|
-
forEachChild(index: Index, action: (s: string, n: Node) => void): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* @inheritDoc
|
|
75
|
-
*/
|
|
76
|
-
val(exportFormat?: boolean): {};
|
|
77
|
-
/** @inheritDoc */
|
|
78
|
-
hash(): string;
|
|
79
|
-
/**
|
|
80
|
-
* Returns the value of the leaf node.
|
|
81
|
-
* @return {Object|string|number|boolean} The value of the node.
|
|
82
|
-
*/
|
|
83
|
-
getValue(): Indexable | string | number | boolean;
|
|
84
|
-
/**
|
|
85
|
-
* @inheritDoc
|
|
86
|
-
*/
|
|
87
|
-
compareTo(other: Node): number;
|
|
88
|
-
/**
|
|
89
|
-
* Comparison specifically for two leaf nodes
|
|
90
|
-
* @param {!LeafNode} otherLeaf
|
|
91
|
-
* @return {!number}
|
|
92
|
-
* @private
|
|
93
|
-
*/
|
|
94
|
-
private compareToLeafNode_;
|
|
95
|
-
/**
|
|
96
|
-
* @inheritDoc
|
|
97
|
-
*/
|
|
98
|
-
withIndex(): Node;
|
|
99
|
-
/**
|
|
100
|
-
* @inheritDoc
|
|
101
|
-
*/
|
|
102
|
-
isIndexed(): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* @inheritDoc
|
|
105
|
-
*/
|
|
106
|
-
equals(other: Node): boolean;
|
|
107
|
-
}
|
|
@@ -1,148 +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 '../util/Path';
|
|
18
|
-
import { Index } from './indexes/Index';
|
|
19
|
-
/**
|
|
20
|
-
* Node is an interface defining the common functionality for nodes in
|
|
21
|
-
* a DataSnapshot.
|
|
22
|
-
*
|
|
23
|
-
* @interface
|
|
24
|
-
*/
|
|
25
|
-
export interface Node {
|
|
26
|
-
/**
|
|
27
|
-
* Whether this node is a leaf node.
|
|
28
|
-
* @return {boolean} Whether this is a leaf node.
|
|
29
|
-
*/
|
|
30
|
-
isLeafNode(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the priority of the node.
|
|
33
|
-
* @return {!Node} The priority of the node.
|
|
34
|
-
*/
|
|
35
|
-
getPriority(): Node;
|
|
36
|
-
/**
|
|
37
|
-
* Returns a duplicate node with the new priority.
|
|
38
|
-
* @param {!Node} newPriorityNode New priority to set for the node.
|
|
39
|
-
* @return {!Node} Node with new priority.
|
|
40
|
-
*/
|
|
41
|
-
updatePriority(newPriorityNode: Node): Node;
|
|
42
|
-
/**
|
|
43
|
-
* Returns the specified immediate child, or null if it doesn't exist.
|
|
44
|
-
* @param {string} childName The name of the child to retrieve.
|
|
45
|
-
* @return {!Node} The retrieved child, or an empty node.
|
|
46
|
-
*/
|
|
47
|
-
getImmediateChild(childName: string): Node;
|
|
48
|
-
/**
|
|
49
|
-
* Returns a child by path, or null if it doesn't exist.
|
|
50
|
-
* @param {!Path} path The path of the child to retrieve.
|
|
51
|
-
* @return {!Node} The retrieved child or an empty node.
|
|
52
|
-
*/
|
|
53
|
-
getChild(path: Path): Node;
|
|
54
|
-
/**
|
|
55
|
-
* Returns the name of the child immediately prior to the specified childNode, or null.
|
|
56
|
-
* @param {!string} childName The name of the child to find the predecessor of.
|
|
57
|
-
* @param {!Node} childNode The node to find the predecessor of.
|
|
58
|
-
* @param {!Index} index The index to use to determine the predecessor
|
|
59
|
-
* @return {?string} The name of the predecessor child, or null if childNode is the first child.
|
|
60
|
-
*/
|
|
61
|
-
getPredecessorChildName(childName: string, childNode: Node, index: Index): string | null;
|
|
62
|
-
/**
|
|
63
|
-
* Returns a duplicate node, with the specified immediate child updated.
|
|
64
|
-
* Any value in the node will be removed.
|
|
65
|
-
* @param {string} childName The name of the child to update.
|
|
66
|
-
* @param {!Node} newChildNode The new child node
|
|
67
|
-
* @return {!Node} The updated node.
|
|
68
|
-
*/
|
|
69
|
-
updateImmediateChild(childName: string, newChildNode: Node): Node;
|
|
70
|
-
/**
|
|
71
|
-
* Returns a duplicate node, with the specified child updated. Any value will
|
|
72
|
-
* be removed.
|
|
73
|
-
* @param {!Path} path The path of the child to update.
|
|
74
|
-
* @param {!Node} newChildNode The new child node, which may be an empty node
|
|
75
|
-
* @return {!Node} The updated node.
|
|
76
|
-
*/
|
|
77
|
-
updateChild(path: Path, newChildNode: Node): Node;
|
|
78
|
-
/**
|
|
79
|
-
* True if the immediate child specified exists
|
|
80
|
-
* @param {!string} childName
|
|
81
|
-
* @return {boolean}
|
|
82
|
-
*/
|
|
83
|
-
hasChild(childName: string): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* @return {boolean} True if this node has no value or children.
|
|
86
|
-
*/
|
|
87
|
-
isEmpty(): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* @return {number} The number of children of this node.
|
|
90
|
-
*/
|
|
91
|
-
numChildren(): number;
|
|
92
|
-
/**
|
|
93
|
-
* Calls action for each child.
|
|
94
|
-
* @param {!Index} index
|
|
95
|
-
* @param {function(string, !Node)} action Action to be called for
|
|
96
|
-
* each child. It's passed the child name and the child node.
|
|
97
|
-
* @return {*} The first truthy value return by action, or the last falsey one
|
|
98
|
-
*/
|
|
99
|
-
forEachChild(index: Index, action: (a: string, b: Node) => void): unknown;
|
|
100
|
-
/**
|
|
101
|
-
* @param exportFormat True for export format (also wire protocol format).
|
|
102
|
-
* @return Value of this node as JSON.
|
|
103
|
-
*/
|
|
104
|
-
val(exportFormat?: boolean): unknown;
|
|
105
|
-
/**
|
|
106
|
-
* @return {string} hash representing the node contents.
|
|
107
|
-
*/
|
|
108
|
-
hash(): string;
|
|
109
|
-
/**
|
|
110
|
-
* @param {!Node} other Another node
|
|
111
|
-
* @return {!number} -1 for less than, 0 for equal, 1 for greater than other
|
|
112
|
-
*/
|
|
113
|
-
compareTo(other: Node): number;
|
|
114
|
-
/**
|
|
115
|
-
* @param {!Node} other
|
|
116
|
-
* @return {boolean} Whether or not this snapshot equals other
|
|
117
|
-
*/
|
|
118
|
-
equals(other: Node): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* @param {!Index} indexDefinition
|
|
121
|
-
* @return {!Node} This node, with the specified index now available
|
|
122
|
-
*/
|
|
123
|
-
withIndex(indexDefinition: Index): Node;
|
|
124
|
-
/**
|
|
125
|
-
* @param {!Index} indexDefinition
|
|
126
|
-
* @return {boolean}
|
|
127
|
-
*/
|
|
128
|
-
isIndexed(indexDefinition: Index): boolean;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* @param {!string} name
|
|
133
|
-
* @param {!Node} node
|
|
134
|
-
* @constructor
|
|
135
|
-
* @struct
|
|
136
|
-
*/
|
|
137
|
-
export declare class NamedNode {
|
|
138
|
-
name: string;
|
|
139
|
-
node: Node;
|
|
140
|
-
constructor(name: string, node: Node);
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @param {!string} name
|
|
144
|
-
* @param {!Node} node
|
|
145
|
-
* @return {NamedNode}
|
|
146
|
-
*/
|
|
147
|
-
static Wrap(name: string, node: Node): NamedNode;
|
|
148
|
-
}
|
|
@@ -1,34 +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 { SortedMap } from '../util/SortedMap';
|
|
18
|
-
import { NamedNode } from './Node';
|
|
19
|
-
/**
|
|
20
|
-
* Takes a list of child nodes and constructs a SortedSet using the given comparison
|
|
21
|
-
* function
|
|
22
|
-
*
|
|
23
|
-
* Uses the algorithm described in the paper linked here:
|
|
24
|
-
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1458
|
|
25
|
-
*
|
|
26
|
-
* @template K, V
|
|
27
|
-
* @param {Array.<!NamedNode>} childList Unsorted list of children
|
|
28
|
-
* @param {function(!NamedNode, !NamedNode):number} cmp The comparison method to be used
|
|
29
|
-
* @param {(function(NamedNode):K)=} keyFn An optional function to extract K from a node wrapper, if K's
|
|
30
|
-
* type is not NamedNode
|
|
31
|
-
* @param {(function(K, K):number)=} mapSortFn An optional override for comparator used by the generated sorted map
|
|
32
|
-
* @return {SortedMap.<K, V>}
|
|
33
|
-
*/
|
|
34
|
-
export declare const buildChildSet: <K, V>(childList: NamedNode[], cmp: (a: NamedNode, b: NamedNode) => number, keyFn?: (a: NamedNode) => K, mapSortFn?: (a: K, b: K) => number) => SortedMap<K, V>;
|
|
@@ -1,19 +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 { NamedNode } from './Node';
|
|
18
|
-
export declare function NAME_ONLY_COMPARATOR(left: NamedNode, right: NamedNode): number;
|
|
19
|
-
export declare function NAME_COMPARATOR(left: string, right: string): number;
|
|
@@ -1,69 +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, NamedNode } from '../Node';
|
|
18
|
-
import { Comparator } from '../../util/SortedMap';
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @constructor
|
|
22
|
-
*/
|
|
23
|
-
export declare abstract class Index {
|
|
24
|
-
/**
|
|
25
|
-
* @param {!NamedNode} a
|
|
26
|
-
* @param {!NamedNode} b
|
|
27
|
-
* @return {number}
|
|
28
|
-
*/
|
|
29
|
-
abstract compare(a: NamedNode, b: NamedNode): number;
|
|
30
|
-
/**
|
|
31
|
-
* @param {!Node} node
|
|
32
|
-
* @return {boolean}
|
|
33
|
-
*/
|
|
34
|
-
abstract isDefinedOn(node: Node): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* @return {function(!NamedNode, !NamedNode):number} A standalone comparison function for
|
|
37
|
-
* this index
|
|
38
|
-
*/
|
|
39
|
-
getCompare(): Comparator<NamedNode>;
|
|
40
|
-
/**
|
|
41
|
-
* Given a before and after value for a node, determine if the indexed value has changed. Even if they are different,
|
|
42
|
-
* it's possible that the changes are isolated to parts of the snapshot that are not indexed.
|
|
43
|
-
*
|
|
44
|
-
* @param {!Node} oldNode
|
|
45
|
-
* @param {!Node} newNode
|
|
46
|
-
* @return {boolean} True if the portion of the snapshot being indexed changed between oldNode and newNode
|
|
47
|
-
*/
|
|
48
|
-
indexedValueChanged(oldNode: Node, newNode: Node): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* @return {!NamedNode} a node wrapper that will sort equal to or less than
|
|
51
|
-
* any other node wrapper, using this index
|
|
52
|
-
*/
|
|
53
|
-
minPost(): NamedNode;
|
|
54
|
-
/**
|
|
55
|
-
* @return {!NamedNode} a node wrapper that will sort greater than or equal to
|
|
56
|
-
* any other node wrapper, using this index
|
|
57
|
-
*/
|
|
58
|
-
abstract maxPost(): NamedNode;
|
|
59
|
-
/**
|
|
60
|
-
* @param {*} indexValue
|
|
61
|
-
* @param {string} name
|
|
62
|
-
* @return {!NamedNode}
|
|
63
|
-
*/
|
|
64
|
-
abstract makePost(indexValue: unknown, name: string): NamedNode;
|
|
65
|
-
/**
|
|
66
|
-
* @return {!string} String representation for inclusion in a query spec
|
|
67
|
-
*/
|
|
68
|
-
abstract toString(): string;
|
|
69
|
-
}
|
|
@@ -1,54 +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 { Index } from './Index';
|
|
18
|
-
import { Node, NamedNode } from '../Node';
|
|
19
|
-
import { ChildrenNode } from '../ChildrenNode';
|
|
20
|
-
export declare class KeyIndex extends Index {
|
|
21
|
-
static get __EMPTY_NODE(): ChildrenNode;
|
|
22
|
-
static set __EMPTY_NODE(val: ChildrenNode);
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
compare(a: NamedNode, b: NamedNode): number;
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
isDefinedOn(node: Node): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
indexedValueChanged(oldNode: Node, newNode: Node): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
minPost(): any;
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
maxPost(): NamedNode;
|
|
43
|
-
/**
|
|
44
|
-
* @param {*} indexValue
|
|
45
|
-
* @param {string} name
|
|
46
|
-
* @return {!NamedNode}
|
|
47
|
-
*/
|
|
48
|
-
makePost(indexValue: string, name: string): NamedNode;
|
|
49
|
-
/**
|
|
50
|
-
* @return {!string} String representation for inclusion in a query spec
|
|
51
|
-
*/
|
|
52
|
-
toString(): string;
|
|
53
|
-
}
|
|
54
|
-
export declare const KEY_INDEX: KeyIndex;
|