Skip to content

Commit 38fb85f

Browse files
Extensions docstring tweaks (#1980)
* Extensions docstring tweaks * export Runtime * export SettableProcessingState
1 parent 34f84b6 commit 38fb85f

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

etc/firebase-admin.extensions.api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@ export class Extensions {
1414
//
1515
// (undocumented)
1616
readonly app: App;
17-
// Warning: (ae-forgotten-export) The symbol "Runtime" needs to be exported by the entry point index.d.ts
1817
runtime(): Runtime;
1918
}
2019

2120
// @public
2221
export function getExtensions(app?: App): Extensions;
2322

23+
// @public
24+
export class Runtime {
25+
setFatalError(errorMessage: string): Promise<void>;
26+
setProcessingState(state: SettableProcessingState, detailMessage: string): Promise<void>;
27+
}
28+
29+
// @public
30+
export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';
31+
2432
```

src/extensions/extensions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ export class Extensions {
3636

3737
/**
3838
* The runtime() method returns a new Runtime, which provides methods to modify an extension instance's runtime data.
39+
*
40+
* This method will throw an error if called outside an Extensions environment.
3941
*
40-
* @returns A new Runtime object.
42+
* @returns A new {@link Runtime} object.
4143
*/
4244
public runtime(): Runtime {
4345
return new Runtime(this.client);
@@ -47,7 +49,7 @@ export class Extensions {
4749
/**
4850
* Runtime provides methods to modify an extension instance's runtime data.
4951
*/
50-
class Runtime {
52+
export class Runtime {
5153
private projectId: string;
5254
private extensionInstanceId: string;
5355
private readonly client: ExtensionsApiClient;

src/extensions/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import { App, getApp } from '../app';
2525
import { FirebaseApp } from '../app/firebase-app';
2626
import { Extensions } from './extensions';
2727

28-
export { Extensions } from './extensions';
29-
28+
export { Extensions, Runtime } from './extensions';
29+
export { SettableProcessingState } from './extensions-api';
30+
3031
/**
3132
* Gets the {@link Extensions} service for the default app
3233
* or a given app.

0 commit comments

Comments
 (0)