|
20 | 20 | * import data into the Realtime Database or Cloud Firestore emulator without triggering locally
|
21 | 21 | * emulated Cloud Functions.
|
22 | 22 | *
|
23 |
| - * This method only works with Firebase CLI version 8.13.0 or higher. |
| 23 | + * This method only works with Firebase CLI version 8.13.0 or higher. This overload works only if |
| 24 | + * the Emulator hub host:port is specified by the environment variable FIREBASE_EMULATOR_HUB. |
24 | 25 | *
|
25 |
| - * @param fn an function which returns a promise. |
| 26 | + * @param fn an function which may be sync or async (returns a promise) |
26 | 27 | * @public
|
27 | 28 | */
|
28 | 29 | export async function withFunctionTriggersDisabled<TResult>(
|
29 | 30 | fn: () => TResult | Promise<TResult>
|
| 31 | +): Promise<TResult>; |
| 32 | + |
| 33 | +/** |
| 34 | + * Run a setup function with background Cloud Functions triggers disabled. This can be used to |
| 35 | + * import data into the Realtime Database or Cloud Firestore emulator without triggering locally |
| 36 | + * emulated Cloud Functions. |
| 37 | + * |
| 38 | + * This method only works with Firebase CLI version 8.13.0 or higher. The Emulator hub must be |
| 39 | + * running, which host and port are specified in this overload. |
| 40 | + * |
| 41 | + * @param fn an function which may be sync or async (returns a promise) |
| 42 | + * @param hub the host and port of the Emulator Hub (ex: `{host: 'localhost', port: 4400}`) |
| 43 | + * @public |
| 44 | + */ export async function withFunctionTriggersDisabled<TResult>( |
| 45 | + hub: { host: string; port: number }, |
| 46 | + fn: () => TResult | Promise<TResult> |
| 47 | +): Promise<TResult>; |
| 48 | + |
| 49 | +export async function withFunctionTriggersDisabled<TResult>( |
| 50 | + fnOrHub: { host: string; port: number } | (() => TResult | Promise<TResult>), |
| 51 | + maybeFn?: () => TResult | Promise<TResult> |
30 | 52 | ): Promise<TResult> {
|
31 | 53 | throw new Error('unimplemented');
|
32 | 54 | }
|
|
0 commit comments