-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
type-test.ts
43 lines (31 loc) · 1.19 KB
/
type-test.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
import firebase, { FirebaseFunctionsTypes } from '.';
console.log(firebase().app);
// checks module exists at root
console.log(firebase.functions().app.name);
// checks module exists at app level
console.log(firebase.app().functions().app.name);
// app level module accepts string arg
console.log(firebase.app().functions('some-string').app.name);
console.log(firebase.app().functions('some-string').httpsCallable('foo'));
// checks statics exist
console.log(firebase.functions.SDK_VERSION);
// checks statics exist on defaultExport
console.log(firebase.firebase.SDK_VERSION);
// checks root exists
console.log(firebase.SDK_VERSION);
// checks multi-app support exists
console.log(firebase.functions(firebase.app()).app.name);
// checks default export supports app arg
console.log(firebase.functions(firebase.app('foo')).app.name);
console.log(firebase.functions.HttpsErrorCode.ABORTED);
firebase
.functions()
.httpsCallable('foo')(123)
.then((result: FirebaseFunctionsTypes.HttpsCallableResult) => {
console.log(result.data);
})
.catch((error: { code: any; details: any }) => {
console.log(error.code);
console.log(error.details);
});
firebase.functions().useFunctionsEmulator('123');