Index

Properties

Private options

Private triggerResource

triggerResource: () => string

Type declaration

    • (): string
    • Returns string

Methods

onCreate

  • onCreate(handler: (snapshot: QueryDocumentSnapshot, context: EventContext) => PromiseLike<any> | any): CloudFunction<QueryDocumentSnapshot>
  • Respond only to document creations.

    Parameters

    • handler: (snapshot: QueryDocumentSnapshot, context: EventContext) => PromiseLike<any> | any
        • (snapshot: QueryDocumentSnapshot, context: EventContext): PromiseLike<any> | any
        • Parameters

          Returns PromiseLike<any> | any

    Returns CloudFunction<QueryDocumentSnapshot>

onDelete

  • onDelete(handler: (snapshot: QueryDocumentSnapshot, context: EventContext) => PromiseLike<any> | any): CloudFunction<QueryDocumentSnapshot>
  • Respond only to document deletions.

    Parameters

    • handler: (snapshot: QueryDocumentSnapshot, context: EventContext) => PromiseLike<any> | any
        • (snapshot: QueryDocumentSnapshot, context: EventContext): PromiseLike<any> | any
        • Parameters

          Returns PromiseLike<any> | any

    Returns CloudFunction<QueryDocumentSnapshot>

Private onOperation

  • onOperation<T>(handler: (data: T, context: EventContext) => PromiseLike<any> | any, eventType: string, dataConstructor: (raw: Event) => any): CloudFunction<T>
  • Type parameters

    • T

    Parameters

    • handler: (data: T, context: EventContext) => PromiseLike<any> | any
        • Parameters

          Returns PromiseLike<any> | any

    • eventType: string
    • dataConstructor: (raw: Event) => any
        • (raw: Event): any
        • Parameters

          • raw: Event

          Returns any

    Returns CloudFunction<T>

onUpdate

  • Respond only to document updates.

    Parameters

    • handler: (change: Change<QueryDocumentSnapshot>, context: EventContext) => PromiseLike<any> | any
        • Parameters

          Returns PromiseLike<any> | any

    Returns CloudFunction<Change<QueryDocumentSnapshot>>

onWrite

  • Respond to all document writes (creates, updates, or deletes).

    Parameters

    • handler: (change: Change<DocumentSnapshot>, context: EventContext) => PromiseLike<any> | any
        • Parameters

          Returns PromiseLike<any> | any

    Returns CloudFunction<Change<DocumentSnapshot>>