Skip to content

Extensions docstring tweaks #1980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion etc/firebase-admin.extensions.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>;
setProcessingState(state: SettableProcessingState, detailMessage: string): Promise<void>;
}

// @public
export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';

```
6 changes: 4 additions & 2 deletions src/extensions/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/extensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down