1 | import { Change } from "../../common/change";
|
2 | import { ParamsOf } from "../../common/params";
|
3 | import { DataSnapshot } from "../../common/providers/database";
|
4 | import { CloudFunction, EventContext } from "../cloud-functions";
|
5 | import { DeploymentOptions } from "../function-configuration";
|
6 | export { DataSnapshot };
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare function instance(instance: string): InstanceBuilder;
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare function ref<Ref extends string>(path: Ref): RefBuilder<Ref>;
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | export declare class InstanceBuilder {
|
62 | private instance;
|
63 | private options;
|
64 | constructor(instance: string, options: DeploymentOptions);
|
65 | /**
|
66 | * @returns Firebase Realtime Database reference builder interface.
|
67 | */
|
68 | ref<Ref extends string>(path: Ref): RefBuilder<Ref>;
|
69 | }
|
70 | /**
|
71 | * The Firebase Realtime Database reference builder interface.
|
72 | *
|
73 | * Access via [`functions.database.ref()`](functions.database#.ref).
|
74 | */
|
75 | export declare class RefBuilder<Ref extends string> {
|
76 | private triggerResource;
|
77 | private options;
|
78 | constructor(triggerResource: () => string, options: DeploymentOptions);
|
79 | /**
|
80 | * Event handler that fires every time a Firebase Realtime Database write
|
81 | * of any kind (creation, update, or delete) occurs.
|
82 | *
|
83 | * @param handler Event handler that runs every time a Firebase Realtime Database
|
84 | * write occurs.
|
85 | * @returns A function that you can export and deploy.
|
86 | */
|
87 | onWrite(handler: (change: Change<DataSnapshot>, context: EventContext<ParamsOf<Ref>>) => PromiseLike<any> | any): CloudFunction<Change<DataSnapshot>>;
|
88 | /**
|
89 | * Event handler that fires every time data is updated in
|
90 | * Firebase Realtime Database.
|
91 | *
|
92 | * @param handler Event handler which is run every time a Firebase Realtime Database
|
93 | * write occurs.
|
94 | * @returns A function which you can export and deploy.
|
95 | */
|
96 | onUpdate(handler: (change: Change<DataSnapshot>, context: EventContext<ParamsOf<Ref>>) => PromiseLike<any> | any): CloudFunction<Change<DataSnapshot>>;
|
97 | /**
|
98 | * Event handler that fires every time new data is created in
|
99 | * Firebase Realtime Database.
|
100 | *
|
101 | * @param handler Event handler that runs every time new data is created in
|
102 | * Firebase Realtime Database.
|
103 | * @returns A function that you can export and deploy.
|
104 | */
|
105 | onCreate(handler: (snapshot: DataSnapshot, context: EventContext<ParamsOf<Ref>>) => PromiseLike<any> | any): CloudFunction<DataSnapshot>;
|
106 | /**
|
107 | * Event handler that fires every time data is deleted from
|
108 | * Firebase Realtime Database.
|
109 | *
|
110 | * @param handler Event handler that runs every time data is deleted from
|
111 | * Firebase Realtime Database.
|
112 | * @returns A function that you can export and deploy.
|
113 | */
|
114 | onDelete(handler: (snapshot: DataSnapshot, context: EventContext<ParamsOf<Ref>>) => PromiseLike<any> | any): CloudFunction<DataSnapshot>;
|
115 | private onOperation;
|
116 | private changeConstructor;
|
117 | }
|