Skip to content

Commit f7df0c7

Browse files
authored
Adding comments to try and populate information for Change and ChangeJson (#525)
* Adding comments to try and populate information for Change and ChangeJson. * Remembered to run npm run format:fix!
1 parent 87e75d7 commit f7df0c7

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

docgen/content-sources/toc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ toc:
1212
path: /docs/reference/functions/function_builder_.functionbuilder.html
1313
- title: 'Change'
1414
path: /docs/reference/functions/cloud_functions_.change.html
15+
- title: 'ChangeJson'
16+
path: /docs/reference/functions/cloud_functions_.changejson.html
1517

1618
- title: 'functions.config'
1719
path: /docs/reference/functions/config_.html

src/cloud-functions.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,19 @@ export interface EventContext {
143143
}
144144

145145
/**
146-
* Change describes a change of state - "before" represents the state prior to
147-
* the event, "after" represents the state after the event.
146+
* The Functions interface for events that change state, such as
147+
* Realtime Database or Cloud Firestore `onWrite` and `onUpdate`.
148+
*
149+
* For more information about the format used to construct `Change` objects, see
150+
* [`cloud-functions.ChangeJson`](/docs/reference/functions/cloud_functions_.changejson).
151+
*
148152
*/
149153
export class Change<T> {
150154
constructor(public before: T, public after: T) {}
151155
}
152156

153157
/**
154-
* ChangeJson is the JSON format used to construct a Change object.
158+
* `ChangeJson` is the JSON format used to construct a Change object.
155159
*/
156160
export interface ChangeJson {
157161
/**
@@ -164,17 +168,20 @@ export interface ChangeJson {
164168
*/
165169
before?: any;
166170
/**
167-
* Comma-separated string that represents names of field that changed.
171+
* @hidden
172+
* Comma-separated string that represents names of fields that changed.
168173
*/
169174
fieldMask?: string;
170175
}
171176

172177
export namespace Change {
178+
/** @hidden */
173179
function reinterpretCast<T>(x: any) {
174180
return x as T;
175181
}
176182

177183
/**
184+
* @hidden
178185
* Factory method for creating a Change from a `before` object and an `after`
179186
* object.
180187
*/
@@ -183,6 +190,7 @@ export namespace Change {
183190
}
184191

185192
/**
193+
* @hidden
186194
* Factory method for creating a Change from a JSON and an optional customizer
187195
* function to be applied to both the `before` and the `after` fields.
188196
*/

0 commit comments

Comments
 (0)