import * as firestore from "firebase-admin/firestore"; import { Change } from "../../common/change"; import { ParamsOf } from "../../common/params"; import { CloudFunction, Event, EventContext } from "../cloud-functions"; import { DeploymentOptions } from "../function-configuration"; export type DocumentSnapshot = firestore.DocumentSnapshot; export type QueryDocumentSnapshot = firestore.QueryDocumentSnapshot; /** * Select the Firestore document to listen to for events. * @param path Full database path to listen to. This includes the name of * the collection that the document is a part of. For example, if the * collection is named "users" and the document is named "Ada", then the * path is "/users/Ada". */ export declare function document(path: Path): DocumentBuilder; export declare function namespace(namespace: string): NamespaceBuilder; export declare function database(database: string): DatabaseBuilder; export declare class DatabaseBuilder { private database; private options; constructor(database: string, options: DeploymentOptions); namespace(namespace: string): NamespaceBuilder; document(path: Path): DocumentBuilder; } export declare class NamespaceBuilder { private database; private options; private namespace?; constructor(database: string, options: DeploymentOptions, namespace?: string); document(path: Path): DocumentBuilder; } export declare function snapshotConstructor(event: Event): DocumentSnapshot; export declare function beforeSnapshotConstructor(event: Event): DocumentSnapshot; export declare class DocumentBuilder { private triggerResource; private options; constructor(triggerResource: () => string, options: DeploymentOptions); /** Respond to all document writes (creates, updates, or deletes). */ onWrite(handler: (change: Change, context: EventContext>) => PromiseLike | any): CloudFunction>; /** Respond only to document updates. */ onUpdate(handler: (change: Change, context: EventContext>) => PromiseLike | any): CloudFunction>; /** Respond only to document creations. */ onCreate(handler: (snapshot: QueryDocumentSnapshot, context: EventContext>) => PromiseLike | any): CloudFunction; /** Respond only to document deletions. */ onDelete(handler: (snapshot: QueryDocumentSnapshot, context: EventContext>) => PromiseLike | any): CloudFunction; private onOperation; }