Skip to content

Commit e336946

Browse files
authored
Update prune-dts to allow beta APIs (#6633)
1 parent c6ba6fc commit e336946

File tree

4 files changed

+48
-13
lines changed

4 files changed

+48
-13
lines changed

common/api-review/firestore.api.md

+30
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,30 @@ export function getFirestore(app: FirebaseApp): Firestore;
236236
// @public
237237
export function increment(n: number): FieldValue;
238238

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

@@ -399,6 +423,12 @@ export function setDoc<T>(reference: DocumentReference<T>, data: WithFieldValue<
399423
// @public
400424
export function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
401425

426+
// @beta
427+
export function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
428+
429+
// @beta
430+
export function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
431+
402432
// @public
403433
export function setLogLevel(logLevel: LogLevel): void;
404434

packages/firestore/src/api/database.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const CACHE_SIZE_UNLIMITED = LRU_COLLECTION_DISABLED;
8888
/**
8989
* The Cloud Firestore service interface.
9090
*
91-
* Do not call this constructor directly. Instead, use {@link getFirestore}.
91+
* Do not call this constructor directly. Instead, use {@link (getFirestore:1)}.
9292
*/
9393
export class Firestore extends LiteFirestore {
9494
/**
@@ -130,8 +130,8 @@ export class Firestore extends LiteFirestore {
130130
/**
131131
* Initializes a new instance of {@link Firestore} with the provided settings.
132132
* Can only be called before any other function, including
133-
* {@link getFirestore}. If the custom settings are empty, this function is
134-
* equivalent to calling {@link getFirestore}.
133+
* {@link (getFirestore:1)}. If the custom settings are empty, this function is
134+
* equivalent to calling {@link (getFirestore:1)}.
135135
*
136136
* @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
137137
* be associated.
@@ -280,7 +280,7 @@ export function configureFirestore(firestore: Firestore): void {
280280
* Attempts to enable persistent storage, if possible.
281281
*
282282
* Must be called before any other functions (other than
283-
* {@link initializeFirestore}, {@link getFirestore} or
283+
* {@link initializeFirestore}, {@link (getFirestore:1)} or
284284
* {@link clearIndexedDbPersistence}.
285285
*
286286
* If this fails, `enableIndexedDbPersistence()` will reject the promise it
@@ -444,7 +444,7 @@ function canFallbackFromIndexedDbError(
444444
* Must be called while the {@link Firestore} instance is not started (after the app is
445445
* terminated or when the app is first initialized). On startup, this function
446446
* must be called before other functions (other than {@link
447-
* initializeFirestore} or {@link getFirestore})). If the {@link Firestore}
447+
* initializeFirestore} or {@link (getFirestore:1)})). If the {@link Firestore}
448448
* instance is still running, the promise will be rejected with the error code
449449
* of `failed-precondition`.
450450
*
@@ -537,7 +537,7 @@ export function disableNetwork(firestore: Firestore): Promise<void> {
537537
* may be used. Any other function will throw a `FirestoreError`.
538538
*
539539
* To restart after termination, create a new instance of FirebaseFirestore with
540-
* {@link getFirestore}.
540+
* {@link (getFirestore:1)}.
541541
*
542542
* Termination does not cancel any pending writes, and any promises that are
543543
* awaiting a response from the server will not be resolved. If you have

packages/firestore/src/lite-api/database.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ declare module '@firebase/component' {
5353
/**
5454
* The Cloud Firestore service interface.
5555
*
56-
* Do not call this constructor directly. Instead, use {@link getFirestore}.
56+
* Do not call this constructor directly. Instead, use {@link (getFirestore:1)}.
5757
*/
5858
export class Firestore implements FirestoreService {
5959
/**
@@ -157,8 +157,8 @@ export class Firestore implements FirestoreService {
157157
/**
158158
* Initializes a new instance of Cloud Firestore with the provided settings.
159159
* Can only be called before any other functions, including
160-
* {@link getFirestore}. If the custom settings are empty, this function is
161-
* equivalent to calling {@link getFirestore}.
160+
* {@link (getFirestore:1)}. If the custom settings are empty, this function is
161+
* equivalent to calling {@link (getFirestore:1)}.
162162
*
163163
* @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will
164164
* be associated.
@@ -172,8 +172,8 @@ export function initializeFirestore(
172172
/**
173173
* Initializes a new instance of Cloud Firestore with the provided settings.
174174
* Can only be called before any other functions, including
175-
* {@link getFirestore}. If the custom settings are empty, this function is
176-
* equivalent to calling {@link getFirestore}.
175+
* {@link (getFirestore:1)}. If the custom settings are empty, this function is
176+
* equivalent to calling {@link (getFirestore:1)}.
177177
*
178178
* @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will
179179
* be associated.
@@ -341,7 +341,7 @@ export function connectFirestoreEmulator(
341341
* response from the server will not be resolved.
342342
*
343343
* To restart after termination, create a new instance of `Firestore` with
344-
* {@link getFirestore}.
344+
* {@link (getFirestore:1)}.
345345
*
346346
* Note: Under normal circumstances, calling `terminate()` is not required. This
347347
* function is useful only when you want to force this instance to release all of

repo-scripts/prune-dts/extract-public-api.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ function loadApiExtractorConfig(
7777
mainEntryPointFilePath: typescriptDtsPath,
7878
'dtsRollup': {
7979
'enabled': dtsRollupEnabled,
80-
publicTrimmedFilePath: rollupDtsPath,
80+
/**
81+
* Include beta APIs in documentation and typings. api-extractor/documenter
82+
* seems to work this way by default but this intermediate step
83+
* seems to restrict it to public tagged APIs.
84+
*/
85+
betaTrimmedFilePath: rollupDtsPath,
8186
untrimmedFilePath: untrimmedRollupDtsPath
8287
},
8388
'tsdocMetadata': {

0 commit comments

Comments
 (0)