diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index c2766e430..9ba761c15 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -12,6 +12,8 @@ toc: path: /docs/reference/functions/function_builder_.functionbuilder.html - title: 'Change' path: /docs/reference/functions/cloud_functions_.change.html + - title: 'ChangeJson' + path: /docs/reference/functions/cloud_functions_.changejson.html - title: 'functions.config' path: /docs/reference/functions/config_.html diff --git a/src/cloud-functions.ts b/src/cloud-functions.ts index b35ba6ee1..e8d099dca 100644 --- a/src/cloud-functions.ts +++ b/src/cloud-functions.ts @@ -143,15 +143,19 @@ export interface EventContext { } /** - * Change describes a change of state - "before" represents the state prior to - * the event, "after" represents the state after the event. + * The Functions interface for events that change state, such as + * Realtime Database or Cloud Firestore `onWrite` and `onUpdate`. + * + * For more information about the format used to construct `Change` objects, see + * [`cloud-functions.ChangeJson`](/docs/reference/functions/cloud_functions_.changejson). + * */ export class Change { constructor(public before: T, public after: T) {} } /** - * ChangeJson is the JSON format used to construct a Change object. + * `ChangeJson` is the JSON format used to construct a Change object. */ export interface ChangeJson { /** @@ -164,17 +168,20 @@ export interface ChangeJson { */ before?: any; /** - * Comma-separated string that represents names of field that changed. + * @hidden + * Comma-separated string that represents names of fields that changed. */ fieldMask?: string; } export namespace Change { + /** @hidden */ function reinterpretCast(x: any) { return x as T; } /** + * @hidden * Factory method for creating a Change from a `before` object and an `after` * object. */ @@ -183,6 +190,7 @@ export namespace Change { } /** + * @hidden * Factory method for creating a Change from a JSON and an optional customizer * function to be applied to both the `before` and the `after` fields. */