1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import { FirebaseApp, _FirebaseService } from '@firebase/app';
|
18 | import { HttpsCallable, HttpsCallableOptions } from './public-types';
|
19 | import { ContextProvider } from './context';
|
20 | import { Provider } from '@firebase/component';
|
21 | import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
|
22 | import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
|
23 | import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
|
24 | export declare const DEFAULT_REGION = "us-central1";
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export interface HttpResponseBody {
|
31 | data?: unknown;
|
32 | result?: unknown;
|
33 | error?: {
|
34 | message?: unknown;
|
35 | status?: unknown;
|
36 | details?: unknown;
|
37 | };
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare class FunctionsService implements _FirebaseService {
|
44 | readonly app: FirebaseApp;
|
45 | readonly fetchImpl: typeof fetch;
|
46 | readonly contextProvider: ContextProvider;
|
47 | emulatorOrigin: string | null;
|
48 | cancelAllRequests: Promise<void>;
|
49 | deleteService: () => Promise<void>;
|
50 | region: string;
|
51 | customDomain: string | null;
|
52 | |
53 |
|
54 |
|
55 |
|
56 | constructor(app: FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>, messagingProvider: Provider<MessagingInternalComponentName>, appCheckProvider: Provider<AppCheckInternalComponentName>, regionOrCustomDomain: string | undefined, fetchImpl: typeof fetch);
|
57 | _delete(): Promise<void>;
|
58 | /**
|
59 | * Returns the URL for a callable with the given name.
|
60 | * @param name - The name of the callable.
|
61 | * @internal
|
62 | */
|
63 | _url(name: string): string;
|
64 | }
|
65 | /**
|
66 | * Modify this instance to communicate with the Cloud Functions emulator.
|
67 | *
|
68 | * Note: this must be called before this instance has been used to do any operations.
|
69 | *
|
70 | * @param host The emulator host (ex: localhost)
|
71 | * @param port The emulator port (ex: 5001)
|
72 | * @public
|
73 | */
|
74 | export declare function connectFunctionsEmulator(functionsInstance: FunctionsService, host: string, port: number): void;
|
75 | /**
|
76 | * Returns a reference to the callable https trigger with the given name.
|
77 | * @param name - The name of the trigger.
|
78 | * @public
|
79 | */
|
80 | export declare function httpsCallable<RequestData, ResponseData>(functionsInstance: FunctionsService, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
|
81 | /**
|
82 | * Returns a reference to the callable https trigger with the given url.
|
83 | * @param url - The url of the trigger.
|
84 | * @public
|
85 | */
|
86 | export declare function httpsCallableFromURL<RequestData, ResponseData>(functionsInstance: FunctionsService, url: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
|