Skip to content

Commit 1653cfc

Browse files
committed
@throws clauses.
1 parent b43f513 commit 1653cfc

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

docs-devsite/app.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ export declare function initializeServerApp(config?: FirebaseServerAppSettings):
142142

143143
The initialized `FirebaseServerApp`<!-- -->.
144144

145+
#### Exceptions
146+
147+
If invoked in an unsupported non-server environment such as a browser.
148+
149+
If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
150+
151+
If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project configuration required for auto-initialization.
152+
145153
## function(libraryKeyOrName, ...)
146154

147155
### registerVersion(libraryKeyOrName, version, variant) {:#registerversion_f673248}
@@ -286,6 +294,12 @@ export declare function initializeApp(options: FirebaseOptions, name?: string):
286294

287295
The initialized app.
288296

297+
#### Exceptions
298+
299+
If the optional `name` parameter is malformed or empty.
300+
301+
If a `FirebaseApp` already exists with the same name but with a different configuration.
302+
289303
### Example 1
290304

291305

@@ -338,6 +352,12 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas
338352

339353
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
340354

355+
#### Exceptions
356+
357+
If [FirebaseAppSettings.name](./app.firebaseappsettings.md#firebaseappsettingsname) is defined but the value is malformed or empty.
358+
359+
If a `FirebaseApp` already exists with the same name but with a different configuration.
360+
341361
### initializeServerApp(options, config) {:#initializeserverapp_30ab697}
342362

343363
Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
@@ -365,6 +385,12 @@ export declare function initializeServerApp(options: FirebaseOptions | FirebaseA
365385

366386
The initialized `FirebaseServerApp`<!-- -->.
367387

388+
#### Exceptions
389+
390+
If invoked in an unsupported non-server environment such as a browser.
391+
392+
If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
393+
368394
### Example
369395

370396

packages/app/src/api.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export const SDK_VERSION = version;
106106
* is provided, the default is `"[DEFAULT]"`.
107107
*
108108
* @returns The initialized app.
109+
*
110+
* @throws If the optional `name` parameter is malformed or empty.
111+
*
112+
* @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
109113
*
110114
* @public
111115
*/
@@ -119,6 +123,9 @@ export function initializeApp(
119123
* @param options - Options to configure the app's services.
120124
* @param config - FirebaseApp Configuration
121125
*
126+
* @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
127+
*
128+
* @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
122129
* @public
123130
*/
124131
export function initializeApp(
@@ -224,7 +231,12 @@ export function initializeApp(
224231
* @param config - Optional `FirebaseServerApp` settings.
225232
*
226233
* @returns The initialized `FirebaseServerApp`.
227-
*
234+
*
235+
* @throws If invoked in an unsupported non-server environment such as a browser.
236+
*
237+
* @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
238+
* provide Finalization Registry support.
239+
*
228240
* @public
229241
*/
230242
export function initializeServerApp(
@@ -238,7 +250,13 @@ export function initializeServerApp(
238250
* @param config - Optional `FirebaseServerApp` settings.
239251
*
240252
* @returns The initialized `FirebaseServerApp`.
241-
*
253+
*
254+
* @throws If invoked in an unsupported non-server environment such as a browser.
255+
* @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
256+
* provide Finalization Registry support.
257+
* @throws If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project
258+
* configuration required for auto-initialization.
259+
*
242260
* @public
243261
*/
244262
export function initializeServerApp(

0 commit comments

Comments
 (0)