Skip to content

Commit 62fdf5f

Browse files
Extensions TSDoc edits (#1982)
1 parent 38fb85f commit 62fdf5f

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

src/extensions/extensions-api.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,29 @@
1616
*/
1717

1818
/**
19-
* SettableProcessingState represents all the Processing states that can be set on an ExtensionInstance's runtimeData.
19+
* `SettableProcessingState` represents all the processing states that can be set
20+
* on an Extension instance's runtime data.
2021
*
21-
* - NONE: No relevant lifecycle event work has been done. Set this to clear out old statuses.
22-
* - PROCESSING_COMPLETE: Lifecycle event work completed with no errors.
23-
* - PROCESSING_WARNING: Lifecycle event work succeeded partially,
24-
* or something happened that the user should be warned about.
25-
* - PROCESSING_FAILED: Lifecycle event work failed completely,
26-
* but the instance will still work correctly going forward.
27-
* - If the extension instance is in a broken state due to the errors, instead set FatalError.
22+
* @remarks
23+
* You can set the following states:
24+
*
25+
* - `NONE`: No relevant lifecycle event work has been done.
26+
* Set this to clear out old statuses.
27+
*
28+
* - `PROCESSING_COMPLETE`: Lifecycle event work completed with no errors.
29+
*
30+
* - `PROCESSING_WARNING`: Lifecycle event work succeeded partially, or
31+
* something happened that the user should be warned about.
32+
*
33+
* - `PROCESSING_FAILED`: Lifecycle event work failed completely, but the
34+
* instance will still work correctly going forward.
35+
*
36+
* If the extension instance is in a broken state due to errors, instead call
37+
* {@link Runtime.setFatalError}.
38+
*
39+
* The "processing" state gets set automatically when a lifecycle event handler
40+
* starts; you can't set it explicitly.
41+
* To report the ongoing status of an extension's function, use `console.log`
42+
* or the Cloud Functions logger SDK.
2843
*/
2944
export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';

src/extensions/extensions.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class Extensions {
3737
/**
3838
* The runtime() method returns a new Runtime, which provides methods to modify an extension instance's runtime data.
3939
*
40+
* @remarks
4041
* This method will throw an error if called outside an Extensions environment.
4142
*
4243
* @returns A new {@link Runtime} object.
@@ -78,9 +79,14 @@ export class Runtime {
7879
/**
7980
* Sets the processing state of an extension instance.
8081
*
81-
* Use this method to report the results of a lifecycle event handler. If the
82-
* lifecycle event failed & the extension instance will no longer work
83-
* correctly, use `setFatalError` instead.
82+
* @remarks
83+
* Use this method to report the results of a lifecycle event handler.
84+
*
85+
* If the lifecycle event failed & the extension instance will no longer work
86+
* correctly, use {@link Runtime.setFatalError} instead.
87+
*
88+
* To report the status of function calls other than lifecycle event handlers,
89+
* use `console.log` or the Cloud Functions logger SDK.
8490
*
8591
* @param state - The state to set the instance to.
8692
* @param detailMessage - A message explaining the results of the lifecycle function.
@@ -101,6 +107,7 @@ export class Runtime {
101107
/**
102108
* Reports a fatal error while running a lifecycle event handler.
103109
*
110+
* @remarks
104111
* Call this method when a lifecycle event handler fails in a way that makes
105112
* the Instance inoperable.
106113
* If the lifecycle event failed but the instance will still work as expected,

0 commit comments

Comments
 (0)