Skip to content

Commit f8266f8

Browse files
committed
Expose IndexConfiguration types
1 parent e5803df commit f8266f8

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

common/api-review/firestore.api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,30 @@ export function getFirestore(app?: FirebaseApp): Firestore;
233233
// @public
234234
export function increment(n: number): FieldValue;
235235

236+
// @public
237+
export interface Index {
238+
// (undocumented)
239+
[key: string]: unknown;
240+
readonly collectionGroup: string;
241+
readonly fields?: IndexField[];
242+
}
243+
244+
// @public
245+
export interface IndexConfiguration {
246+
// (undocumented)
247+
[key: string]: unknown;
248+
readonly indexes?: Index[];
249+
}
250+
251+
// @public
252+
export interface IndexField {
253+
// (undocumented)
254+
[key: string]: unknown;
255+
readonly arrayConfig?: 'CONTAINS';
256+
readonly fieldPath: string;
257+
readonly order?: 'ASCENDING' | 'DESCENDING';
258+
}
259+
236260
// @public
237261
export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
238262

@@ -396,6 +420,12 @@ export function setDoc<T>(reference: DocumentReference<T>, data: WithFieldValue<
396420
// @public
397421
export function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
398422

423+
// @public
424+
export function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
425+
426+
// @public
427+
export function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
428+
399429
// @public
400430
export function setLogLevel(logLevel: LogLevel): void;
401431

packages/firestore/src/api.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ export {
143143
UnionToIntersection
144144
} from '../src/lite-api/types';
145145

146-
export { setIndexConfiguration } from './api/index_configuration';
146+
export {
147+
setIndexConfiguration,
148+
Index,
149+
IndexConfiguration,
150+
IndexField
151+
} from './api/index_configuration';
147152

148153
/**
149154
* Internal exports

packages/firestore/src/api/index_configuration.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export {
3939

4040
/**
4141
* A single field element in an index configuration.
42-
*
43-
* @internal
4442
*/
4543
export interface IndexField {
4644
/** The field path to index. */
@@ -65,8 +63,6 @@ export interface IndexField {
6563

6664
/**
6765
* The SDK definition of a Firestore index.
68-
*
69-
* @internal
7066
*/
7167
export interface Index {
7268
/** The ID of the collection to index. */

0 commit comments

Comments
 (0)