forked from NativeScript/firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.ts
41 lines (33 loc) · 1.28 KB
/
common.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
import { FirebaseApp } from '@nativescript/firebase-core';
export type FunctionsErrorCode = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
export interface HttpsCallableOptions {
timeout?: number;
}
export type HttpsCallableResult = any;
export interface HttpsCallable {
(data?: any): Promise<HttpsCallableResult>;
}
export enum HttpsErrorCode {
OK = 'ok',
CANCELLED = 'cancelled',
UNKNOWN = 'unknown',
INVALID_ARGUMENT = 'invalid-argument',
DEADLINE_EXCEEDED = 'deadline-exceeded',
NOT_FOUND = 'not-found',
ALREADY_EXISTS = 'already-exists',
PERMISSION_DENIED = 'permission-denied',
UNAUTHENTICATED = 'unauthenticated',
RESOURCE_EXHAUSTED = 'resource-exhausted',
FAILED_PRECONDITION = 'failed-precondition',
ABORTED = 'aborted',
OUT_OF_RANGE = 'out-of-range',
UNIMPLEMENTED = 'unimplemented',
INTERNAL = 'internal',
UNAVAILABLE = 'unavailable',
DATA_LOSS = 'data-loss',
}
export interface IFunctions {
app: FirebaseApp;
httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable;
useEmulator(host: string, port: number);
}