diff --git a/etc/firebase-admin.extensions.api.md b/etc/firebase-admin.extensions.api.md index ed9090aaee..127754c9c9 100644 --- a/etc/firebase-admin.extensions.api.md +++ b/etc/firebase-admin.extensions.api.md @@ -14,11 +14,19 @@ export class Extensions { // // (undocumented) readonly app: App; - // Warning: (ae-forgotten-export) The symbol "Runtime" needs to be exported by the entry point index.d.ts runtime(): Runtime; } // @public export function getExtensions(app?: App): Extensions; +// @public +export class Runtime { + setFatalError(errorMessage: string): Promise; + setProcessingState(state: SettableProcessingState, detailMessage: string): Promise; +} + +// @public +export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED'; + ``` diff --git a/src/extensions/extensions.ts b/src/extensions/extensions.ts index 6e98f3575c..c4f6485539 100644 --- a/src/extensions/extensions.ts +++ b/src/extensions/extensions.ts @@ -36,8 +36,10 @@ export class Extensions { /** * The runtime() method returns a new Runtime, which provides methods to modify an extension instance's runtime data. + * + * This method will throw an error if called outside an Extensions environment. * - * @returns A new Runtime object. + * @returns A new {@link Runtime} object. */ public runtime(): Runtime { return new Runtime(this.client); @@ -47,7 +49,7 @@ export class Extensions { /** * Runtime provides methods to modify an extension instance's runtime data. */ -class Runtime { +export class Runtime { private projectId: string; private extensionInstanceId: string; private readonly client: ExtensionsApiClient; diff --git a/src/extensions/index.ts b/src/extensions/index.ts index 6283e630dc..486ad645d0 100644 --- a/src/extensions/index.ts +++ b/src/extensions/index.ts @@ -25,8 +25,9 @@ import { App, getApp } from '../app'; import { FirebaseApp } from '../app/firebase-app'; import { Extensions } from './extensions'; -export { Extensions } from './extensions'; - +export { Extensions, Runtime } from './extensions'; +export { SettableProcessingState } from './extensions-api'; + /** * Gets the {@link Extensions} service for the default app * or a given app.