Skip to content
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

Extensions TSDoc edits #1982

Merged
merged 6 commits into from Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/extensions/extensions-api.ts
Expand Up @@ -16,14 +16,22 @@
*/

/**
* SettableProcessingState represents all the Processing states that can be set on an ExtensionInstance's runtimeData.
* SettableProcessingState represents all the Processing states that can be set
kevinthecheung marked this conversation as resolved.
Show resolved Hide resolved
* on an ExtensionInstance's runtimeData.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExtensionInstance should be 2 words?

kevinthecheung marked this conversation as resolved.
Show resolved Hide resolved
*
* @remarks
* - NONE: No relevant lifecycle event work has been done. Set this to clear out old statuses.
*
* - PROCESSING_COMPLETE: Lifecycle event work completed with no errors.
*
* - PROCESSING_WARNING: Lifecycle event work succeeded partially,
* or something happened that the user should be warned about.
*
* - PROCESSING_FAILED: Lifecycle event work failed completely,
kevinthecheung marked this conversation as resolved.
Show resolved Hide resolved
* but the instance will still work correctly going forward.
* - If the extension instance is in a broken state due to the errors, instead set FatalError.
*
* - If the extension instance is in a broken state due to errors, instead set FatalError.
kevinthecheung marked this conversation as resolved.
Show resolved Hide resolved
*
* - To report ongoing (non-final) status, use `console.log` or the Cloud Functions logger SDK.
*/
export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';
3 changes: 3 additions & 0 deletions src/extensions/extensions.ts
Expand Up @@ -37,6 +37,7 @@ export class Extensions {
/**
* The runtime() method returns a new Runtime, which provides methods to modify an extension instance's runtime data.
*
* @remarks
* This method will throw an error if called outside an Extensions environment.
*
* @returns A new {@link Runtime} object.
Expand Down Expand Up @@ -78,6 +79,7 @@ export class Runtime {
/**
* Sets the processing state of an extension instance.
*
* @remarks
* Use this method to report the results of a lifecycle event handler. If the
* lifecycle event failed & the extension instance will no longer work
* correctly, use `setFatalError` instead.
Expand All @@ -101,6 +103,7 @@ export class Runtime {
/**
* Reports a fatal error while running a lifecycle event handler.
*
* @remarks
* Call this method when a lifecycle event handler fails in a way that makes
* the Instance inoperable.
* If the lifecycle event failed but the instance will still work as expected,
Expand Down