Skip to content

Commit 433d28f

Browse files
committed
Update exp docgen script and add functions-exp docs
1 parent 4aa169b commit 433d28f

24 files changed

+184
-43
lines changed

common/api-review/app-types-exp.api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface FirebaseOptions {
5757
export interface _FirebaseService {
5858
// (undocumented)
5959
app: FirebaseApp;
60-
delete(): Promise<void>;
60+
delete(): Promise<void>;
6161
}
6262

6363
// @public (undocumented)
@@ -66,6 +66,14 @@ export interface PlatformLoggerService {
6666
getPlatformInfoString(): string;
6767
}
6868

69+
// @public (undocumented)
70+
export interface VersionService {
71+
// (undocumented)
72+
library: string;
73+
// (undocumented)
74+
version: string;
75+
}
76+
6977

7078
// (No @packageDocumentation comment for this package)
7179

docs-exp/app-types.firebaseapp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface FirebaseApp
1818

1919
| Property | Type | Description |
2020
| --- | --- | --- |
21-
| [automaticDataCollectionEnabled](./app-types.firebaseapp.automaticdatacollectionenabled.md) | <code>boolean</code> | The settable config flag for GDPR opt-in/opt-out |
22-
| [name](./app-types.firebaseapp.name.md) | <code>string</code> | The (read-only) name for this app.<!-- -->The default app's name is <code>&quot;[DEFAULT]&quot;</code>. |
23-
| [options](./app-types.firebaseapp.options.md) | <code>FirebaseOptions</code> | The (read-only) configuration options for this app. These are the original parameters given in [initializeApp()](./app.initializeapp.md)<!-- -->. |
21+
| [automaticDataCollectionEnabled](./app-types.firebaseapp.automaticdatacollectionenabled.md) | boolean | The settable config flag for GDPR opt-in/opt-out |
22+
| [name](./app-types.firebaseapp.name.md) | string | The (read-only) name for this app.<!-- -->The default app's name is <code>&quot;[DEFAULT]&quot;</code>. |
23+
| [options](./app-types.firebaseapp.options.md) | [FirebaseOptions](./app-types.firebaseoptions.md) | The (read-only) configuration options for this app. These are the original parameters given in [initializeApp()](./app.initializeapp.md)<!-- -->. |
2424

docs-exp/app-types.firebaseappconfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export interface FirebaseAppConfig
1515

1616
| Property | Type | Description |
1717
| --- | --- | --- |
18-
| [automaticDataCollectionEnabled](./app-types.firebaseappconfig.automaticdatacollectionenabled.md) | <code>boolean</code> | |
19-
| [name](./app-types.firebaseappconfig.name.md) | <code>string</code> | |
18+
| [automaticDataCollectionEnabled](./app-types.firebaseappconfig.automaticdatacollectionenabled.md) | boolean | |
19+
| [name](./app-types.firebaseappconfig.name.md) | string | |
2020

docs-exp/app-types.firebaseoptions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export interface FirebaseOptions
1515

1616
| Property | Type | Description |
1717
| --- | --- | --- |
18-
| [apiKey](./app-types.firebaseoptions.apikey.md) | <code>string</code> | |
19-
| [appId](./app-types.firebaseoptions.appid.md) | <code>string</code> | |
20-
| [authDomain](./app-types.firebaseoptions.authdomain.md) | <code>string</code> | |
21-
| [databaseURL](./app-types.firebaseoptions.databaseurl.md) | <code>string</code> | |
22-
| [measurementId](./app-types.firebaseoptions.measurementid.md) | <code>string</code> | |
23-
| [messagingSenderId](./app-types.firebaseoptions.messagingsenderid.md) | <code>string</code> | |
24-
| [projectId](./app-types.firebaseoptions.projectid.md) | <code>string</code> | |
25-
| [storageBucket](./app-types.firebaseoptions.storagebucket.md) | <code>string</code> | |
18+
| [apiKey](./app-types.firebaseoptions.apikey.md) | string | |
19+
| [appId](./app-types.firebaseoptions.appid.md) | string | |
20+
| [authDomain](./app-types.firebaseoptions.authdomain.md) | string | |
21+
| [databaseURL](./app-types.firebaseoptions.databaseurl.md) | string | |
22+
| [measurementId](./app-types.firebaseoptions.measurementid.md) | string | |
23+
| [messagingSenderId](./app-types.firebaseoptions.messagingsenderid.md) | string | |
24+
| [projectId](./app-types.firebaseoptions.projectid.md) | string | |
25+
| [storageBucket](./app-types.firebaseoptions.storagebucket.md) | string | |
2626

docs-exp/app-types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| [FirebaseAppConfig](./app-types.firebaseappconfig.md) | |
1313
| [FirebaseOptions](./app-types.firebaseoptions.md) | |
1414
| [PlatformLoggerService](./app-types.platformloggerservice.md) | |
15+
| [VersionService](./app-types.versionservice.md) | |
1516

docs-exp/app-types.platformloggerservice.getplatforminfostring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ getPlatformInfoString(): string;
1111
```
1212
<b>Returns:</b>
1313

14-
`string`
14+
string
1515

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/app-types](./app-types.md) &gt; [VersionService](./app-types.versionservice.md) &gt; [library](./app-types.versionservice.library.md)
4+
5+
## VersionService.library property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
library: string;
11+
```

docs-exp/app-types.versionservice.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/app-types](./app-types.md) &gt; [VersionService](./app-types.versionservice.md)
4+
5+
## VersionService interface
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface VersionService
11+
```
12+
13+
## Properties
14+
15+
| Property | Type | Description |
16+
| --- | --- | --- |
17+
| [library](./app-types.versionservice.library.md) | string | |
18+
| [version](./app-types.versionservice.version.md) | string | |
19+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/app-types](./app-types.md) &gt; [VersionService](./app-types.versionservice.md) &gt; [version](./app-types.versionservice.version.md)
4+
5+
## VersionService.version property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
version: string;
11+
```

docs-exp/app.deleteapp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export declare function deleteApp(app: FirebaseApp): Promise<void>;
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| app | <code>FirebaseApp</code> | |
19+
| app | [FirebaseApp](./app-types.firebaseapp.md) | |
2020

2121
<b>Returns:</b>
2222

23-
`Promise<void>`
23+
Promise&lt;void&gt;
2424

2525
## Example
2626

docs-exp/app.getapp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export declare function getApp(name?: string): FirebaseApp;
2020

2121
| Parameter | Type | Description |
2222
| --- | --- | --- |
23-
| name | <code>string</code> | Optional name of the app to return. If no name is provided, the default is <code>&quot;[DEFAULT]&quot;</code>. |
23+
| name | string | Optional name of the app to return. If no name is provided, the default is <code>&quot;[DEFAULT]&quot;</code>. |
2424

2525
<b>Returns:</b>
2626

27-
`FirebaseApp`
27+
[FirebaseApp](./app-types.firebaseapp.md)
2828

2929
The app corresponding to the provided app name. If no app name is provided, the default app is returned.
3030

docs-exp/app.getapps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export declare function getApps(): FirebaseApp[];
1313
```
1414
<b>Returns:</b>
1515

16-
`FirebaseApp[]`
16+
[FirebaseApp](./app-types.firebaseapp.md)<!-- -->\[\]
1717

docs-exp/app.initializeapp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export declare function initializeApp(options: FirebaseOptions, name?: string):
1818

1919
| Parameter | Type | Description |
2020
| --- | --- | --- |
21-
| options | <code>FirebaseOptions</code> | Options to configure the app's services. |
22-
| name | <code>string</code> | Optional name of the app to initialize. If no name is provided, the default is <code>&quot;[DEFAULT]&quot;</code>. |
21+
| options | [FirebaseOptions](./app-types.firebaseoptions.md) | Options to configure the app's services. |
22+
| name | string | Optional name of the app to initialize. If no name is provided, the default is <code>&quot;[DEFAULT]&quot;</code>. |
2323

2424
<b>Returns:</b>
2525

26-
`FirebaseApp`
26+
[FirebaseApp](./app-types.firebaseapp.md)
2727

2828
The initialized app.
2929

docs-exp/app.initializeapp_1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| options | <code>FirebaseOptions</code> | Options to configure the app's services. |
20-
| config | <code>FirebaseAppConfig</code> | FirebaseApp Configuration |
19+
| options | [FirebaseOptions](./app-types.firebaseoptions.md) | Options to configure the app's services. |
20+
| config | [FirebaseAppConfig](./app-types.firebaseappconfig.md) | FirebaseApp Configuration |
2121

2222
<b>Returns:</b>
2323

24-
`FirebaseApp`
24+
[FirebaseApp](./app-types.firebaseapp.md)
2525

docs-exp/app.onlog.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export declare function onLog(logCallback: LogCallback | null, options?: LogOpti
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| logCallback | <code>LogCallback &#124; null</code> | An optional custom log handler that executes user code whenever the Firebase SDK makes a logging call. |
20-
| options | <code>LogOptions</code> | |
19+
| logCallback | LogCallback \| null | An optional custom log handler that executes user code whenever the Firebase SDK makes a logging call. |
20+
| options | LogOptions | |
2121

2222
<b>Returns:</b>
2323

24-
`void`
24+
void
2525

docs-exp/app.registerversion.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export declare function registerVersion(libraryKeyOrName: string, version: strin
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| libraryKeyOrName | <code>string</code> | |
20-
| version | <code>string</code> | Current version of that library. |
21-
| variant | <code>string</code> | Bundle variant, e.g., node, rn, etc. |
19+
| libraryKeyOrName | string | |
20+
| version | string | Current version of that library. |
21+
| variant | string | Bundle variant, e.g., node, rn, etc. |
2222

2323
<b>Returns:</b>
2424

25-
`void`
25+
void
2626

docs-exp/app.setloglevel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export declare function setLogLevel(logLevel: LogLevel): void;
1818

1919
| Parameter | Type | Description |
2020
| --- | --- | --- |
21-
| logLevel | <code>LogLevel</code> | |
21+
| logLevel | LogLevel | |
2222

2323
<b>Returns:</b>
2424

25-
`void`
25+
void
2626

docs-exp/functions.getfunctions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions](./functions.md) &gt; [getFunctions](./functions.getfunctions.md)
4+
5+
## getFunctions() function
6+
7+
Returns a Functions instance for the given app.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export declare function getFunctions(app: FirebaseApp, region?: string): Functions;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| app | [FirebaseApp](./app-types.firebaseapp.md) | The FirebaseApp to use. |
20+
| region | string | The region the callable functions are located in. |
21+
22+
<b>Returns:</b>
23+
24+
Functions
25+

docs-exp/functions.httpscallable.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions](./functions.md) &gt; [httpsCallable](./functions.httpscallable.md)
4+
5+
## httpsCallable() function
6+
7+
Returns a reference to the callable https trigger with the given name.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export declare function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| functionsInstance | Functions | |
20+
| name | string | The name of the trigger. |
21+
| options | HttpsCallableOptions | |
22+
23+
<b>Returns:</b>
24+
25+
HttpsCallable
26+

docs-exp/functions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions](./functions.md)
4+
5+
## functions package
6+
7+
## Functions
8+
9+
| Function | Description |
10+
| --- | --- |
11+
| [getFunctions(app, region)](./functions.getfunctions.md) | Returns a Functions instance for the given app. |
12+
| [httpsCallable(functionsInstance, name, options)](./functions.httpscallable.md) | Returns a reference to the callable https trigger with the given name. |
13+
| [useFunctionsEmulator(functionsInstance, origin)](./functions.usefunctionsemulator.md) | Changes this instance to point to a Cloud Functions emulator running locally. See https://firebase.google.com/docs/functions/local-emulator |
14+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions](./functions.md) &gt; [useFunctionsEmulator](./functions.usefunctionsemulator.md)
4+
5+
## useFunctionsEmulator() function
6+
7+
Changes this instance to point to a Cloud Functions emulator running locally. See https://firebase.google.com/docs/functions/local-emulator
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export declare function useFunctionsEmulator(functionsInstance: Functions, origin: string): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| functionsInstance | Functions | |
20+
| origin | string | The origin of the local emulator, such as "http://localhost:5005". |
21+
22+
<b>Returns:</b>
23+
24+
void
25+

docs-exp/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
| --- | --- |
1111
| [@firebase/app](./app.md) | Firebase App |
1212
| [@firebase/app-types](./app-types.md) | |
13+
| [@firebase/functions](./functions.md) | |
1314

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"lint": "lerna run --scope @firebase/* --scope rxfire lint",
4949
"size-report": "node scripts/report_binary_size.js",
5050
"api-report": "lerna run --scope @firebase/*-exp api-report",
51-
"docgen:exp": "node scripts/exp/docgen.js",
51+
"docgen:exp": "ts-node-script scripts/exp/docgen.ts",
5252
"postinstall": "yarn --cwd repo-scripts/changelog-generator build"
5353
},
5454
"repository": {

scripts/exp/docgen.js renamed to scripts/exp/docgen.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
const { spawn } = require('child-process-promise');
19-
const { mapWorkspaceToPackages } = require('../release/utils/workspace');
20-
const { projectRoot } = require('../utils');
21-
const { removeExpSuffix } = require('./remove-exp');
22-
const fs = require('fs');
23-
const glob = require('glob');
18+
import { spawn } from 'child-process-promise';
19+
import { mapWorkspaceToPackages } from '../release/utils/workspace';
20+
import { projectRoot } from '../utils';
21+
import { removeExpSuffix } from './remove-exp';
22+
import fs from 'fs';
23+
import glob from 'glob';
2424

2525
const tmpDir = `${projectRoot}/temp`;
2626
// create *.api.json files
@@ -49,7 +49,7 @@ async function generateDocs() {
4949
.filter(path => fs.existsSync(path));
5050

5151
for (const dir of apiJsonDirectories) {
52-
const paths = await new Promise(resolve =>
52+
const paths = await new Promise<string[]>(resolve =>
5353
glob(`${dir}/*.api.json`, (err, paths) => {
5454
if (err) throw err;
5555
resolve(paths);

0 commit comments

Comments
 (0)