Skip to content

Commit a2e58e7

Browse files
authored
Adding code comments to remoteConfig.ts source (#524)
* Adding code comments to remoteConfig.ts source * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Update src/providers/remoteConfig.ts Co-Authored-By: Diana Tkachenko <31747099+thechenky@users.noreply.github.com> * Revised wording for TemplateVersion.rollBackSource * Adding only npm run format:fix, everything else is the same as my previous commit * Fixed some small typos found by Diana, 'if' and 'Config'
1 parent 36916b8 commit a2e58e7

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

src/providers/remoteConfig.ts

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ export const provider = 'google.firebase.remoteconfig';
3535
export const service = 'firebaseremoteconfig.googleapis.com';
3636

3737
/**
38-
* Handle all updates (including rollbacks) that affect a Remote Config project.
39-
* @param handler A function that takes the updated Remote Config template
40-
* version metadata as an argument.
38+
* Registers a function that triggers on Firebase Remote Config template
39+
* update events.
40+
*
41+
* @param handler A function that takes the updated Remote Config
42+
* template version metadata as an argument.
43+
*
44+
* @return A Cloud Function that you can export and deploy.
4145
*/
4246
export function onUpdate(
4347
handler: (
@@ -97,8 +101,8 @@ export class UpdateBuilder {
97101
}
98102

99103
/**
100-
* Interface representing a Remote Config template version metadata object that
101-
* was emitted when the project was updated.
104+
* An interface representing a Remote Config template version metadata object
105+
* emitted when a project is updated.
102106
*/
103107
export interface TemplateVersion {
104108
/** The version number of the updated Remote Config template. */
@@ -107,27 +111,49 @@ export interface TemplateVersion {
107111
/** When the template was updated in format (ISO8601 timestamp). */
108112
updateTime: string;
109113

110-
/** Metadata about the account that performed the update. */
114+
/**
115+
* Metadata about the account that performed the update, of
116+
* type [`RemoteConfigUser`](/docs/reference/remote-config/rest/v1/Version#remoteconfiguser).
117+
*/
111118
updateUser: RemoteConfigUser;
112119

113-
/** A description associated with the particular Remote Config template. */
120+
/** A description associated with this Remote Config template version. */
114121
description: string;
115122

116-
/** The origin of the caller. */
123+
/**
124+
* The origin of the caller - either the Firebase console or the Remote Config
125+
* REST API. See [`RemoteConfigUpdateOrigin`](/docs/reference/remote-config/rest/v1/Version#remoteconfigupdateorigin)
126+
* for valid values.
127+
*/
117128
updateOrigin: string;
118129

119-
/** The type of update action that was performed. */
130+
/**
131+
* The type of update action that was performed, whether forced,
132+
* incremental, or a rollback operation. See
133+
* [`RemoteConfigUpdateType`](/docs/reference/remote-config/rest/v1/Version#remoteconfigupdatetype)
134+
* for valid values.
135+
*/
120136
updateType: string;
121137

122138
/**
123-
* The version number of the Remote Config template that was rolled back to,
124-
* if the update was a rollback.
139+
* The version number of the Remote Config template that this update rolled back to.
140+
* Only applies if this update was a rollback.
125141
*/
126142
rollbackSource?: number;
127143
}
128144

145+
/**
146+
* An interface representing metadata for a Remote Config account
147+
* that performed the update. Contains the same fields as
148+
* [`RemoteConfigUser`](/docs/reference/remote-config/rest/v1/Version#remoteconfiguser).
149+
*/
129150
export interface RemoteConfigUser {
151+
/** Name of the Remote Config account that performed the update. */
130152
name?: string;
153+
154+
/** Email address of the Remote Config account that performed the update. */
131155
email: string;
156+
157+
/** Image URL of the Remote Config account that performed the update. */
132158
imageUrl?: string;
133159
}

0 commit comments

Comments
 (0)