-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
71 lines (63 loc) · 1.78 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
interface RTDBInstance {
/**
* Gets the value of the database at key
* @param {string} key
* @return value
*/
GetAsync(key: string): unknown | void;
/**
* Set the value of the database at key
* @returns [success, responseInfo]
*/
SetAsync(
key: string,
value: unknown | void,
method?: string
): LuaTuple<[true, RequestAsyncResponse]> | LuaTuple<[false, void]>;
/**
* Deletes key in database
* @return [success, responseInfo]
*/
DeleteAsync(key: string): LuaTuple<[true, RequestAsyncResponse]> | LuaTuple<[false, void]>;
/**
* Increments the value at key by delta
* @returns [success, responseInfo]
*/
IncrementAsync(key: string, delta: number): LuaTuple<[true, RequestAsyncResponse]> | LuaTuple<[false, void]>;
/**
* Updates the value at key by the result of the callback
* @param {string} key
* @returns [success, responseInfo]
*/
UpdateAsync(
key: string,
callback: (old: unknown) => unknown,
snapshot?: unknown
): LuaTuple<[true, RequestAsyncResponse]> | LuaTuple<[false, void]>;
/**
* Updates multiple values at different keys by the result of the callback
* @return [success, responseInfo]
*/
BatchUpdateAsync(
baseKey: string,
keyValues: Map<string, unknown>,
callbacks: Map<string, (old: unknown) => unknown>,
snapshot?: unknown
): LuaTuple<[true, RequestAsyncResponse]> | LuaTuple<[false, void]>;
}
interface FireBase {
/*
* Gets the RTDB Firebase
* @return RTDBInstance
*/
GetFirebase(name: string, scope?: string): RTDBInstance;
}
interface FireBaseConstructor {
/*
* Gets the FireBase RTDB using the dbURL and auth token
* @return FireBase
*/
(dbUrl: string, authToken: string): FireBase;
}
declare const FireBase: FireBaseConstructor;
export = FireBase;