Skip to content

Commit 02e2ea2

Browse files
authored
chore: Updated API reference comments to tsdoc.org standards (#1242)
* chore: Updated API reference comments to tsdoc.org standards * chore: Removed more old jsdoc syntax
1 parent e2f3fe0 commit 02e2ea2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+750
-836
lines changed

etc/firebase-admin.messaging.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ export type Message = TokenMessage | TopicMessage | ConditionMessage;
180180

181181
// @public
182182
export class Messaging {
183-
constructor(app: App);
184183
get app(): App;
185184
send(message: Message, dryRun?: boolean): Promise<string>;
186185
sendAll(messages: Message[], dryRun?: boolean): Promise<BatchResponse>;

src/app/core.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,30 @@ import { Agent } from 'http';
2020
import { Credential } from './credential';
2121

2222
/**
23-
* Available options to pass to [`initializeApp()`](admin#.initializeApp).
23+
* Available options to pass to {@link firebase-admin.app#initializeApp}.
2424
*/
2525
export interface AppOptions {
2626

2727
/**
2828
* A {@link Credential `Credential`} object used to
2929
* authenticate the Admin SDK.
3030
*
31-
* See [Initialize the SDK](/docs/admin/setup#initialize_the_sdk) for detailed
32-
* documentation and code samples.
31+
* See {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK}
32+
* for detailed documentation and code samples.
3333
*/
3434
credential?: Credential;
3535

3636
/**
37-
* The object to use as the [`auth`](/docs/reference/security/database/#auth)
37+
* The object to use as the {@link https://firebase.google.com/docs/reference/security/database/#auth | auth}
3838
* variable in your Realtime Database Rules when the Admin SDK reads from or
3939
* writes to the Realtime Database. This allows you to downscope the Admin SDK
4040
* from its default full read and write privileges.
4141
*
4242
* You can pass `null` to act as an unauthenticated client.
4343
*
4444
* See
45-
* [Authenticate with limited privileges](/docs/database/admin/start#authenticate-with-limited-privileges)
45+
* {@link https://firebase.google.com/docs/database/admin/start#authenticate-with-limited-privileges |
46+
* Authenticate with limited privileges}
4647
* for detailed documentation and code samples.
4748
*/
4849
databaseAuthVariableOverride?: object | null;
@@ -71,7 +72,7 @@ export interface AppOptions {
7172
projectId?: string;
7273

7374
/**
74-
* An [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
75+
* An {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
7576
* to be used when making outgoing HTTP calls. This Agent instance is used
7677
* by all services that make REST calls (e.g. `auth`, `messaging`,
7778
* `projectManagement`).
@@ -87,12 +88,6 @@ export interface AppOptions {
8788
/**
8889
* A Firebase app holds the initialization information for a collection of
8990
* services.
90-
*
91-
* Do not call this constructor directly. Instead, use
92-
* {@link
93-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
94-
* `admin.initializeApp()`}
95-
* to create an app.
9691
*/
9792
export interface App {
9893

@@ -119,10 +114,7 @@ export interface App {
119114

120115
/**
121116
* The (read-only) configuration options for this app. These are the original
122-
* parameters given in
123-
* {@link
124-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
125-
* `admin.initializeApp()`}.
117+
* parameters given in {@link firebase-admin.app#initializeApp}.
126118
*
127119
* @example
128120
* ```javascript
@@ -170,7 +162,9 @@ export interface FirebaseError {
170162
stack?: string;
171163

172164
/**
173-
* @return A JSON-serializable representation of this object.
165+
* Returns a JSON-serializable object representation of this error.
166+
*
167+
* @returns A JSON-serializable representation of this object.
174168
*/
175169
toJSON(): object;
176170
}

src/app/credential-factory.ts

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,16 @@ const globalRefreshTokenCreds: { [key: string]: RefreshTokenCredential } = {};
2828

2929
/**
3030
* Returns a credential created from the
31-
* {@link
32-
* https://developers.google.com/identity/protocols/application-default-credentials
33-
* Google Application Default Credentials}
31+
* {@link https://developers.google.com/identity/protocols/application-default-credentials |
32+
* Google Application Default Credentials}
3433
* that grants admin access to Firebase services. This credential can be used
35-
* in the call to
36-
* {@link
37-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
38-
* `admin.initializeApp()`}.
34+
* in the call to {@link firebase-admin.app#initializeApp}.
3935
*
4036
* Google Application Default Credentials are available on any Google
4137
* infrastructure, such as Google App Engine and Google Compute Engine.
4238
*
4339
* See
44-
* {@link
45-
* https://firebase.google.com/docs/admin/setup#initialize_the_sdk
46-
* Initialize the SDK}
40+
* {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK}
4741
* for more details.
4842
*
4943
* @example
@@ -54,10 +48,10 @@ const globalRefreshTokenCreds: { [key: string]: RefreshTokenCredential } = {};
5448
* });
5549
* ```
5650
*
57-
* @param httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
51+
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
5852
* to be used when retrieving access tokens from Google token servers.
5953
*
60-
* @return A credential authenticated via Google
54+
* @returns A credential authenticated via Google
6155
* Application Default Credentials that can be used to initialize an app.
6256
*/
6357
export function applicationDefault(httpAgent?: Agent): Credential {
@@ -70,15 +64,10 @@ export function applicationDefault(httpAgent?: Agent): Credential {
7064
/**
7165
* Returns a credential created from the provided service account that grants
7266
* admin access to Firebase services. This credential can be used in the call
73-
* to
74-
* {@link
75-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
76-
* `admin.initializeApp()`}.
67+
* to {@link firebase-admin.app#initializeApp}.
7768
*
7869
* See
79-
* {@link
80-
* https://firebase.google.com/docs/admin/setup#initialize_the_sdk
81-
* Initialize the SDK}
70+
* {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK}
8271
* for more details.
8372
*
8473
* @example
@@ -106,10 +95,10 @@ export function applicationDefault(httpAgent?: Agent): Credential {
10695
*
10796
* @param serviceAccountPathOrObject The path to a service
10897
* account key JSON file or an object representing a service account key.
109-
* @param httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
98+
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
11099
* to be used when retrieving access tokens from Google token servers.
111100
*
112-
* @return A credential authenticated via the
101+
* @returns A credential authenticated via the
113102
* provided service account that can be used to initialize an app.
114103
*/
115104
export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAgent?: Agent): Credential {
@@ -124,15 +113,10 @@ export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAg
124113
/**
125114
* Returns a credential created from the provided refresh token that grants
126115
* admin access to Firebase services. This credential can be used in the call
127-
* to
128-
* {@link
129-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
130-
* `admin.initializeApp()`}.
116+
* to {@link firebase-admin.app#initializeApp}.
131117
*
132118
* See
133-
* {@link
134-
* https://firebase.google.com/docs/admin/setup#initialize_the_sdk
135-
* Initialize the SDK}
119+
* {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK}
136120
* for more details.
137121
*
138122
* @example
@@ -148,10 +132,10 @@ export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAg
148132
* @param refreshTokenPathOrObject The path to a Google
149133
* OAuth2 refresh token JSON file or an object representing a Google OAuth2
150134
* refresh token.
151-
* @param httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
135+
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
152136
* to be used when retrieving access tokens from Google token servers.
153137
*
154-
* @return A credential authenticated via the
138+
* @returns A credential authenticated via the
155139
* provided service account that can be used to initialize an app.
156140
*/
157141
export function refreshToken(refreshTokenPathOrObject: string | object, httpAgent?: Agent): Credential {

src/app/credential.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ export interface Credential {
4242
* Returns a Google OAuth2 access token object used to authenticate with
4343
* Firebase services.
4444
*
45-
* This object contains the following properties:
46-
* * `access_token` (`string`): The actual Google OAuth2 access token.
47-
* * `expires_in` (`number`): The number of seconds from when the token was
48-
* issued that it expires.
49-
*
50-
* @return A Google OAuth2 access token object.
45+
* @returns A Google OAuth2 access token object.
5146
*/
5247
getAccessToken(): Promise<GoogleOAuthAccessToken>;
5348
}

src/app/firebase-app.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class FirebaseApp implements app.App {
192192
/**
193193
* Returns the Auth service instance associated with this app.
194194
*
195-
* @return The Auth service instance of this app.
195+
* @returns The Auth service instance of this app.
196196
*/
197197
public auth(): Auth {
198198
const fn = require('../auth/index').getAuth;
@@ -202,7 +202,7 @@ export class FirebaseApp implements app.App {
202202
/**
203203
* Returns the Database service for the specified URL, and the current app.
204204
*
205-
* @return The Database service instance of this app.
205+
* @returns The Database service instance of this app.
206206
*/
207207
public database(url?: string): Database {
208208
const fn = require('../database/index').getDatabaseWithUrl;
@@ -212,7 +212,7 @@ export class FirebaseApp implements app.App {
212212
/**
213213
* Returns the Messaging service instance associated with this app.
214214
*
215-
* @return The Messaging service instance of this app.
215+
* @returns The Messaging service instance of this app.
216216
*/
217217
public messaging(): Messaging {
218218
const fn = require('../messaging/index').getMessaging;
@@ -222,7 +222,7 @@ export class FirebaseApp implements app.App {
222222
/**
223223
* Returns the Storage service instance associated with this app.
224224
*
225-
* @return The Storage service instance of this app.
225+
* @returns The Storage service instance of this app.
226226
*/
227227
public storage(): Storage {
228228
const fn = require('../storage/index').getStorage;
@@ -237,7 +237,7 @@ export class FirebaseApp implements app.App {
237237
/**
238238
* Returns the InstanceId service instance associated with this app.
239239
*
240-
* @return The InstanceId service instance of this app.
240+
* @returns The InstanceId service instance of this app.
241241
*/
242242
public instanceId(): InstanceId {
243243
const fn = require('../instance-id/index').getInstanceId;
@@ -247,7 +247,7 @@ export class FirebaseApp implements app.App {
247247
/**
248248
* Returns the MachineLearning service instance associated with this app.
249249
*
250-
* @return The Machine Learning service instance of this app
250+
* @returns The Machine Learning service instance of this app
251251
*/
252252
public machineLearning(): MachineLearning {
253253
const fn = require('../machine-learning/index').getMachineLearning;
@@ -257,7 +257,7 @@ export class FirebaseApp implements app.App {
257257
/**
258258
* Returns the ProjectManagement service instance associated with this app.
259259
*
260-
* @return The ProjectManagement service instance of this app.
260+
* @returns The ProjectManagement service instance of this app.
261261
*/
262262
public projectManagement(): ProjectManagement {
263263
const fn = require('../project-management/index').getProjectManagement;
@@ -267,7 +267,7 @@ export class FirebaseApp implements app.App {
267267
/**
268268
* Returns the SecurityRules service instance associated with this app.
269269
*
270-
* @return The SecurityRules service instance of this app.
270+
* @returns The SecurityRules service instance of this app.
271271
*/
272272
public securityRules(): SecurityRules {
273273
const fn = require('../security-rules/index').getSecurityRules;
@@ -277,7 +277,7 @@ export class FirebaseApp implements app.App {
277277
/**
278278
* Returns the RemoteConfig service instance associated with this app.
279279
*
280-
* @return The RemoteConfig service instance of this app.
280+
* @returns The RemoteConfig service instance of this app.
281281
*/
282282
public remoteConfig(): RemoteConfig {
283283
const fn = require('../remote-config/index').getRemoteConfig;
@@ -287,7 +287,7 @@ export class FirebaseApp implements app.App {
287287
/**
288288
* Returns the name of the FirebaseApp instance.
289289
*
290-
* @return The name of the FirebaseApp instance.
290+
* @returns The name of the FirebaseApp instance.
291291
*/
292292
get name(): string {
293293
this.checkDestroyed_();
@@ -297,7 +297,7 @@ export class FirebaseApp implements app.App {
297297
/**
298298
* Returns the options for the FirebaseApp instance.
299299
*
300-
* @return The options for the FirebaseApp instance.
300+
* @returns The options for the FirebaseApp instance.
301301
*/
302302
get options(): AppOptions {
303303
this.checkDestroyed_();
@@ -314,7 +314,7 @@ export class FirebaseApp implements app.App {
314314
/**
315315
* Deletes the FirebaseApp instance.
316316
*
317-
* @return An empty Promise fulfilled once the FirebaseApp instance is deleted.
317+
* @returns An empty Promise fulfilled once the FirebaseApp instance is deleted.
318318
*/
319319
public delete(): Promise<void> {
320320
this.checkDestroyed_();

src/app/firebase-namespace.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class FirebaseNamespaceInternals {
7272
* to a file.
7373
* @param appName Optional name of the FirebaseApp instance.
7474
*
75-
* @return A new App instance.
75+
* @returns A new App instance.
7676
*/
7777
public initializeApp(options?: AppOptions, appName = DEFAULT_APP_NAME): App {
7878
if (typeof options === 'undefined') {
@@ -114,7 +114,7 @@ export class FirebaseNamespaceInternals {
114114
* if no name is provided).
115115
*
116116
* @param appName Optional name of the FirebaseApp instance to return.
117-
* @return The App instance which has the provided name.
117+
* @returns The App instance which has the provided name.
118118
*/
119119
public app(appName = DEFAULT_APP_NAME): App {
120120
if (typeof appName !== 'string' || appName === '') {
@@ -360,7 +360,7 @@ export class FirebaseNamespace {
360360
* otherwise it will be assumed to be pointing to a file.
361361
* @param appName Optional name of the FirebaseApp instance.
362362
*
363-
* @return A new FirebaseApp instance.
363+
* @returns A new FirebaseApp instance.
364364
*/
365365
public initializeApp(options?: AppOptions, appName?: string): App {
366366
return this.INTERNAL.initializeApp(options, appName);
@@ -371,7 +371,7 @@ export class FirebaseNamespace {
371371
* if no name is provided).
372372
*
373373
* @param appName Optional name of the FirebaseApp instance to return.
374-
* @return The FirebaseApp instance which has the provided name.
374+
* @returns The FirebaseApp instance which has the provided name.
375375
*/
376376
public app(appName?: string): App {
377377
return this.INTERNAL.app(appName);

src/auth/action-code-settings-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class ActionCodeSettingsBuilder {
223223
* Returns the corresponding constructed server request corresponding to the
224224
* current ActionCodeSettings.
225225
*
226-
* @return {EmailActionCodeRequest} The constructed EmailActionCodeRequest request.
226+
* @returns The constructed EmailActionCodeRequest request.
227227
*/
228228
public buildRequest(): EmailActionCodeRequest {
229229
const request: { [key: string]: any } = {

0 commit comments

Comments
 (0)