@depup/firebase__database 1.1.1-depup.0

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.
Files changed (202) hide show
  1. package/README.md +31 -0
  2. package/changes.json +10 -0
  3. package/dist/index.cjs.js +14089 -0
  4. package/dist/index.cjs.js.map +1 -0
  5. package/dist/index.esm.js +14032 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/index.node.cjs.js +14109 -0
  8. package/dist/index.node.cjs.js.map +1 -0
  9. package/dist/index.standalone.js +14052 -0
  10. package/dist/index.standalone.js.map +1 -0
  11. package/dist/internal.d.ts +2991 -0
  12. package/dist/node-esm/index.node.esm.js +14048 -0
  13. package/dist/node-esm/index.node.esm.js.map +1 -0
  14. package/dist/node-esm/package.json +1 -0
  15. package/dist/node-esm/src/api/Database.d.ts +137 -0
  16. package/dist/node-esm/src/api/OnDisconnect.d.ts +110 -0
  17. package/dist/node-esm/src/api/Reference.d.ts +124 -0
  18. package/dist/node-esm/src/api/Reference_impl.d.ts +1100 -0
  19. package/dist/node-esm/src/api/ServerValue.d.ts +30 -0
  20. package/dist/node-esm/src/api/Transaction.d.ts +83 -0
  21. package/dist/node-esm/src/api/test_access.d.ts +31 -0
  22. package/dist/node-esm/src/api.d.ts +18 -0
  23. package/dist/node-esm/src/api.standalone.d.ts +30 -0
  24. package/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +32 -0
  25. package/dist/node-esm/src/core/AuthTokenProvider.d.ts +49 -0
  26. package/dist/node-esm/src/core/CompoundWrite.d.ts +81 -0
  27. package/dist/node-esm/src/core/PersistentConnection.d.ts +135 -0
  28. package/dist/node-esm/src/core/ReadonlyRestClient.d.ts +60 -0
  29. package/dist/node-esm/src/core/Repo.d.ts +144 -0
  30. package/dist/node-esm/src/core/RepoInfo.d.ts +61 -0
  31. package/dist/node-esm/src/core/ServerActions.d.ts +52 -0
  32. package/dist/node-esm/src/core/SnapshotHolder.d.ts +26 -0
  33. package/dist/node-esm/src/core/SparseSnapshotTree.d.ts +64 -0
  34. package/dist/node-esm/src/core/SyncPoint.d.ts +91 -0
  35. package/dist/node-esm/src/core/SyncTree.d.ts +166 -0
  36. package/dist/node-esm/src/core/WriteTree.d.ts +205 -0
  37. package/dist/node-esm/src/core/operation/AckUserWrite.d.ts +36 -0
  38. package/dist/node-esm/src/core/operation/ListenComplete.d.ts +26 -0
  39. package/dist/node-esm/src/core/operation/Merge.d.ts +33 -0
  40. package/dist/node-esm/src/core/operation/Operation.d.ts +45 -0
  41. package/dist/node-esm/src/core/operation/Overwrite.d.ts +28 -0
  42. package/dist/node-esm/src/core/snap/ChildrenNode.d.ts +112 -0
  43. package/dist/node-esm/src/core/snap/IndexMap.d.ts +43 -0
  44. package/dist/node-esm/src/core/snap/LeafNode.d.ts +83 -0
  45. package/dist/node-esm/src/core/snap/Node.d.ts +126 -0
  46. package/dist/node-esm/src/core/snap/childSet.d.ts +32 -0
  47. package/dist/node-esm/src/core/snap/comparators.d.ts +19 -0
  48. package/dist/node-esm/src/core/snap/indexes/Index.d.ts +50 -0
  49. package/dist/node-esm/src/core/snap/indexes/KeyIndex.d.ts +34 -0
  50. package/dist/node-esm/src/core/snap/indexes/PathIndex.d.ts +29 -0
  51. package/dist/node-esm/src/core/snap/indexes/PriorityIndex.d.ts +33 -0
  52. package/dist/node-esm/src/core/snap/indexes/ValueIndex.d.ts +31 -0
  53. package/dist/node-esm/src/core/snap/nodeFromJSON.d.ts +24 -0
  54. package/dist/node-esm/src/core/snap/snap.d.ts +23 -0
  55. package/dist/node-esm/src/core/stats/StatsCollection.d.ts +26 -0
  56. package/dist/node-esm/src/core/stats/StatsListener.d.ts +30 -0
  57. package/dist/node-esm/src/core/stats/StatsManager.d.ts +20 -0
  58. package/dist/node-esm/src/core/stats/StatsReporter.d.ts +28 -0
  59. package/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts +46 -0
  60. package/dist/node-esm/src/core/storage/MemoryStorage.d.ts +27 -0
  61. package/dist/node-esm/src/core/storage/storage.d.ts +22 -0
  62. package/dist/node-esm/src/core/util/EventEmitter.d.ts +39 -0
  63. package/dist/node-esm/src/core/util/ImmutableTree.d.ts +117 -0
  64. package/dist/node-esm/src/core/util/NextPushId.d.ts +33 -0
  65. package/dist/node-esm/src/core/util/OnlineMonitor.d.ts +31 -0
  66. package/dist/node-esm/src/core/util/Path.d.ts +94 -0
  67. package/dist/node-esm/src/core/util/ServerValues.d.ts +56 -0
  68. package/dist/node-esm/src/core/util/SortedMap.d.ts +324 -0
  69. package/dist/node-esm/src/core/util/Tree.d.ts +105 -0
  70. package/dist/node-esm/src/core/util/VisibilityMonitor.d.ts +23 -0
  71. package/dist/node-esm/src/core/util/libs/parser.d.ts +32 -0
  72. package/dist/node-esm/src/core/util/misc.d.ts +19 -0
  73. package/dist/node-esm/src/core/util/util.d.ts +176 -0
  74. package/dist/node-esm/src/core/util/validation.d.ts +70 -0
  75. package/dist/node-esm/src/core/version.d.ts +23 -0
  76. package/dist/node-esm/src/core/view/CacheNode.d.ts +41 -0
  77. package/dist/node-esm/src/core/view/Change.d.ts +46 -0
  78. package/dist/node-esm/src/core/view/ChildChangeAccumulator.d.ts +22 -0
  79. package/dist/node-esm/src/core/view/CompleteChildSource.d.ts +55 -0
  80. package/dist/node-esm/src/core/view/Event.d.ts +64 -0
  81. package/dist/node-esm/src/core/view/EventGenerator.d.ts +42 -0
  82. package/dist/node-esm/src/core/view/EventQueue.d.ts +67 -0
  83. package/dist/node-esm/src/core/view/EventRegistration.d.ts +87 -0
  84. package/dist/node-esm/src/core/view/QueryParams.d.ts +95 -0
  85. package/dist/node-esm/src/core/view/View.d.ts +59 -0
  86. package/dist/node-esm/src/core/view/ViewCache.d.ts +32 -0
  87. package/dist/node-esm/src/core/view/ViewProcessor.d.ts +32 -0
  88. package/dist/node-esm/src/core/view/filter/IndexedFilter.d.ts +35 -0
  89. package/dist/node-esm/src/core/view/filter/LimitedFilter.d.ts +47 -0
  90. package/dist/node-esm/src/core/view/filter/NodeFilter.d.ts +54 -0
  91. package/dist/node-esm/src/core/view/filter/RangedFilter.d.ts +47 -0
  92. package/dist/node-esm/src/index.d.ts +28 -0
  93. package/dist/node-esm/src/index.node.d.ts +17 -0
  94. package/dist/node-esm/src/index.standalone.d.ts +17 -0
  95. package/dist/node-esm/src/internal/index.d.ts +38 -0
  96. package/dist/node-esm/src/realtime/BrowserPollConnection.d.ts +198 -0
  97. package/dist/node-esm/src/realtime/Connection.d.ts +102 -0
  98. package/dist/node-esm/src/realtime/Constants.d.ts +27 -0
  99. package/dist/node-esm/src/realtime/Transport.d.ts +58 -0
  100. package/dist/node-esm/src/realtime/TransportManager.d.ts +50 -0
  101. package/dist/node-esm/src/realtime/WebSocketConnection.d.ts +127 -0
  102. package/dist/node-esm/src/realtime/polling/PacketReceiver.d.ts +38 -0
  103. package/dist/node-esm/src/register.d.ts +1 -0
  104. package/dist/node-esm/test/helpers/EventAccumulator.d.ts +35 -0
  105. package/dist/node-esm/test/helpers/syncpoint-util.d.ts +29 -0
  106. package/dist/node-esm/test/helpers/util.d.ts +36 -0
  107. package/dist/private.d.ts +2853 -0
  108. package/dist/public.d.ts +1405 -0
  109. package/dist/src/api/Database.d.ts +137 -0
  110. package/dist/src/api/OnDisconnect.d.ts +110 -0
  111. package/dist/src/api/Reference.d.ts +124 -0
  112. package/dist/src/api/Reference_impl.d.ts +1100 -0
  113. package/dist/src/api/ServerValue.d.ts +30 -0
  114. package/dist/src/api/Transaction.d.ts +83 -0
  115. package/dist/src/api/test_access.d.ts +31 -0
  116. package/dist/src/api.d.ts +18 -0
  117. package/dist/src/api.standalone.d.ts +30 -0
  118. package/dist/src/core/AppCheckTokenProvider.d.ts +32 -0
  119. package/dist/src/core/AuthTokenProvider.d.ts +49 -0
  120. package/dist/src/core/CompoundWrite.d.ts +81 -0
  121. package/dist/src/core/PersistentConnection.d.ts +135 -0
  122. package/dist/src/core/ReadonlyRestClient.d.ts +60 -0
  123. package/dist/src/core/Repo.d.ts +144 -0
  124. package/dist/src/core/RepoInfo.d.ts +61 -0
  125. package/dist/src/core/ServerActions.d.ts +52 -0
  126. package/dist/src/core/SnapshotHolder.d.ts +26 -0
  127. package/dist/src/core/SparseSnapshotTree.d.ts +64 -0
  128. package/dist/src/core/SyncPoint.d.ts +91 -0
  129. package/dist/src/core/SyncTree.d.ts +166 -0
  130. package/dist/src/core/WriteTree.d.ts +205 -0
  131. package/dist/src/core/operation/AckUserWrite.d.ts +36 -0
  132. package/dist/src/core/operation/ListenComplete.d.ts +26 -0
  133. package/dist/src/core/operation/Merge.d.ts +33 -0
  134. package/dist/src/core/operation/Operation.d.ts +45 -0
  135. package/dist/src/core/operation/Overwrite.d.ts +28 -0
  136. package/dist/src/core/snap/ChildrenNode.d.ts +112 -0
  137. package/dist/src/core/snap/IndexMap.d.ts +43 -0
  138. package/dist/src/core/snap/LeafNode.d.ts +83 -0
  139. package/dist/src/core/snap/Node.d.ts +126 -0
  140. package/dist/src/core/snap/childSet.d.ts +32 -0
  141. package/dist/src/core/snap/comparators.d.ts +19 -0
  142. package/dist/src/core/snap/indexes/Index.d.ts +50 -0
  143. package/dist/src/core/snap/indexes/KeyIndex.d.ts +34 -0
  144. package/dist/src/core/snap/indexes/PathIndex.d.ts +29 -0
  145. package/dist/src/core/snap/indexes/PriorityIndex.d.ts +33 -0
  146. package/dist/src/core/snap/indexes/ValueIndex.d.ts +31 -0
  147. package/dist/src/core/snap/nodeFromJSON.d.ts +24 -0
  148. package/dist/src/core/snap/snap.d.ts +23 -0
  149. package/dist/src/core/stats/StatsCollection.d.ts +26 -0
  150. package/dist/src/core/stats/StatsListener.d.ts +30 -0
  151. package/dist/src/core/stats/StatsManager.d.ts +20 -0
  152. package/dist/src/core/stats/StatsReporter.d.ts +28 -0
  153. package/dist/src/core/storage/DOMStorageWrapper.d.ts +46 -0
  154. package/dist/src/core/storage/MemoryStorage.d.ts +27 -0
  155. package/dist/src/core/storage/storage.d.ts +22 -0
  156. package/dist/src/core/util/EventEmitter.d.ts +39 -0
  157. package/dist/src/core/util/ImmutableTree.d.ts +117 -0
  158. package/dist/src/core/util/NextPushId.d.ts +33 -0
  159. package/dist/src/core/util/OnlineMonitor.d.ts +31 -0
  160. package/dist/src/core/util/Path.d.ts +94 -0
  161. package/dist/src/core/util/ServerValues.d.ts +56 -0
  162. package/dist/src/core/util/SortedMap.d.ts +324 -0
  163. package/dist/src/core/util/Tree.d.ts +105 -0
  164. package/dist/src/core/util/VisibilityMonitor.d.ts +23 -0
  165. package/dist/src/core/util/libs/parser.d.ts +32 -0
  166. package/dist/src/core/util/misc.d.ts +19 -0
  167. package/dist/src/core/util/util.d.ts +176 -0
  168. package/dist/src/core/util/validation.d.ts +70 -0
  169. package/dist/src/core/version.d.ts +23 -0
  170. package/dist/src/core/view/CacheNode.d.ts +41 -0
  171. package/dist/src/core/view/Change.d.ts +46 -0
  172. package/dist/src/core/view/ChildChangeAccumulator.d.ts +22 -0
  173. package/dist/src/core/view/CompleteChildSource.d.ts +55 -0
  174. package/dist/src/core/view/Event.d.ts +64 -0
  175. package/dist/src/core/view/EventGenerator.d.ts +42 -0
  176. package/dist/src/core/view/EventQueue.d.ts +67 -0
  177. package/dist/src/core/view/EventRegistration.d.ts +87 -0
  178. package/dist/src/core/view/QueryParams.d.ts +95 -0
  179. package/dist/src/core/view/View.d.ts +59 -0
  180. package/dist/src/core/view/ViewCache.d.ts +32 -0
  181. package/dist/src/core/view/ViewProcessor.d.ts +32 -0
  182. package/dist/src/core/view/filter/IndexedFilter.d.ts +35 -0
  183. package/dist/src/core/view/filter/LimitedFilter.d.ts +47 -0
  184. package/dist/src/core/view/filter/NodeFilter.d.ts +54 -0
  185. package/dist/src/core/view/filter/RangedFilter.d.ts +47 -0
  186. package/dist/src/index.d.ts +28 -0
  187. package/dist/src/index.node.d.ts +17 -0
  188. package/dist/src/index.standalone.d.ts +17 -0
  189. package/dist/src/internal/index.d.ts +38 -0
  190. package/dist/src/realtime/BrowserPollConnection.d.ts +198 -0
  191. package/dist/src/realtime/Connection.d.ts +102 -0
  192. package/dist/src/realtime/Constants.d.ts +27 -0
  193. package/dist/src/realtime/Transport.d.ts +58 -0
  194. package/dist/src/realtime/TransportManager.d.ts +50 -0
  195. package/dist/src/realtime/WebSocketConnection.d.ts +127 -0
  196. package/dist/src/realtime/polling/PacketReceiver.d.ts +38 -0
  197. package/dist/src/register.d.ts +1 -0
  198. package/dist/src/tsdoc-metadata.json +11 -0
  199. package/dist/test/helpers/EventAccumulator.d.ts +35 -0
  200. package/dist/test/helpers/syncpoint-util.d.ts +29 -0
  201. package/dist/test/helpers/util.d.ts +36 -0
  202. package/package.json +104 -0
@@ -0,0 +1,126 @@
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
+ * @returns Whether this is a leaf node.
29
+ */
30
+ isLeafNode(): boolean;
31
+ /**
32
+ * Gets the priority of the node.
33
+ * @returns The priority of the node.
34
+ */
35
+ getPriority(): Node;
36
+ /**
37
+ * Returns a duplicate node with the new priority.
38
+ * @param newPriorityNode - New priority to set for the node.
39
+ * @returns 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 childName - The name of the child to retrieve.
45
+ * @returns 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 - The path of the child to retrieve.
51
+ * @returns 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 childName - The name of the child to find the predecessor of.
57
+ * @param childNode - The node to find the predecessor of.
58
+ * @param index - The index to use to determine the predecessor
59
+ * @returns 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 childName - The name of the child to update.
66
+ * @param newChildNode - The new child node
67
+ * @returns 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 - The path of the child to update.
74
+ * @param newChildNode - The new child node, which may be an empty node
75
+ * @returns The updated node.
76
+ */
77
+ updateChild(path: Path, newChildNode: Node): Node;
78
+ /**
79
+ * True if the immediate child specified exists
80
+ */
81
+ hasChild(childName: string): boolean;
82
+ /**
83
+ * @returns True if this node has no value or children.
84
+ */
85
+ isEmpty(): boolean;
86
+ /**
87
+ * @returns The number of children of this node.
88
+ */
89
+ numChildren(): number;
90
+ /**
91
+ * Calls action for each child.
92
+ * @param action - Action to be called for
93
+ * each child. It's passed the child name and the child node.
94
+ * @returns The first truthy value return by action, or the last falsey one
95
+ */
96
+ forEachChild(index: Index, action: (a: string, b: Node) => void): unknown;
97
+ /**
98
+ * @param exportFormat - True for export format (also wire protocol format).
99
+ * @returns Value of this node as JSON.
100
+ */
101
+ val(exportFormat?: boolean): unknown;
102
+ /**
103
+ * @returns hash representing the node contents.
104
+ */
105
+ hash(): string;
106
+ /**
107
+ * @param other - Another node
108
+ * @returns -1 for less than, 0 for equal, 1 for greater than other
109
+ */
110
+ compareTo(other: Node): number;
111
+ /**
112
+ * @returns Whether or not this snapshot equals other
113
+ */
114
+ equals(other: Node): boolean;
115
+ /**
116
+ * @returns This node, with the specified index now available
117
+ */
118
+ withIndex(indexDefinition: Index): Node;
119
+ isIndexed(indexDefinition: Index): boolean;
120
+ }
121
+ export declare class NamedNode {
122
+ name: string;
123
+ node: Node;
124
+ constructor(name: string, node: Node);
125
+ static Wrap(name: string, node: Node): NamedNode;
126
+ }
@@ -0,0 +1,32 @@
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
+ * @param childList - Unsorted list of children
27
+ * @param cmp - The comparison method to be used
28
+ * @param keyFn - An optional function to extract K from a node wrapper, if K's
29
+ * type is not NamedNode
30
+ * @param mapSortFn - An optional override for comparator used by the generated sorted map
31
+ */
32
+ 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>;
@@ -0,0 +1,19 @@
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;
@@ -0,0 +1,50 @@
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 { Comparator } from '../../util/SortedMap';
18
+ import { Node, NamedNode } from '../Node';
19
+ export declare abstract class Index {
20
+ abstract compare(a: NamedNode, b: NamedNode): number;
21
+ abstract isDefinedOn(node: Node): boolean;
22
+ /**
23
+ * @returns A standalone comparison function for
24
+ * this index
25
+ */
26
+ getCompare(): Comparator<NamedNode>;
27
+ /**
28
+ * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different,
29
+ * it's possible that the changes are isolated to parts of the snapshot that are not indexed.
30
+ *
31
+ *
32
+ * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode
33
+ */
34
+ indexedValueChanged(oldNode: Node, newNode: Node): boolean;
35
+ /**
36
+ * @returns a node wrapper that will sort equal to or less than
37
+ * any other node wrapper, using this index
38
+ */
39
+ minPost(): NamedNode;
40
+ /**
41
+ * @returns a node wrapper that will sort greater than or equal to
42
+ * any other node wrapper, using this index
43
+ */
44
+ abstract maxPost(): NamedNode;
45
+ abstract makePost(indexValue: unknown, name: string): NamedNode;
46
+ /**
47
+ * @returns String representation for inclusion in a query spec
48
+ */
49
+ abstract toString(): string;
50
+ }
@@ -0,0 +1,34 @@
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 { ChildrenNode } from '../ChildrenNode';
18
+ import { Node, NamedNode } from '../Node';
19
+ import { Index } from './Index';
20
+ export declare class KeyIndex extends Index {
21
+ static get __EMPTY_NODE(): ChildrenNode;
22
+ static set __EMPTY_NODE(val: ChildrenNode);
23
+ compare(a: NamedNode, b: NamedNode): number;
24
+ isDefinedOn(node: Node): boolean;
25
+ indexedValueChanged(oldNode: Node, newNode: Node): boolean;
26
+ minPost(): any;
27
+ maxPost(): NamedNode;
28
+ makePost(indexValue: string, name: string): NamedNode;
29
+ /**
30
+ * @returns String representation for inclusion in a query spec
31
+ */
32
+ toString(): string;
33
+ }
34
+ export declare const KEY_INDEX: KeyIndex;
@@ -0,0 +1,29 @@
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 { NamedNode, Node } from '../Node';
19
+ import { Index } from './Index';
20
+ export declare class PathIndex extends Index {
21
+ private indexPath_;
22
+ constructor(indexPath_: Path);
23
+ protected extractChild(snap: Node): Node;
24
+ isDefinedOn(node: Node): boolean;
25
+ compare(a: NamedNode, b: NamedNode): number;
26
+ makePost(indexValue: object, name: string): NamedNode;
27
+ maxPost(): NamedNode;
28
+ toString(): string;
29
+ }
@@ -0,0 +1,33 @@
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 { Index } from './Index';
19
+ export declare function setNodeFromJSON(val: (a: unknown) => Node): void;
20
+ export declare function setMaxNode(val: Node): void;
21
+ export declare class PriorityIndex extends Index {
22
+ compare(a: NamedNode, b: NamedNode): number;
23
+ isDefinedOn(node: Node): boolean;
24
+ indexedValueChanged(oldNode: Node, newNode: Node): boolean;
25
+ minPost(): NamedNode;
26
+ maxPost(): NamedNode;
27
+ makePost(indexValue: unknown, name: string): NamedNode;
28
+ /**
29
+ * @returns String representation for inclusion in a query spec
30
+ */
31
+ toString(): string;
32
+ }
33
+ export declare const PRIORITY_INDEX: PriorityIndex;
@@ -0,0 +1,31 @@
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 { Index } from './Index';
19
+ export declare class ValueIndex extends Index {
20
+ compare(a: NamedNode, b: NamedNode): number;
21
+ isDefinedOn(node: Node): boolean;
22
+ indexedValueChanged(oldNode: Node, newNode: Node): boolean;
23
+ minPost(): NamedNode;
24
+ maxPost(): NamedNode;
25
+ makePost(indexValue: object, name: string): NamedNode;
26
+ /**
27
+ * @returns String representation for inclusion in a query spec
28
+ */
29
+ toString(): string;
30
+ }
31
+ export declare const VALUE_INDEX: ValueIndex;
@@ -0,0 +1,24 @@
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
+ /**
19
+ * Constructs a snapshot node representing the passed JSON and returns it.
20
+ * @param json - JSON to create a node for.
21
+ * @param priority - Optional priority to use. This will be ignored if the
22
+ * passed JSON contains a .priority property.
23
+ */
24
+ export declare function nodeFromJSON(json: unknown | null, priority?: unknown): Node;
@@ -0,0 +1,23 @@
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
+ export declare function setMaxNode(val: Node): void;
19
+ export declare const priorityHashText: (priority: string | number) => string;
20
+ /**
21
+ * Validates that a priority snapshot Node is valid.
22
+ */
23
+ export declare const validatePriorityNode: (priorityNode: Node) => void;
@@ -0,0 +1,26 @@
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
+ /**
18
+ * Tracks a collection of stats.
19
+ */
20
+ export declare class StatsCollection {
21
+ private counters_;
22
+ incrementCounter(name: string, amount?: number): void;
23
+ get(): {
24
+ [k: string]: number;
25
+ };
26
+ }
@@ -0,0 +1,30 @@
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 { StatsCollection } from './StatsCollection';
18
+ /**
19
+ * Returns the delta from the previous call to get stats.
20
+ *
21
+ * @param collection_ - The collection to "listen" to.
22
+ */
23
+ export declare class StatsListener {
24
+ private collection_;
25
+ private last_;
26
+ constructor(collection_: StatsCollection);
27
+ get(): {
28
+ [k: string]: number;
29
+ };
30
+ }
@@ -0,0 +1,20 @@
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 { RepoInfo } from '../RepoInfo';
18
+ import { StatsCollection } from './StatsCollection';
19
+ export declare function statsManagerGetCollection(repoInfo: RepoInfo): StatsCollection;
20
+ export declare function statsManagerGetOrCreateReporter<T>(repoInfo: RepoInfo, creatorFunction: () => T): T;
@@ -0,0 +1,28 @@
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 { ServerActions } from '../ServerActions';
18
+ import { StatsCollection } from './StatsCollection';
19
+ export declare class StatsReporter {
20
+ private server_;
21
+ private statsListener_;
22
+ statsToReport_: {
23
+ [k: string]: boolean;
24
+ };
25
+ constructor(collection: StatsCollection, server_: ServerActions);
26
+ private reportStats_;
27
+ }
28
+ export declare function statsReporterIncludeStat(reporter: StatsReporter, stat: string): void;
@@ -0,0 +1,46 @@
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
+ /**
18
+ * Wraps a DOM Storage object and:
19
+ * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types.
20
+ * - prefixes names with "firebase:" to avoid collisions with app data.
21
+ *
22
+ * We automatically (see storage.js) create two such wrappers, one for sessionStorage,
23
+ * and one for localStorage.
24
+ *
25
+ */
26
+ export declare class DOMStorageWrapper {
27
+ private domStorage_;
28
+ private prefix_;
29
+ /**
30
+ * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage)
31
+ */
32
+ constructor(domStorage_: Storage);
33
+ /**
34
+ * @param key - The key to save the value under
35
+ * @param value - The value being stored, or null to remove the key.
36
+ */
37
+ set(key: string, value: unknown | null): void;
38
+ /**
39
+ * @returns The value that was stored under this key, or null
40
+ */
41
+ get(key: string): unknown;
42
+ remove(key: string): void;
43
+ isInMemoryStorage: boolean;
44
+ prefixedName_(name: string): string;
45
+ toString(): string;
46
+ }
@@ -0,0 +1,27 @@
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
+ /**
18
+ * An in-memory storage implementation that matches the API of DOMStorageWrapper
19
+ * (TODO: create interface for both to implement).
20
+ */
21
+ export declare class MemoryStorage {
22
+ private cache_;
23
+ set(key: string, value: unknown | null): void;
24
+ get(key: string): unknown;
25
+ remove(key: string): void;
26
+ isInMemoryStorage: boolean;
27
+ }
@@ -0,0 +1,22 @@
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 { DOMStorageWrapper } from './DOMStorageWrapper';
18
+ import { MemoryStorage } from './MemoryStorage';
19
+ /** A storage object that lasts across sessions */
20
+ export declare const PersistentStorage: DOMStorageWrapper | MemoryStorage;
21
+ /** A storage object that only lasts one session */
22
+ export declare const SessionStorage: DOMStorageWrapper | MemoryStorage;
@@ -0,0 +1,39 @@
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
+ /**
18
+ * Base class to be used if you want to emit events. Call the constructor with
19
+ * the set of allowed event names.
20
+ */
21
+ export declare abstract class EventEmitter {
22
+ private allowedEvents_;
23
+ private listeners_;
24
+ constructor(allowedEvents_: string[]);
25
+ /**
26
+ * To be overridden by derived classes in order to fire an initial event when
27
+ * somebody subscribes for data.
28
+ *
29
+ * @returns {Array.<*>} Array of parameters to trigger initial event with.
30
+ */
31
+ abstract getInitialEvent(eventType: string): unknown[];
32
+ /**
33
+ * To be called by derived classes to trigger events.
34
+ */
35
+ protected trigger(eventType: string, ...varArgs: unknown[]): void;
36
+ on(eventType: string, callback: (a: unknown) => void, context: unknown): void;
37
+ off(eventType: string, callback: (a: unknown) => void, context: unknown): void;
38
+ private validateEventType_;
39
+ }