@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
@@ -144,14 +144,12 @@ export declare class Query {
144
144
  * @return {!Query}
145
145
  */
146
146
  startAt(value?: number | string | boolean | null, name?: string | null): Query;
147
- startAfter(value?: number | string | boolean | null, name?: string | null): Query;
148
147
  /**
149
148
  * @param {number|string|boolean|null} value
150
149
  * @param {?string=} name
151
150
  * @return {!Query}
152
151
  */
153
152
  endAt(value?: number | string | boolean | null, name?: string | null): Query;
154
- endBefore(value?: number | string | boolean | null, name?: string | null): Query;
155
153
  /**
156
154
  * Load the selection of children with exactly the specified value, and, optionally,
157
155
  * the specified name.
@@ -17,7 +17,7 @@
17
17
  import { FirebaseAuthTokenData } from '@firebase/app-types/private';
18
18
  import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
19
19
  import { Provider } from '@firebase/component';
20
- import { FirebaseAppLike } from './RepoManager';
20
+ import { FirebaseApp } from '@firebase/app-types';
21
21
  export interface AuthTokenProvider {
22
22
  getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData>;
23
23
  addTokenChangeListener(listener: (token: string | null) => void): void;
@@ -31,7 +31,7 @@ export declare class FirebaseAuthTokenProvider implements AuthTokenProvider {
31
31
  private app_;
32
32
  private authProvider_;
33
33
  private auth_;
34
- constructor(app_: FirebaseAppLike, authProvider_: Provider<FirebaseAuthInternalName>);
34
+ constructor(app_: FirebaseApp, authProvider_: Provider<FirebaseAuthInternalName>);
35
35
  /**
36
36
  * @param {boolean} forceRefresh
37
37
  * @return {!Promise<FirebaseAuthTokenData>}
@@ -17,20 +17,20 @@
17
17
  import { Path } from './util/Path';
18
18
  import { AuthTokenProvider } from './AuthTokenProvider';
19
19
  import { PersistentConnection } from './PersistentConnection';
20
+ import { FirebaseApp } from '@firebase/app-types';
20
21
  import { RepoInfo } from './RepoInfo';
21
22
  import { Database } from '../api/Database';
22
23
  import { DataSnapshot } from '../api/DataSnapshot';
23
24
  import { Query } from '../api/Query';
24
25
  import { EventRegistration } from './view/EventRegistration';
25
26
  import { Indexable } from './util/misc';
26
- import { FirebaseAppLike } from './RepoManager';
27
27
  /**
28
28
  * A connection to a single data repository.
29
29
  */
30
30
  export declare class Repo {
31
31
  repoInfo_: RepoInfo;
32
32
  private forceRestClient_;
33
- app: FirebaseAppLike;
33
+ app: FirebaseApp;
34
34
  authTokenProvider_: AuthTokenProvider;
35
35
  /** Key for uniquely identifying this repo, used in RepoManager */
36
36
  readonly key: string;
@@ -52,7 +52,7 @@ export declare class Repo {
52
52
  /** A list of data pieces and paths to be set when this client disconnects. */
53
53
  private onDisconnect_;
54
54
  persistentConnection_: PersistentConnection | null;
55
- constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, app: FirebaseAppLike, authTokenProvider_: AuthTokenProvider);
55
+ constructor(repoInfo_: RepoInfo, forceRestClient_: boolean, app: FirebaseApp, authTokenProvider_: AuthTokenProvider);
56
56
  start(): void;
57
57
  /**
58
58
  * @return The URL corresponding to the root of this Firebase.
@@ -83,14 +83,25 @@ export declare class Repo {
83
83
  * The purpose of `getValue` is to return the latest known value
84
84
  * satisfying `query`.
85
85
  *
86
- * This method will first check for in-memory cached values
87
- * belonging to active listeners. If they are found, such values
88
- * are considered to be the most up-to-date.
86
+ * If the client is connected, this method will send a request
87
+ * to the server. If the client is not connected, then either:
89
88
  *
90
- * If the client is not connected, this method will try to
91
- * establish a connection and request the value for `query`. If
92
- * the client is not able to retrieve the query result, it reports
93
- * an error.
89
+ * 1. The client was once connected, but not anymore.
90
+ * 2. The client has never connected, this is the first operation
91
+ * this repo is handling.
92
+ *
93
+ * In case (1), it's possible that the client still has an active
94
+ * listener, with cached data. Since this is the latest known
95
+ * value satisfying the query, that's what getValue will return.
96
+ * If there is no cached data, `getValue` surfaces an "offline"
97
+ * error.
98
+ *
99
+ * In case (2), `getValue` will trigger a time-limited connection
100
+ * attempt. If the client is unable to connect to the server, it
101
+ * will surface an "offline" error because there cannot be any
102
+ * cached data. On the other hand, if the client is able to connect,
103
+ * `getValue` will return the server's value for the query, if one
104
+ * exists.
94
105
  *
95
106
  * @param query - The query to surface a value for.
96
107
  */
@@ -15,7 +15,6 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { FirebaseApp } from '@firebase/app-types';
18
- import { FirebaseApp as FirebaseAppExp } from '@firebase/app-types-exp';
19
18
  import { Repo } from './Repo';
20
19
  import './Repo_transaction';
21
20
  import { Database } from '../api/Database';
@@ -23,11 +22,6 @@ import { RepoInfo } from './RepoInfo';
23
22
  import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
24
23
  import { Provider } from '@firebase/component';
25
24
  import { AuthTokenProvider } from './AuthTokenProvider';
26
- /**
27
- * Intersection type that allows the SDK to be used from firebase-exp and
28
- * firebase v8.
29
- */
30
- export declare type FirebaseAppLike = FirebaseApp | FirebaseAppExp;
31
25
  /**
32
26
  * Creates and caches Repo instances.
33
27
  */
@@ -54,7 +48,7 @@ export declare class RepoManager {
54
48
  * @param {!FirebaseApp} app
55
49
  * @return {!Database}
56
50
  */
57
- databaseFromApp(app: FirebaseAppLike, authProvider: Provider<FirebaseAuthInternalName>, url?: string, nodeAdmin?: boolean): Database;
51
+ databaseFromApp(app: FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>, url?: string, nodeAdmin?: boolean): Database;
58
52
  /**
59
53
  * Remove the repo and make sure it is disconnected.
60
54
  *
@@ -69,7 +63,7 @@ export declare class RepoManager {
69
63
  * @param {!FirebaseApp} app
70
64
  * @return {!Repo} The Repo object for the specified server / repoName.
71
65
  */
72
- createRepo(repoInfo: RepoInfo, app: FirebaseAppLike, authTokenProvider: AuthTokenProvider): Repo;
66
+ createRepo(repoInfo: RepoInfo, app: FirebaseApp, authTokenProvider: AuthTokenProvider): Repo;
73
67
  /**
74
68
  * Forces us to use ReadonlyRestClient instead of PersistentConnection for new Repos.
75
69
  * @param {boolean} forceRestClient
@@ -29,5 +29,3 @@
29
29
  * in the case of a timestamp collision).
30
30
  */
31
31
  export declare const nextPushId: (now: number) => string;
32
- export declare const successor: (key: string) => string;
33
- export declare const predecessor: (key: string) => string;
@@ -167,14 +167,6 @@ export declare const errorForServerCode: (code: string, query: Query) => Error;
167
167
  * @private
168
168
  */
169
169
  export declare const INTEGER_REGEXP_: RegExp;
170
- /**
171
- * For use in keys, the minimum possible 32-bit integer.
172
- */
173
- export declare const INTEGER_32_MIN = -2147483648;
174
- /**
175
- * For use in kyes, the maximum possible 32-bit integer.
176
- */
177
- export declare const INTEGER_32_MAX = 2147483647;
178
170
  /**
179
171
  * If the string contains a 32-bit integer, return it. Else return null.
180
172
  * @param {!string} str
@@ -26,10 +26,8 @@ export declare class QueryParams {
26
26
  private limitSet_;
27
27
  private startSet_;
28
28
  private startNameSet_;
29
- private startAfterSet_;
30
29
  private endSet_;
31
30
  private endNameSet_;
32
- private endBeforeSet_;
33
31
  private limit_;
34
32
  private viewFrom_;
35
33
  private indexStartValue_;
@@ -61,8 +59,6 @@ export declare class QueryParams {
61
59
  * @return {boolean}
62
60
  */
63
61
  hasStart(): boolean;
64
- hasStartAfter(): boolean;
65
- hasEndBefore(): boolean;
66
62
  /**
67
63
  * @return {boolean} True if it would return from left.
68
64
  */
@@ -136,14 +132,12 @@ export declare class QueryParams {
136
132
  * @return {!QueryParams}
137
133
  */
138
134
  startAt(indexValue: unknown, key?: string | null): QueryParams;
139
- startAfter(indexValue: unknown, key?: string | null): QueryParams;
140
135
  /**
141
136
  * @param {*} indexValue
142
137
  * @param {?string=} key
143
138
  * @return {!QueryParams}
144
139
  */
145
140
  endAt(indexValue: unknown, key?: string | null): QueryParams;
146
- endBefore(indexValue: unknown, key?: string | null): QueryParams;
147
141
  /**
148
142
  * @param {!Index} index
149
143
  * @return {!QueryParams}
package/package.json CHANGED
@@ -1,21 +1,17 @@
1
1
  {
2
2
  "name": "@firebase/database",
3
- "version": "0.8.3-canary.fb90580e5",
3
+ "version": "0.8.3",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
7
7
  "browser": "dist/index.esm.js",
8
8
  "module": "dist/index.esm.js",
9
9
  "esm2017": "dist/index.esm2017.js",
10
- "files": [
11
- "dist"
12
- ],
10
+ "files": ["dist"],
13
11
  "scripts": {
14
12
  "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
15
13
  "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
16
- "build": "run-p build:classic build:exp",
17
- "build:classic": "rollup -c rollup.config.js",
18
- "build:exp": "rollup -c rollup.config.exp.js",
14
+ "build": "rollup -c",
19
15
  "build:deps": "lerna run --scope @firebase/'{app,database}' --include-dependencies build",
20
16
  "dev": "rollup -c -w",
21
17
  "test": "run-p lint test:emulator",
@@ -23,23 +19,24 @@
23
19
  "test:all": "run-p lint test:browser test:node",
24
20
  "test:browser": "karma start --single-run",
25
21
  "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file index.node.ts --config ../../config/mocharc.node.js",
26
- "test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/database-test-runner.ts"
22
+ "test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/database-test-runner.ts",
23
+ "prepare": "yarn build"
27
24
  },
28
25
  "license": "Apache-2.0",
29
26
  "peerDependencies": {},
30
27
  "dependencies": {
31
- "@firebase/database-types": "0.6.1-canary.fb90580e5",
32
- "@firebase/logger": "0.2.6-canary.fb90580e5",
33
- "@firebase/util": "0.3.4-canary.fb90580e5",
34
- "@firebase/component": "0.1.21-canary.fb90580e5",
35
- "@firebase/auth-interop-types": "0.1.5-canary.fb90580e5",
28
+ "@firebase/database-types": "0.6.1",
29
+ "@firebase/logger": "0.2.6",
30
+ "@firebase/util": "0.3.4",
31
+ "@firebase/component": "0.1.21",
32
+ "@firebase/auth-interop-types": "0.1.5",
36
33
  "faye-websocket": "0.11.3",
37
34
  "tslib": "^1.11.1"
38
35
  },
39
36
  "devDependencies": {
40
- "@firebase/app": "0.6.13-canary.fb90580e5",
41
- "@firebase/app-types": "0.6.1-canary.fb90580e5",
42
- "rollup": "2.35.1",
37
+ "@firebase/app": "0.6.13",
38
+ "@firebase/app-types": "0.6.1",
39
+ "rollup": "2.33.2",
43
40
  "rollup-plugin-typescript2": "0.29.0",
44
41
  "typescript": "4.0.5"
45
42
  },
@@ -1,29 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2020 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 { FirebaseDatabase } from '../src/exp/Database';
18
- export { getDatabase, FirebaseDatabase, ServerValue } from '../src/exp/Database';
19
- export { EventType } from '../src/core/view/Event';
20
- export { DataSnapshot } from '../src/api/DataSnapshot';
21
- export { Query } from '../src/api/Query';
22
- export { Reference } from '../src/api/Reference';
23
- export { OnDisconnect } from '../src/api/onDisconnect';
24
- export { enableLogging } from '../src/core/util/util';
25
- declare module '@firebase/component' {
26
- interface NameServiceMapping {
27
- 'database-exp': FirebaseDatabase;
28
- }
29
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { FirebaseNamespace } from '@firebase/app-types';
18
- import { Database } from './src/api/Database';
19
- import { Query } from './src/api/Query';
20
- import { Reference } from './src/api/Reference';
21
- import { enableLogging } from './src/core/util/util';
22
- import * as types from '@firebase/database-types';
23
- declare const ServerValue: {
24
- TIMESTAMP: {
25
- '.sv': string;
26
- };
27
- increment: (delta: number) => {
28
- '.sv': {
29
- increment: number;
30
- };
31
- };
32
- };
33
- export declare function registerDatabase(instance: FirebaseNamespace): void;
34
- export { Database, Query, Reference, enableLogging, ServerValue };
35
- export { DataSnapshot } from './src/api/DataSnapshot';
36
- export { OnDisconnect } from './src/api/onDisconnect';
37
- declare module '@firebase/app-types' {
38
- interface FirebaseNamespace {
39
- database?: {
40
- (app?: FirebaseApp): types.FirebaseDatabase;
41
- enableLogging: typeof types.enableLogging;
42
- ServerValue: types.ServerValue;
43
- Database: typeof types.FirebaseDatabase;
44
- };
45
- }
46
- interface FirebaseApp {
47
- database?(databaseURL?: string): types.FirebaseDatabase;
48
- }
49
- }