@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.
Files changed (134) hide show
  1. package/dist/index.d.ts +0 -16
  2. package/dist/index.esm.js +34 -163
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.esm2017.js +34 -161
  5. package/dist/index.esm2017.js.map +1 -1
  6. package/dist/index.node.cjs.js +34 -163
  7. package/dist/index.node.cjs.js.map +1 -1
  8. package/dist/src/api/Query.d.ts +0 -2
  9. package/dist/src/core/AuthTokenProvider.d.ts +2 -2
  10. package/dist/src/core/Repo.d.ts +21 -10
  11. package/dist/src/core/RepoManager.d.ts +2 -8
  12. package/dist/src/core/util/NextPushId.d.ts +0 -2
  13. package/dist/src/core/util/util.d.ts +0 -8
  14. package/dist/src/core/view/QueryParams.d.ts +0 -6
  15. package/package.json +13 -16
  16. package/dist/exp/exp/index.d.ts +0 -29
  17. package/dist/exp/index.d.ts +0 -49
  18. package/dist/exp/index.esm.js +0 -15735
  19. package/dist/exp/index.esm.js.map +0 -1
  20. package/dist/exp/index.esm2017.js +0 -15139
  21. package/dist/exp/index.esm2017.js.map +0 -1
  22. package/dist/exp/index.node.cjs.js +0 -15746
  23. package/dist/exp/index.node.cjs.js.map +0 -1
  24. package/dist/exp/index.node.d.ts +0 -83
  25. package/dist/exp/src/api/DataSnapshot.d.ts +0 -99
  26. package/dist/exp/src/api/Database.d.ts +0 -87
  27. package/dist/exp/src/api/Query.d.ts +0 -193
  28. package/dist/exp/src/api/Reference.d.ts +0 -106
  29. package/dist/exp/src/api/TransactionResult.d.ts +0 -30
  30. package/dist/exp/src/api/internal.d.ts +0 -55
  31. package/dist/exp/src/api/onDisconnect.d.ts +0 -60
  32. package/dist/exp/src/api/test_access.d.ts +0 -42
  33. package/dist/exp/src/core/AuthTokenProvider.d.ts +0 -50
  34. package/dist/exp/src/core/CompoundWrite.d.ts +0 -77
  35. package/dist/exp/src/core/PersistentConnection.d.ts +0 -148
  36. package/dist/exp/src/core/ReadonlyRestClient.d.ts +0 -73
  37. package/dist/exp/src/core/Repo.d.ts +0 -121
  38. package/dist/exp/src/core/RepoInfo.d.ts +0 -59
  39. package/dist/exp/src/core/RepoManager.d.ts +0 -78
  40. package/dist/exp/src/core/Repo_transaction.d.ts +0 -33
  41. package/dist/exp/src/core/ServerActions.d.ts +0 -85
  42. package/dist/exp/src/core/SnapshotHolder.d.ts +0 -28
  43. package/dist/exp/src/core/SparseSnapshotTree.d.ts +0 -61
  44. package/dist/exp/src/core/SyncPoint.d.ts +0 -84
  45. package/dist/exp/src/core/SyncTree.d.ts +0 -236
  46. package/dist/exp/src/core/WriteTree.d.ts +0 -295
  47. package/dist/exp/src/core/operation/AckUserWrite.d.ts +0 -42
  48. package/dist/exp/src/core/operation/ListenComplete.d.ts +0 -32
  49. package/dist/exp/src/core/operation/Merge.d.ts +0 -46
  50. package/dist/exp/src/core/operation/Operation.d.ts +0 -78
  51. package/dist/exp/src/core/operation/Overwrite.d.ts +0 -35
  52. package/dist/exp/src/core/snap/ChildrenNode.d.ts +0 -180
  53. package/dist/exp/src/core/snap/IndexMap.d.ts +0 -43
  54. package/dist/exp/src/core/snap/LeafNode.d.ts +0 -107
  55. package/dist/exp/src/core/snap/Node.d.ts +0 -148
  56. package/dist/exp/src/core/snap/childSet.d.ts +0 -34
  57. package/dist/exp/src/core/snap/comparators.d.ts +0 -19
  58. package/dist/exp/src/core/snap/indexes/Index.d.ts +0 -69
  59. package/dist/exp/src/core/snap/indexes/KeyIndex.d.ts +0 -54
  60. package/dist/exp/src/core/snap/indexes/PathIndex.d.ts +0 -54
  61. package/dist/exp/src/core/snap/indexes/PriorityIndex.d.ts +0 -58
  62. package/dist/exp/src/core/snap/indexes/ValueIndex.d.ts +0 -56
  63. package/dist/exp/src/core/snap/nodeFromJSON.d.ts +0 -25
  64. package/dist/exp/src/core/snap/snap.d.ts +0 -29
  65. package/dist/exp/src/core/stats/StatsCollection.d.ts +0 -28
  66. package/dist/exp/src/core/stats/StatsListener.d.ts +0 -31
  67. package/dist/exp/src/core/stats/StatsManager.d.ts +0 -24
  68. package/dist/exp/src/core/stats/StatsReporter.d.ts +0 -33
  69. package/dist/exp/src/core/storage/DOMStorageWrapper.d.ts +0 -55
  70. package/dist/exp/src/core/storage/MemoryStorage.d.ts +0 -29
  71. package/dist/exp/src/core/storage/storage.d.ts +0 -22
  72. package/dist/exp/src/core/util/EventEmitter.d.ts +0 -45
  73. package/dist/exp/src/core/util/ImmutableTree.d.ts +0 -157
  74. package/dist/exp/src/core/util/NextPushId.d.ts +0 -33
  75. package/dist/exp/src/core/util/OnlineMonitor.d.ts +0 -40
  76. package/dist/exp/src/core/util/Path.d.ts +0 -132
  77. package/dist/exp/src/core/util/ServerValues.d.ts +0 -66
  78. package/dist/exp/src/core/util/SortedMap.d.ts +0 -362
  79. package/dist/exp/src/core/util/Tree.d.ts +0 -134
  80. package/dist/exp/src/core/util/VisibilityMonitor.d.ts +0 -30
  81. package/dist/exp/src/core/util/libs/parser.d.ts +0 -37
  82. package/dist/exp/src/core/util/misc.d.ts +0 -19
  83. package/dist/exp/src/core/util/util.d.ts +0 -232
  84. package/dist/exp/src/core/util/validation.d.ts +0 -108
  85. package/dist/exp/src/core/version.d.ts +0 -19
  86. package/dist/exp/src/core/view/CacheNode.d.ts +0 -59
  87. package/dist/exp/src/core/view/Change.d.ts +0 -74
  88. package/dist/exp/src/core/view/ChildChangeAccumulator.d.ts +0 -22
  89. package/dist/exp/src/core/view/CompleteChildSource.d.ts +0 -91
  90. package/dist/exp/src/core/view/Event.d.ts +0 -102
  91. package/dist/exp/src/core/view/EventGenerator.d.ts +0 -77
  92. package/dist/exp/src/core/view/EventQueue.d.ts +0 -99
  93. package/dist/exp/src/core/view/EventRegistration.d.ts +0 -154
  94. package/dist/exp/src/core/view/QueryParams.d.ts +0 -176
  95. package/dist/exp/src/core/view/View.d.ts +0 -97
  96. package/dist/exp/src/core/view/ViewCache.d.ts +0 -70
  97. package/dist/exp/src/core/view/ViewProcessor.d.ts +0 -166
  98. package/dist/exp/src/core/view/filter/IndexedFilter.d.ts +0 -54
  99. package/dist/exp/src/core/view/filter/LimitedFilter.d.ts +0 -94
  100. package/dist/exp/src/core/view/filter/NodeFilter.d.ts +0 -75
  101. package/dist/exp/src/core/view/filter/RangedFilter.d.ts +0 -109
  102. package/dist/exp/src/exp/Database.d.ts +0 -95
  103. package/dist/exp/src/realtime/BrowserPollConnection.d.ts +0 -208
  104. package/dist/exp/src/realtime/Connection.d.ts +0 -119
  105. package/dist/exp/src/realtime/Constants.d.ts +0 -26
  106. package/dist/exp/src/realtime/Transport.d.ts +0 -62
  107. package/dist/exp/src/realtime/TransportManager.d.ts +0 -55
  108. package/dist/exp/src/realtime/WebSocketConnection.d.ts +0 -133
  109. package/dist/exp/src/realtime/polling/PacketReceiver.d.ts +0 -41
  110. package/dist/exp/test/browser/crawler_support.test.d.ts +0 -17
  111. package/dist/exp/test/compound_write.test.d.ts +0 -17
  112. package/dist/exp/test/connection.test.d.ts +0 -17
  113. package/dist/exp/test/database.test.d.ts +0 -17
  114. package/dist/exp/test/datasnapshot.test.d.ts +0 -17
  115. package/dist/exp/test/exp/integration.test.d.ts +0 -17
  116. package/dist/exp/test/helpers/EventAccumulator.d.ts +0 -34
  117. package/dist/exp/test/helpers/events.d.ts +0 -37
  118. package/dist/exp/test/helpers/util.d.ts +0 -50
  119. package/dist/exp/test/info.test.d.ts +0 -17
  120. package/dist/exp/test/node.test.d.ts +0 -17
  121. package/dist/exp/test/order.test.d.ts +0 -17
  122. package/dist/exp/test/order_by.test.d.ts +0 -17
  123. package/dist/exp/test/path.test.d.ts +0 -17
  124. package/dist/exp/test/promise.test.d.ts +0 -17
  125. package/dist/exp/test/pushid.test.d.ts +0 -17
  126. package/dist/exp/test/query.test.d.ts +0 -17
  127. package/dist/exp/test/repoinfo.test.d.ts +0 -17
  128. package/dist/exp/test/servervalues.test.d.ts +0 -17
  129. package/dist/exp/test/sortedmap.test.d.ts +0 -17
  130. package/dist/exp/test/sparsesnapshottree.test.d.ts +0 -17
  131. package/dist/exp/test/transaction.test.d.ts +0 -17
  132. package/dist/src/exp/Database.d.ts +0 -95
  133. package/dist/test/exp/integration.test.d.ts +0 -17
  134. package/dist/test/pushid.test.d.ts +0 -17
@@ -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 { NamedNode, Node } from '../Node';
19
- import { Path } from '../../util/Path';
20
- /**
21
- * @param {!Path} indexPath
22
- * @constructor
23
- * @extends {Index}
24
- */
25
- export declare class PathIndex extends Index {
26
- private indexPath_;
27
- constructor(indexPath_: Path);
28
- /**
29
- * @param {!Node} snap
30
- * @return {!Node}
31
- * @protected
32
- */
33
- protected extractChild(snap: Node): Node;
34
- /**
35
- * @inheritDoc
36
- */
37
- isDefinedOn(node: Node): boolean;
38
- /**
39
- * @inheritDoc
40
- */
41
- compare(a: NamedNode, b: NamedNode): number;
42
- /**
43
- * @inheritDoc
44
- */
45
- makePost(indexValue: object, name: string): NamedNode;
46
- /**
47
- * @inheritDoc
48
- */
49
- maxPost(): NamedNode;
50
- /**
51
- * @inheritDoc
52
- */
53
- toString(): string;
54
- }
@@ -1,58 +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 { NamedNode, Node } from '../Node';
19
- export declare function setNodeFromJSON(val: (a: unknown) => Node): void;
20
- export declare function setMaxNode(val: Node): void;
21
- /**
22
- * @constructor
23
- * @extends {Index}
24
- * @private
25
- */
26
- export declare class PriorityIndex extends Index {
27
- /**
28
- * @inheritDoc
29
- */
30
- compare(a: NamedNode, b: NamedNode): number;
31
- /**
32
- * @inheritDoc
33
- */
34
- isDefinedOn(node: Node): boolean;
35
- /**
36
- * @inheritDoc
37
- */
38
- indexedValueChanged(oldNode: Node, newNode: Node): boolean;
39
- /**
40
- * @inheritDoc
41
- */
42
- minPost(): NamedNode;
43
- /**
44
- * @inheritDoc
45
- */
46
- maxPost(): NamedNode;
47
- /**
48
- * @param {*} indexValue
49
- * @param {string} name
50
- * @return {!NamedNode}
51
- */
52
- makePost(indexValue: unknown, name: string): NamedNode;
53
- /**
54
- * @return {!string} String representation for inclusion in a query spec
55
- */
56
- toString(): string;
57
- }
58
- export declare const PRIORITY_INDEX: PriorityIndex;
@@ -1,56 +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 { NamedNode, Node } from '../Node';
19
- /**
20
- * @constructor
21
- * @extends {Index}
22
- * @private
23
- */
24
- export declare class ValueIndex extends Index {
25
- /**
26
- * @inheritDoc
27
- */
28
- compare(a: NamedNode, b: NamedNode): number;
29
- /**
30
- * @inheritDoc
31
- */
32
- isDefinedOn(node: Node): boolean;
33
- /**
34
- * @inheritDoc
35
- */
36
- indexedValueChanged(oldNode: Node, newNode: Node): boolean;
37
- /**
38
- * @inheritDoc
39
- */
40
- minPost(): NamedNode;
41
- /**
42
- * @inheritDoc
43
- */
44
- maxPost(): NamedNode;
45
- /**
46
- * @param {*} indexValue
47
- * @param {string} name
48
- * @return {!NamedNode}
49
- */
50
- makePost(indexValue: object, name: string): NamedNode;
51
- /**
52
- * @return {!string} String representation for inclusion in a query spec
53
- */
54
- toString(): string;
55
- }
56
- export declare const VALUE_INDEX: ValueIndex;
@@ -1,25 +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
- /**
19
- * Constructs a snapshot node representing the passed JSON and returns it.
20
- * @param {*} json JSON to create a node for.
21
- * @param {?string|?number=} priority Optional priority to use. This will be ignored if the
22
- * passed JSON contains a .priority property.
23
- * @return {!Node}
24
- */
25
- export declare function nodeFromJSON(json: unknown | null, priority?: unknown): Node;
@@ -1,29 +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
- export declare function setMaxNode(val: Node): void;
19
- /**
20
- * @param {(!string|!number)} priority
21
- * @return {!string}
22
- */
23
- export declare const priorityHashText: (priority: string | number) => string;
24
- /**
25
- * Validates that a priority snapshot Node is valid.
26
- *
27
- * @param {!Node} priorityNode
28
- */
29
- export declare const validatePriorityNode: (priorityNode: Node) => void;
@@ -1,28 +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
- /**
18
- * Tracks a collection of stats.
19
- *
20
- * @constructor
21
- */
22
- export declare class StatsCollection {
23
- private counters_;
24
- incrementCounter(name: string, amount?: number): void;
25
- get(): {
26
- [k: string]: number;
27
- };
28
- }
@@ -1,31 +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 { 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
- * @constructor
23
- */
24
- export declare class StatsListener {
25
- private collection_;
26
- private last_;
27
- constructor(collection_: StatsCollection);
28
- get(): {
29
- [k: string]: number;
30
- };
31
- }
@@ -1,24 +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 { StatsCollection } from './StatsCollection';
18
- import { RepoInfo } from '../RepoInfo';
19
- export declare class StatsManager {
20
- private static collections_;
21
- private static reporters_;
22
- static getCollection(repoInfo: RepoInfo): StatsCollection;
23
- static getOrCreateReporter<T>(repoInfo: RepoInfo, creatorFunction: () => T): T;
24
- }
@@ -1,33 +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 { StatsCollection } from './StatsCollection';
18
- import { ServerActions } from '../ServerActions';
19
- /**
20
- * @constructor
21
- */
22
- export declare class StatsReporter {
23
- private server_;
24
- private statsListener_;
25
- private statsToReport_;
26
- /**
27
- * @param collection
28
- * @param server_
29
- */
30
- constructor(collection: StatsCollection, server_: ServerActions);
31
- includeStat(stat: string): void;
32
- private reportStats_;
33
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
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
- * @constructor
26
- */
27
- export declare class DOMStorageWrapper {
28
- private domStorage_;
29
- private prefix_;
30
- /**
31
- * @param {Storage} domStorage_ The underlying storage object (e.g. localStorage or sessionStorage)
32
- */
33
- constructor(domStorage_: Storage);
34
- /**
35
- * @param {string} key The key to save the value under
36
- * @param {?Object} value The value being stored, or null to remove the key.
37
- */
38
- set(key: string, value: unknown | null): void;
39
- /**
40
- * @param {string} key
41
- * @return {*} The value that was stored under this key, or null
42
- */
43
- get(key: string): unknown;
44
- /**
45
- * @param {string} key
46
- */
47
- remove(key: string): void;
48
- isInMemoryStorage: boolean;
49
- /**
50
- * @param {string} name
51
- * @return {string}
52
- */
53
- prefixedName_(name: string): string;
54
- toString(): string;
55
- }
@@ -1,29 +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
- /**
18
- * An in-memory storage implementation that matches the API of DOMStorageWrapper
19
- * (TODO: create interface for both to implement).
20
- *
21
- * @constructor
22
- */
23
- export declare class MemoryStorage {
24
- private cache_;
25
- set(key: string, value: unknown | null): void;
26
- get(key: string): unknown;
27
- remove(key: string): void;
28
- isInMemoryStorage: boolean;
29
- }
@@ -1,22 +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 { 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;
@@ -1,45 +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
- /**
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
- /**
25
- * @param {!Array.<string>} allowedEvents_
26
- */
27
- constructor(allowedEvents_: string[]);
28
- /**
29
- * To be overridden by derived classes in order to fire an initial event when
30
- * somebody subscribes for data.
31
- *
32
- * @param {!string} eventType
33
- * @return {Array.<*>} Array of parameters to trigger initial event with.
34
- */
35
- abstract getInitialEvent(eventType: string): unknown[];
36
- /**
37
- * To be called by derived classes to trigger events.
38
- * @param {!string} eventType
39
- * @param {...*} varArgs
40
- */
41
- protected trigger(eventType: string, ...varArgs: unknown[]): void;
42
- on(eventType: string, callback: (a: unknown) => void, context: unknown): void;
43
- off(eventType: string, callback: (a: unknown) => void, context: unknown): void;
44
- private validateEventType_;
45
- }
@@ -1,157 +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 './SortedMap';
18
- import { Path } from './Path';
19
- /**
20
- * A tree with immutable elements.
21
- */
22
- export declare class ImmutableTree<T> {
23
- readonly value: T | null;
24
- readonly children: SortedMap<string, ImmutableTree<T>>;
25
- static Empty: ImmutableTree<any>;
26
- /**
27
- * @template T
28
- * @param {!Object.<string, !T>} obj
29
- * @return {!ImmutableTree.<!T>}
30
- */
31
- static fromObject<T>(obj: {
32
- [k: string]: T;
33
- }): ImmutableTree<T>;
34
- /**
35
- * @template T
36
- * @param {?T} value
37
- * @param {SortedMap.<string, !ImmutableTree.<T>>=} children
38
- */
39
- constructor(value: T | null, children?: SortedMap<string, ImmutableTree<T>>);
40
- /**
41
- * True if the value is empty and there are no children
42
- * @return {boolean}
43
- */
44
- isEmpty(): boolean;
45
- /**
46
- * Given a path and predicate, return the first node and the path to that node
47
- * where the predicate returns true.
48
- *
49
- * TODO Do a perf test -- If we're creating a bunch of {path: value:} objects
50
- * on the way back out, it may be better to pass down a pathSoFar obj.
51
- *
52
- * @param {!Path} relativePath The remainder of the path
53
- * @param {function(T):boolean} predicate The predicate to satisfy to return a
54
- * node
55
- * @return {?{path:!Path, value:!T}}
56
- */
57
- findRootMostMatchingPathAndValue(relativePath: Path, predicate: (a: T) => boolean): {
58
- path: Path;
59
- value: T;
60
- } | null;
61
- /**
62
- * Find, if it exists, the shortest subpath of the given path that points a defined
63
- * value in the tree
64
- * @param {!Path} relativePath
65
- * @return {?{path: !Path, value: !T}}
66
- */
67
- findRootMostValueAndPath(relativePath: Path): {
68
- path: Path;
69
- value: T;
70
- } | null;
71
- /**
72
- * @param {!Path} relativePath
73
- * @return {!ImmutableTree.<T>} The subtree at the given path
74
- */
75
- subtree(relativePath: Path): ImmutableTree<T>;
76
- /**
77
- * Sets a value at the specified path.
78
- *
79
- * @param {!Path} relativePath Path to set value at.
80
- * @param {?T} toSet Value to set.
81
- * @return {!ImmutableTree.<T>} Resulting tree.
82
- */
83
- set(relativePath: Path, toSet: T | null): ImmutableTree<T>;
84
- /**
85
- * Removes the value at the specified path.
86
- *
87
- * @param {!Path} relativePath Path to value to remove.
88
- * @return {!ImmutableTree.<T>} Resulting tree.
89
- */
90
- remove(relativePath: Path): ImmutableTree<T>;
91
- /**
92
- * Gets a value from the tree.
93
- *
94
- * @param {!Path} relativePath Path to get value for.
95
- * @return {?T} Value at path, or null.
96
- */
97
- get(relativePath: Path): T | null;
98
- /**
99
- * Replace the subtree at the specified path with the given new tree.
100
- *
101
- * @param {!Path} relativePath Path to replace subtree for.
102
- * @param {!ImmutableTree} newTree New tree.
103
- * @return {!ImmutableTree} Resulting tree.
104
- */
105
- setTree(relativePath: Path, newTree: ImmutableTree<T>): ImmutableTree<T>;
106
- /**
107
- * Performs a depth first fold on this tree. Transforms a tree into a single
108
- * value, given a function that operates on the path to a node, an optional
109
- * current value, and a map of child names to folded subtrees
110
- * @template V
111
- * @param {function(Path, ?T, Object.<string, V>):V} fn
112
- * @return {V}
113
- */
114
- fold<V>(fn: (path: Path, value: T, children: {
115
- [k: string]: V;
116
- }) => V): V;
117
- /**
118
- * Recursive helper for public-facing fold() method
119
- * @template V
120
- * @param {!Path} pathSoFar
121
- * @param {function(Path, ?T, Object.<string, V>):V} fn
122
- * @return {V}
123
- * @private
124
- */
125
- private fold_;
126
- /**
127
- * Find the first matching value on the given path. Return the result of applying f to it.
128
- * @template V
129
- * @param {!Path} path
130
- * @param {!function(!Path, !T):?V} f
131
- * @return {?V}
132
- */
133
- findOnPath<V>(path: Path, f: (path: Path, value: T) => V | null): V | null;
134
- private findOnPath_;
135
- /**
136
- *
137
- * @param {!Path} path
138
- * @param {!function(!Path, !T)} f
139
- * @returns {!ImmutableTree.<T>}
140
- */
141
- foreachOnPath(path: Path, f: (path: Path, value: T) => void): ImmutableTree<T>;
142
- private foreachOnPath_;
143
- /**
144
- * Calls the given function for each node in the tree that has a value.
145
- *
146
- * @param {function(!Path, !T)} f A function to be called with
147
- * the path from the root of the tree to a node, and the value at that node.
148
- * Called in depth-first order.
149
- */
150
- foreach(f: (path: Path, value: T) => void): void;
151
- private foreach_;
152
- /**
153
- *
154
- * @param {function(string, !T)} f
155
- */
156
- foreachChild(f: (name: string, value: T) => void): void;
157
- }