Skip to content

Commit 0ebb759

Browse files
authored
fix: Updated API docs of remaining modules (#1172)
* fix: Updated API docs for fcm and project management APIs * fix: Updated docs for Storage and RTDB modules * fix: Updated docs for ML, RC and rules
1 parent 93a7699 commit 0ebb759

21 files changed

+399
-108
lines changed

etc/firebase-admin.database.api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ export namespace database {
4949

5050
export { DataSnapshot }
5151

52-
// @public (undocumented)
52+
// @public
5353
export const enableLogging: typeof rtdb.enableLogging;
5454

5555
export { EventType }
5656

57-
// @public (undocumented)
57+
// @public
5858
export function getDatabase(app?: App): Database;
5959

60-
// @public (undocumented)
60+
// @public
6161
export function getDatabaseWithUrl(url: string, app?: App): Database;
6262

6363
export { OnDisconnect }
@@ -66,7 +66,7 @@ export { Query }
6666

6767
export { Reference }
6868

69-
// @public (undocumented)
69+
// @public
7070
export const ServerValue: rtdb.ServerValue;
7171

7272
export { ThenableReference }

etc/firebase-admin.machine-learning.api.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface GcsTfliteModelOptions extends ModelOptionsBase {
2424

2525
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
2626
//
27-
// @public (undocumented)
27+
// @public
2828
export function getMachineLearning(app?: App): MachineLearning;
2929

3030
// @public
@@ -79,30 +79,19 @@ export namespace machineLearning {
7979

8080
// @public
8181
export class Model {
82-
// (undocumented)
8382
get createTime(): string;
84-
// (undocumented)
8583
get displayName(): string;
86-
// (undocumented)
8784
get etag(): string;
8885
get locked(): boolean;
89-
// (undocumented)
9086
get modelHash(): string | undefined;
91-
// (undocumented)
9287
get modelId(): string;
93-
// (undocumented)
9488
get published(): boolean;
95-
// (undocumented)
9689
get tags(): string[];
97-
// (undocumented)
9890
get tfliteModel(): TFLiteModel | undefined;
99-
// (undocumented)
10091
toJSON(): {
10192
[key: string]: any;
10293
};
103-
// (undocumented)
10494
get updateTime(): string;
105-
// (undocumented)
10695
get validationError(): string | undefined;
10796
waitForUnlocked(maxTimeMillis?: number): Promise<void>;
10897
}

etc/firebase-admin.messaging.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export interface FcmOptions {
165165

166166
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
167167
//
168-
// @public (undocumented)
168+
// @public
169169
export function getMessaging(app?: App): Messaging;
170170

171171
// @public

etc/firebase-admin.project-management.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { Agent } from 'http';
88

9-
// @public (undocumented)
9+
// @public
1010
export class AndroidApp {
1111
addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;
1212
// (undocumented)
@@ -43,10 +43,10 @@ export enum AppPlatform {
4343

4444
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
4545
//
46-
// @public (undocumented)
46+
// @public
4747
export function getProjectManagement(app?: App): ProjectManagement;
4848

49-
// @public (undocumented)
49+
// @public
5050
export class IosApp {
5151
// (undocumented)
5252
readonly appId: string;

etc/firebase-admin.remote-config.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface ExplicitParameterValue {
1313

1414
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
1515
//
16-
// @public (undocumented)
16+
// @public
1717
export function getRemoteConfig(app?: App): RemoteConfig;
1818

1919
// @public

etc/firebase-admin.security-rules.api.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import { Agent } from 'http';
88

99
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
1010
//
11-
// @public (undocumented)
11+
// @public
1212
export function getSecurityRules(app?: App): SecurityRules;
1313

1414
// @public
15-
export class Ruleset {
16-
// (undocumented)
15+
export class Ruleset implements RulesetMetadata {
1716
readonly createTime: string;
18-
// (undocumented)
1917
readonly name: string;
2018
// (undocumented)
2119
readonly source: RulesFile[];
@@ -27,11 +25,9 @@ export interface RulesetMetadata {
2725
readonly name: string;
2826
}
2927

30-
// @public (undocumented)
28+
// @public
3129
export class RulesetMetadataList {
32-
// (undocumented)
3330
readonly nextPageToken?: string;
34-
// (undocumented)
3531
readonly rulesets: RulesetMetadata[];
3632
}
3733

etc/firebase-admin.storage.api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import { Bucket } from '@google-cloud/storage';
99

1010
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts
1111
//
12-
// @public (undocumented)
12+
// @public
1313
export function getStorage(app?: App): Storage;
1414

1515
// @public
1616
export class Storage {
1717
get app(): App;
18-
// (undocumented)
1918
bucket(name?: string): Bucket;
2019
}
2120

src/database/index.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,78 @@ export {
3535
ThenableReference,
3636
} from '@firebase/database-types';
3737

38+
/**
39+
* [`enableLogging`](https://firebase.google.com/docs/reference/js/firebase.database#enablelogging)
40+
* function from the `@firebase/database` package.
41+
*/
3842
export const enableLogging: typeof rtdb.enableLogging = enableLoggingFunc;
43+
44+
/**
45+
* [`ServerValue`](https://firebase.google.com/docs/reference/js/firebase.database.ServerValue)
46+
* module from the `@firebase/database` package.
47+
*/
3948
export const ServerValue: rtdb.ServerValue = serverValueConst;
4049

50+
/**
51+
* Gets the {@link database.Database `Database`} service for the default
52+
* app or a given app.
53+
*
54+
* `getDatabase()` can be called with no arguments to access the default
55+
* app's {@link database.Database `Database`} service or as
56+
* `getDatabase(app)` to access the
57+
* {@link database.Database `Database`} service associated with a specific
58+
* app.
59+
*
60+
* @example
61+
* ```javascript
62+
* // Get the Database service for the default app
63+
* const defaultDatabase = getDatabase();
64+
* ```
65+
*
66+
* @example
67+
* ```javascript
68+
* // Get the Database service for a specific app
69+
* const otherDatabase = getDatabase(app);
70+
* ```
71+
*
72+
* @param App whose `Database` service to
73+
* return. If not provided, the default `Database` service will be returned.
74+
*
75+
* @return The default `Database` service if no app
76+
* is provided or the `Database` service associated with the provided app.
77+
*/
4178
export function getDatabase(app?: App): Database {
4279
return getDatabaseInstance({ app });
4380
}
4481

82+
/**
83+
* Gets the {@link database.Database `Database`} service for the default
84+
* app or a given app.
85+
*
86+
* `getDatabaseWithUrl()` can be called with no arguments to access the default
87+
* app's {@link database.Database `Database`} service or as
88+
* `getDatabaseWithUrl(app)` to access the
89+
* {@link database.Database `Database`} service associated with a specific
90+
* app.
91+
*
92+
* @example
93+
* ```javascript
94+
* // Get the Database service for the default app
95+
* const defaultDatabase = getDatabaseWithUrl('https://example.firebaseio.com');
96+
* ```
97+
*
98+
* @example
99+
* ```javascript
100+
* // Get the Database service for a specific app
101+
* const otherDatabase = getDatabaseWithUrl('https://example.firebaseio.com', app);
102+
* ```
103+
*
104+
* @param App whose `Database` service to
105+
* return. If not provided, the default `Database` service will be returned.
106+
*
107+
* @return The default `Database` service if no app
108+
* is provided or the `Database` service associated with the provided app.
109+
*/
45110
export function getDatabaseWithUrl(url: string, app?: App): Database {
46111
return getDatabaseInstance({ url, app });
47112
}

src/machine-learning/index.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,35 @@ export {
3232
ModelOptionsBase,
3333
} from './machine-learning-api-client';
3434

35+
/**
36+
* Gets the {@link machineLearning.MachineLearning `MachineLearning`} service for the
37+
* default app or a given app.
38+
*
39+
* `getMachineLearning()` can be called with no arguments to access the
40+
* default app's {@link machineLearning.MachineLearning
41+
* `MachineLearning`} service or as `getMachineLearning(app)` to access
42+
* the {@link machineLearning.MachineLearning `MachineLearning`}
43+
* service associated with a specific app.
44+
*
45+
* @example
46+
* ```javascript
47+
* // Get the MachineLearning service for the default app
48+
* const defaultMachineLearning = getMachineLearning();
49+
* ```
50+
*
51+
* @example
52+
* ```javascript
53+
* // Get the MachineLearning service for a given app
54+
* const otherMachineLearning = getMachineLearning(otherApp);
55+
* ```
56+
*
57+
* @param app Optional app whose `MachineLearning` service to
58+
* return. If not provided, the default `MachineLearning` service
59+
* will be returned.
60+
*
61+
* @return The default `MachineLearning` service if no app is provided or the
62+
* `MachineLearning` service associated with the provided app.
63+
*/
3564
export function getMachineLearning(app?: App): MachineLearning {
3665
if (typeof app === 'undefined') {
3766
app = getApp();

0 commit comments

Comments
 (0)