@firebase/firestore 3.4.14-20220804201204 → 3.4.14-canary.0361bf3d7

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 (62) hide show
  1. package/CHANGELOG.md +1 -4
  2. package/dist/firestore/src/api/credentials.d.ts +13 -3
  3. package/dist/firestore/src/api/database.d.ts +32 -3
  4. package/dist/firestore/src/api/index_configuration.d.ts +5 -0
  5. package/dist/firestore/src/core/database_info.d.ts +4 -0
  6. package/dist/firestore/src/lite-api/database.d.ts +37 -8
  7. package/dist/firestore/test/integration/api/provider.test.d.ts +17 -0
  8. package/dist/firestore/test/integration/util/firebase_export.d.ts +2 -1
  9. package/dist/firestore/test/integration/util/helpers.d.ts +1 -0
  10. package/dist/index.d.ts +32 -93
  11. package/dist/index.esm2017.js +1711 -1702
  12. package/dist/index.esm2017.js.map +1 -1
  13. package/dist/index.esm5.js +2342 -2329
  14. package/dist/index.esm5.js.map +1 -1
  15. package/dist/index.node.cjs.js +74 -56
  16. package/dist/index.node.cjs.js.map +1 -1
  17. package/dist/index.node.mjs +74 -56
  18. package/dist/index.node.mjs.map +1 -1
  19. package/dist/index.rn.js +1711 -1702
  20. package/dist/index.rn.js.map +1 -1
  21. package/dist/internal.d.ts +46 -6
  22. package/dist/lite/firestore/src/api/credentials.d.ts +13 -3
  23. package/dist/lite/firestore/src/api/database.d.ts +32 -3
  24. package/dist/lite/firestore/src/api/index_configuration.d.ts +5 -0
  25. package/dist/lite/firestore/src/core/database_info.d.ts +4 -0
  26. package/dist/lite/firestore/src/lite-api/database.d.ts +37 -8
  27. package/dist/lite/firestore/test/integration/api/provider.test.d.ts +17 -0
  28. package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +2 -1
  29. package/dist/lite/firestore/test/integration/util/helpers.d.ts +1 -0
  30. package/dist/lite/index.browser.esm2017.js +282 -275
  31. package/dist/lite/index.browser.esm2017.js.map +1 -1
  32. package/dist/lite/index.browser.esm5.js +517 -491
  33. package/dist/lite/index.browser.esm5.js.map +1 -1
  34. package/dist/lite/index.d.ts +34 -5
  35. package/dist/lite/index.node.cjs.js +66 -49
  36. package/dist/lite/index.node.cjs.js.map +1 -1
  37. package/dist/lite/index.node.mjs +66 -49
  38. package/dist/lite/index.node.mjs.map +1 -1
  39. package/dist/lite/index.rn.esm2017.js +282 -275
  40. package/dist/lite/index.rn.esm2017.js.map +1 -1
  41. package/dist/lite/internal.d.ts +43 -8
  42. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +40 -66
  43. package/dist/lite/packages/firestore/src/api/credentials.d.ts +13 -3
  44. package/dist/lite/packages/firestore/src/api/database.d.ts +32 -3
  45. package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +5 -0
  46. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -0
  47. package/dist/lite/packages/firestore/src/lite-api/database.d.ts +37 -8
  48. package/dist/lite/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  49. package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  50. package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  51. package/dist/lite/private.d.ts +43 -8
  52. package/dist/packages/firestore/dist/index.esm2017.d.ts +70 -65
  53. package/dist/packages/firestore/src/api/credentials.d.ts +13 -3
  54. package/dist/packages/firestore/src/api/database.d.ts +32 -3
  55. package/dist/packages/firestore/src/api/index_configuration.d.ts +5 -0
  56. package/dist/packages/firestore/src/core/database_info.d.ts +4 -0
  57. package/dist/packages/firestore/src/lite-api/database.d.ts +37 -8
  58. package/dist/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  59. package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  60. package/dist/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  61. package/dist/private.d.ts +45 -98
  62. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @firebase/firestore
2
2
 
3
- ## 3.4.14-20220804201204
3
+ ## 3.4.14
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -8,9 +8,6 @@
8
8
 
9
9
  * [`10765511f`](https://github.com/firebase/firebase-js-sdk/commit/10765511f7ba33293f7a15af1f98d69a261c019d) [#6496](https://github.com/firebase/firebase-js-sdk/pull/6496) - Expose client side indexing feature with `setIndexConfiguration`.
10
10
 
11
- * Updated dependencies [[`82a6add13`](https://github.com/firebase/firebase-js-sdk/commit/82a6add1354fe7e4ac1d444157ac027cdd41da6e)]:
12
- - @firebase/app@0.7.30-20220804201204
13
-
14
11
  ## 3.4.13
15
12
 
16
13
  ### Patch Changes
@@ -19,11 +19,13 @@ import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
19
19
  import { Provider } from '@firebase/component';
20
20
  import { User } from '../auth/user';
21
21
  import { AsyncQueue } from '../util/async_queue';
22
+ export declare type AuthTokenFactory = () => string;
22
23
  export interface FirstPartyCredentialsSettings {
23
24
  ['type']: 'gapi';
24
25
  ['client']: unknown;
25
26
  ['sessionIndex']: string;
26
27
  ['iamToken']: string | null;
28
+ ['authTokenFactory']: AuthTokenFactory | null;
27
29
  }
28
30
  export interface ProviderCredentialsSettings {
29
31
  ['type']: 'provider';
@@ -146,16 +148,24 @@ interface Gapi {
146
148
  };
147
149
  }
148
150
  export declare class FirstPartyToken implements Token {
151
+ private readonly gapi;
152
+ private readonly sessionIndex;
153
+ private readonly iamToken;
154
+ private readonly authTokenFactory;
149
155
  type: TokenType;
150
156
  user: User;
151
- headers: Map<any, any>;
152
- constructor(gapi: Gapi, sessionIndex: string, iamToken: string | null);
157
+ private _headers;
158
+ constructor(gapi: Gapi | null, sessionIndex: string, iamToken: string | null, authTokenFactory: AuthTokenFactory | null);
159
+ /** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */
160
+ private getAuthToken;
161
+ get headers(): Map<string, string>;
153
162
  }
154
163
  export declare class FirstPartyAuthCredentialsProvider implements CredentialsProvider<User> {
155
164
  private gapi;
156
165
  private sessionIndex;
157
166
  private iamToken;
158
- constructor(gapi: Gapi, sessionIndex: string, iamToken: string | null);
167
+ private authTokenFactory;
168
+ constructor(gapi: Gapi | null, sessionIndex: string, iamToken: string | null, authTokenFactory: AuthTokenFactory | null);
159
169
  getToken(): Promise<Token | null>;
160
170
  start(asyncQueue: AsyncQueue, changeListener: CredentialChangeListener<User>): void;
161
171
  shutdown(): void;
@@ -50,7 +50,7 @@ export declare class Firestore extends LiteFirestore {
50
50
  readonly _persistenceKey: string;
51
51
  _firestoreClient: FirestoreClient | undefined;
52
52
  /** @hideconstructor */
53
- constructor(databaseIdOrApp: DatabaseId | FirebaseApp, authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>);
53
+ constructor(authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>, databaseId: DatabaseId, app?: FirebaseApp);
54
54
  _terminate(): Promise<void>;
55
55
  }
56
56
  /**
@@ -62,9 +62,37 @@ export declare class Firestore extends LiteFirestore {
62
62
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
63
63
  * be associated.
64
64
  * @param settings - A settings object to configure the {@link Firestore} instance.
65
+ * @param databaseId - The name of database.
65
66
  * @returns A newly initialized {@link Firestore} instance.
66
67
  */
67
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
68
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
69
+ /**
70
+ * Returns the existing default {@link Firestore} instance that is associated with the
71
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
72
+ * instance with default settings.
73
+ *
74
+ * @returns The {@link Firestore} instance of the provided app.
75
+ */
76
+ export declare function getFirestore(): Firestore;
77
+ /**
78
+ * Returns the existing default {@link Firestore} instance that is associated with the
79
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
80
+ * instance with default settings.
81
+ *
82
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
83
+ * instance is associated with.
84
+ * @returns The {@link Firestore} instance of the provided app.
85
+ */
86
+ export declare function getFirestore(app: FirebaseApp): Firestore;
87
+ /**
88
+ * Returns the existing {@link Firestore} instance that is associated with the
89
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
90
+ * instance with default settings.
91
+ *
92
+ * @param databaseId - The name of database.
93
+ * @returns The {@link Firestore} instance of the provided app.
94
+ */
95
+ export declare function getFirestore(databaseId: string): Firestore;
68
96
  /**
69
97
  * Returns the existing {@link Firestore} instance that is associated with the
70
98
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
@@ -72,9 +100,10 @@ export declare function initializeFirestore(app: FirebaseApp, settings: Firestor
72
100
  *
73
101
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
74
102
  * instance is associated with.
103
+ * @param databaseId - The name of database.
75
104
  * @returns The {@link Firestore} instance of the provided app.
76
105
  */
77
- export declare function getFirestore(app?: FirebaseApp): Firestore;
106
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
78
107
  /**
79
108
  * @internal
80
109
  */
@@ -19,6 +19,7 @@ import { Firestore } from './database';
19
19
  export { connectFirestoreEmulator, EmulatorMockTokenOptions } from '../lite-api/database';
20
20
  /**
21
21
  * A single field element in an index configuration.
22
+ * @beta
22
23
  */
23
24
  export interface IndexField {
24
25
  /** The field path to index. */
@@ -41,6 +42,7 @@ export interface IndexField {
41
42
  }
42
43
  /**
43
44
  * The SDK definition of a Firestore index.
45
+ * @beta
44
46
  */
45
47
  export interface Index {
46
48
  /** The ID of the collection to index. */
@@ -54,6 +56,7 @@ export interface Index {
54
56
  *
55
57
  * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
56
58
  * for a description of the format of the index definition.
59
+ * @beta
57
60
  */
58
61
  export interface IndexConfiguration {
59
62
  /** A list of all Firestore indexes. */
@@ -80,6 +83,7 @@ export interface IndexConfiguration {
80
83
  * @throws FirestoreError if the JSON format is invalid.
81
84
  * @returns A `Promise` that resolves once all indices are successfully
82
85
  * configured.
86
+ * @beta
83
87
  */
84
88
  export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
85
89
  /**
@@ -106,6 +110,7 @@ export declare function setIndexConfiguration(firestore: Firestore, configuratio
106
110
  * @throws FirestoreError if the JSON format is invalid.
107
111
  * @returns A `Promise` that resolves once all indices are successfully
108
112
  * configured.
113
+ * @beta
109
114
  */
110
115
  export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
111
116
  export declare function parseIndexes(jsonOrConfiguration: string | IndexConfiguration): FieldIndex[];
@@ -1,3 +1,4 @@
1
+ import { FirebaseApp } from '@firebase/app';
1
2
  /**
2
3
  * @license
3
4
  * Copyright 2017 Google LLC
@@ -42,6 +43,8 @@ export declare class DatabaseInfo {
42
43
  */
43
44
  constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
44
45
  }
46
+ /** The default database name for a project. */
47
+ export declare const DEFAULT_DATABASE_NAME = "(default)";
45
48
  /**
46
49
  * Represents the database ID a Firestore client is associated with.
47
50
  * @internal
@@ -54,3 +57,4 @@ export declare class DatabaseId {
54
57
  get isDefaultDatabase(): boolean;
55
58
  isEqual(other: {}): boolean;
56
59
  }
60
+ export declare function databaseIdFromApp(app: FirebaseApp, database?: string): DatabaseId;
@@ -34,18 +34,18 @@ declare module '@firebase/component' {
34
34
  export declare class Firestore implements FirestoreService {
35
35
  _authCredentials: CredentialsProvider<User>;
36
36
  _appCheckCredentials: CredentialsProvider<string>;
37
+ readonly _databaseId: DatabaseId;
38
+ readonly _app?: FirebaseApp | undefined;
37
39
  /**
38
40
  * Whether it's a Firestore or Firestore Lite instance.
39
41
  */
40
42
  type: 'firestore-lite' | 'firestore';
41
- readonly _databaseId: DatabaseId;
42
43
  readonly _persistenceKey: string;
43
44
  private _settings;
44
45
  private _settingsFrozen;
45
46
  private _terminateTask?;
46
- _app?: FirebaseApp;
47
47
  /** @hideconstructor */
48
- constructor(databaseIdOrApp: DatabaseId | FirebaseApp, _authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>);
48
+ constructor(_authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>, _databaseId: DatabaseId, _app?: FirebaseApp | undefined);
49
49
  /**
50
50
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
51
51
  * instance.
@@ -77,19 +77,48 @@ export declare class Firestore implements FirestoreService {
77
77
  * @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will
78
78
  * be associated.
79
79
  * @param settings - A settings object to configure the `Firestore` instance.
80
+ * @param databaseId - The name of database.
80
81
  * @returns A newly initialized `Firestore` instance.
81
82
  */
82
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
83
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
84
+ /**
85
+ * Returns the existing default {@link Firestore} instance that is associated with the
86
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
87
+ * instance with default settings.
88
+ *
89
+ * @returns The {@link Firestore} instance of the provided app.
90
+ */
91
+ export declare function getFirestore(): Firestore;
92
+ /**
93
+ * Returns the existing default {@link Firestore} instance that is associated with the
94
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
95
+ * instance with default settings.
96
+ *
97
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
98
+ * instance is associated with.
99
+ * @returns The {@link Firestore} instance of the provided app.
100
+ */
101
+ export declare function getFirestore(app: FirebaseApp): Firestore;
102
+ /**
103
+ * Returns the existing {@link Firestore} instance that is associated with the
104
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
105
+ * instance with default settings.
106
+ *
107
+ * @param databaseId - The name of database.
108
+ * @returns The {@link Firestore} instance of the provided app.
109
+ */
110
+ export declare function getFirestore(databaseId: string): Firestore;
83
111
  /**
84
- * Returns the existing `Firestore` instance that is associated with the
112
+ * Returns the existing {@link Firestore} instance that is associated with the
85
113
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
86
114
  * instance with default settings.
87
115
  *
88
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
116
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
89
117
  * instance is associated with.
90
- * @returns The `Firestore` instance of the provided app.
118
+ * @param databaseId - The name of database.
119
+ * @returns The {@link Firestore} instance of the provided app.
91
120
  */
92
- export declare function getFirestore(app?: FirebaseApp): Firestore;
121
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
93
122
  export { EmulatorMockTokenOptions } from '@firebase/util';
94
123
  /**
95
124
  * Modify this instance to communicate with the Cloud Firestore emulator.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -17,6 +17,7 @@
17
17
  import { FirebaseApp } from '@firebase/app';
18
18
  import { Firestore } from '../../../src';
19
19
  import { PrivateSettings } from '../../../src/lite-api/settings';
20
- export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: PrivateSettings): Firestore;
20
+ export declare function newTestApp(projectId: string, appName?: string): FirebaseApp;
21
+ export declare function newTestFirestore(app: FirebaseApp, settings?: PrivateSettings, dbName?: string): Firestore;
21
22
  export * from '../../../src';
22
23
  export { PrivateSettings };
@@ -37,6 +37,7 @@ export declare function withTestDb(persistence: boolean, fn: (db: Firestore) =>
37
37
  export declare function withAlternateTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
38
38
  export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
39
39
  export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: PrivateSettings, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
40
+ export declare function withNamedTestDbsOrSkipUnlessUsingEmulator(persistence: boolean, dbNames: string[], fn: (db: Firestore[]) => Promise<void>): Promise<void>;
40
41
  export declare function withTestDoc(persistence: boolean, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
41
42
  export declare function withTestDocAndSettings(persistence: boolean, settings: PrivateSettings, fn: (doc: DocumentReference) => Promise<void>): Promise<void>;
42
43
  export declare function withTestDocAndInitialData(persistence: boolean, initialData: DocumentData | null, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -899,6 +899,33 @@ export declare function getDocsFromCache<T>(query: Query<T>): Promise<QuerySnaps
899
899
  * @returns A `Promise` that will be resolved with the results of the query.
900
900
  */
901
901
  export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
902
+ /**
903
+ * Returns the existing default {@link Firestore} instance that is associated with the
904
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
905
+ * instance with default settings.
906
+ *
907
+ * @returns The {@link Firestore} instance of the provided app.
908
+ */
909
+ export declare function getFirestore(): Firestore;
910
+ /**
911
+ * Returns the existing default {@link Firestore} instance that is associated with the
912
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
913
+ * instance with default settings.
914
+ *
915
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
916
+ * instance is associated with.
917
+ * @returns The {@link Firestore} instance of the provided app.
918
+ */
919
+ export declare function getFirestore(app: FirebaseApp): Firestore;
920
+ /**
921
+ * Returns the existing {@link Firestore} instance that is associated with the
922
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
923
+ * instance with default settings.
924
+ *
925
+ * @param databaseId - The name of database.
926
+ * @returns The {@link Firestore} instance of the provided app.
927
+ */
928
+ export declare function getFirestore(databaseId: string): Firestore;
902
929
  /**
903
930
  * Returns the existing {@link Firestore} instance that is associated with the
904
931
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
@@ -906,9 +933,10 @@ export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnap
906
933
  *
907
934
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
908
935
  * instance is associated with.
936
+ * @param databaseId - The name of database.
909
937
  * @returns The {@link Firestore} instance of the provided app.
910
938
  */
911
- export declare function getFirestore(app?: FirebaseApp): Firestore;
939
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
912
940
  /**
913
941
  * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link
914
942
  * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by
@@ -929,49 +957,6 @@ export declare function getFirestore(app?: FirebaseApp): Firestore;
929
957
  * `updateDoc()`
930
958
  */
931
959
  export declare function increment(n: number): FieldValue;
932
- /**
933
- * The SDK definition of a Firestore index.
934
- */
935
- export declare interface Index {
936
- /** The ID of the collection to index. */
937
- readonly collectionGroup: string;
938
- /** A list of fields to index. */
939
- readonly fields?: IndexField[];
940
- [key: string]: unknown;
941
- }
942
- /**
943
- * A list of Firestore indexes to speed up local query execution.
944
- *
945
- * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
946
- * for a description of the format of the index definition.
947
- */
948
- export declare interface IndexConfiguration {
949
- /** A list of all Firestore indexes. */
950
- readonly indexes?: Index[];
951
- [key: string]: unknown;
952
- }
953
- /**
954
- * A single field element in an index configuration.
955
- */
956
- export declare interface IndexField {
957
- /** The field path to index. */
958
- readonly fieldPath: string;
959
- /**
960
- * What type of array index to create. Set to `CONTAINS` for `array-contains`
961
- * and `array-contains-any` indexes.
962
- *
963
- * Only one of `arrayConfig` or `order` should be set;
964
- */
965
- readonly arrayConfig?: 'CONTAINS';
966
- /**
967
- * What type of array index to create. Set to `ASCENDING` or 'DESCENDING` for
968
- * `==`, `!=`, `<=`, `<=`, `in` and `not-in` filters.
969
- *
970
- * Only one of `arrayConfig` or `order` should be set.
971
- */
972
- readonly order?: 'ASCENDING' | 'DESCENDING';
973
- [key: string]: unknown;
974
- }
975
960
  /**
976
961
  * Initializes a new instance of {@link Firestore} with the provided settings.
977
962
  * Can only be called before any other function, including
@@ -981,9 +966,10 @@ export declare interface IndexField {
981
966
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
982
967
  * be associated.
983
968
  * @param settings - A settings object to configure the {@link Firestore} instance.
969
+ * @param databaseId - The name of database.
984
970
  * @returns A newly initialized {@link Firestore} instance.
985
971
  */
986
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
972
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
987
973
  /* Excluded from this release type: _isBase64Available */
988
974
  /**
989
975
  * Creates a {@link QueryConstraint} that only returns the first matching documents.
@@ -1514,54 +1500,7 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: WithFie
1514
1500
  * to the backend (note that it won't resolve while you're offline).
1515
1501
  */
1516
1502
  export declare function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
1517
- /**
1518
- * Configures indexing for local query execution. Any previous index
1519
- * configuration is overridden. The `Promise` resolves once the index
1520
- * configuration has been persisted.
1521
- *
1522
- * The index entries themselves are created asynchronously. You can continue to
1523
- * use queries that require indexing even if the indices are not yet available.
1524
- * Query execution will automatically start using the index once the index
1525
- * entries have been written.
1526
- *
1527
- * Indexes are only supported with IndexedDb persistence. Invoke either
1528
- * `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()`
1529
- * before setting an index configuration. If IndexedDb is not enabled, any
1530
- * index configuration is ignored.
1531
- *
1532
- * @param firestore - The {@link Firestore} instance to configure indexes for.
1533
- * @param configuration -The index definition.
1534
- * @throws FirestoreError if the JSON format is invalid.
1535
- * @returns A `Promise` that resolves once all indices are successfully
1536
- * configured.
1537
- */
1538
- export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
1539
- /**
1540
- * Configures indexing for local query execution. Any previous index
1541
- * configuration is overridden. The `Promise` resolves once the index
1542
- * configuration has been persisted.
1543
- *
1544
- * The index entries themselves are created asynchronously. You can continue to
1545
- * use queries that require indexing even if the indices are not yet available.
1546
- * Query execution will automatically start using the index once the index
1547
- * entries have been written.
1548
- *
1549
- * Indexes are only supported with IndexedDb persistence. Invoke either
1550
- * `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()`
1551
- * before setting an index configuration. If IndexedDb is not enabled, any
1552
- * index configuration is ignored.
1553
- *
1554
- * The method accepts the JSON format exported by the Firebase CLI (`firebase
1555
- * firestore:indexes`). If the JSON format is invalid, this method throws an
1556
- * error.
1557
- *
1558
- * @param firestore - The {@link Firestore} instance to configure indexes for.
1559
- * @param json -The JSON format exported by the Firebase CLI.
1560
- * @throws FirestoreError if the JSON format is invalid.
1561
- * @returns A `Promise` that resolves once all indices are successfully
1562
- * configured.
1563
- */
1564
- export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
1503
+ /* Excluded from this release type: setIndexConfiguration */
1565
1504
  /**
1566
1505
  * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
1567
1506
  *