Skip to content

Commit

Permalink
fix: Updated API docs of remaining modules (#1172)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hiranya911 authored Feb 18, 2021
1 parent 93a7699 commit 0ebb759
Show file tree
Hide file tree
Showing 21 changed files with 399 additions and 108 deletions.
8 changes: 4 additions & 4 deletions etc/firebase-admin.database.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export namespace database {

export { DataSnapshot }

// @public (undocumented)
// @public
export const enableLogging: typeof rtdb.enableLogging;

export { EventType }

// @public (undocumented)
// @public
export function getDatabase(app?: App): Database;

// @public (undocumented)
// @public
export function getDatabaseWithUrl(url: string, app?: App): Database;

export { OnDisconnect }
Expand All @@ -66,7 +66,7 @@ export { Query }

export { Reference }

// @public (undocumented)
// @public
export const ServerValue: rtdb.ServerValue;

export { ThenableReference }
Expand Down
13 changes: 1 addition & 12 deletions etc/firebase-admin.machine-learning.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface GcsTfliteModelOptions extends ModelOptionsBase {

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

// @public
Expand Down Expand Up @@ -79,30 +79,19 @@ export namespace machineLearning {

// @public
export class Model {
// (undocumented)
get createTime(): string;
// (undocumented)
get displayName(): string;
// (undocumented)
get etag(): string;
get locked(): boolean;
// (undocumented)
get modelHash(): string | undefined;
// (undocumented)
get modelId(): string;
// (undocumented)
get published(): boolean;
// (undocumented)
get tags(): string[];
// (undocumented)
get tfliteModel(): TFLiteModel | undefined;
// (undocumented)
toJSON(): {
[key: string]: any;
};
// (undocumented)
get updateTime(): string;
// (undocumented)
get validationError(): string | undefined;
waitForUnlocked(maxTimeMillis?: number): Promise<void>;
}
Expand Down
2 changes: 1 addition & 1 deletion etc/firebase-admin.messaging.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export interface FcmOptions {

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

// @public
Expand Down
6 changes: 3 additions & 3 deletions etc/firebase-admin.project-management.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Agent } from 'http';

// @public (undocumented)
// @public
export class AndroidApp {
addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;
// (undocumented)
Expand Down Expand Up @@ -43,10 +43,10 @@ export enum AppPlatform {

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

// @public (undocumented)
// @public
export class IosApp {
// (undocumented)
readonly appId: string;
Expand Down
2 changes: 1 addition & 1 deletion etc/firebase-admin.remote-config.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ExplicitParameterValue {

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

// @public
Expand Down
10 changes: 3 additions & 7 deletions etc/firebase-admin.security-rules.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import { Agent } from 'http';

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

// @public
export class Ruleset {
// (undocumented)
export class Ruleset implements RulesetMetadata {
readonly createTime: string;
// (undocumented)
readonly name: string;
// (undocumented)
readonly source: RulesFile[];
Expand All @@ -27,11 +25,9 @@ export interface RulesetMetadata {
readonly name: string;
}

// @public (undocumented)
// @public
export class RulesetMetadataList {
// (undocumented)
readonly nextPageToken?: string;
// (undocumented)
readonly rulesets: RulesetMetadata[];
}

Expand Down
3 changes: 1 addition & 2 deletions etc/firebase-admin.storage.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import { Bucket } from '@google-cloud/storage';

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

// @public
export class Storage {
get app(): App;
// (undocumented)
bucket(name?: string): Bucket;
}

Expand Down
65 changes: 65 additions & 0 deletions src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,78 @@ export {
ThenableReference,
} from '@firebase/database-types';

/**
* [`enableLogging`](https://firebase.google.com/docs/reference/js/firebase.database#enablelogging)
* function from the `@firebase/database` package.
*/
export const enableLogging: typeof rtdb.enableLogging = enableLoggingFunc;

/**
* [`ServerValue`](https://firebase.google.com/docs/reference/js/firebase.database.ServerValue)
* module from the `@firebase/database` package.
*/
export const ServerValue: rtdb.ServerValue = serverValueConst;

/**
* Gets the {@link database.Database `Database`} service for the default
* app or a given app.
*
* `getDatabase()` can be called with no arguments to access the default
* app's {@link database.Database `Database`} service or as
* `getDatabase(app)` to access the
* {@link database.Database `Database`} service associated with a specific
* app.
*
* @example
* ```javascript
* // Get the Database service for the default app
* const defaultDatabase = getDatabase();
* ```
*
* @example
* ```javascript
* // Get the Database service for a specific app
* const otherDatabase = getDatabase(app);
* ```
*
* @param App whose `Database` service to
* return. If not provided, the default `Database` service will be returned.
*
* @return The default `Database` service if no app
* is provided or the `Database` service associated with the provided app.
*/
export function getDatabase(app?: App): Database {
return getDatabaseInstance({ app });
}

/**
* Gets the {@link database.Database `Database`} service for the default
* app or a given app.
*
* `getDatabaseWithUrl()` can be called with no arguments to access the default
* app's {@link database.Database `Database`} service or as
* `getDatabaseWithUrl(app)` to access the
* {@link database.Database `Database`} service associated with a specific
* app.
*
* @example
* ```javascript
* // Get the Database service for the default app
* const defaultDatabase = getDatabaseWithUrl('https://example.firebaseio.com');
* ```
*
* @example
* ```javascript
* // Get the Database service for a specific app
* const otherDatabase = getDatabaseWithUrl('https://example.firebaseio.com', app);
* ```
*
* @param App whose `Database` service to
* return. If not provided, the default `Database` service will be returned.
*
* @return The default `Database` service if no app
* is provided or the `Database` service associated with the provided app.
*/
export function getDatabaseWithUrl(url: string, app?: App): Database {
return getDatabaseInstance({ url, app });
}
Expand Down
29 changes: 29 additions & 0 deletions src/machine-learning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@ export {
ModelOptionsBase,
} from './machine-learning-api-client';

/**
* Gets the {@link machineLearning.MachineLearning `MachineLearning`} service for the
* default app or a given app.
*
* `getMachineLearning()` can be called with no arguments to access the
* default app's {@link machineLearning.MachineLearning
* `MachineLearning`} service or as `getMachineLearning(app)` to access
* the {@link machineLearning.MachineLearning `MachineLearning`}
* service associated with a specific app.
*
* @example
* ```javascript
* // Get the MachineLearning service for the default app
* const defaultMachineLearning = getMachineLearning();
* ```
*
* @example
* ```javascript
* // Get the MachineLearning service for a given app
* const otherMachineLearning = getMachineLearning(otherApp);
* ```
*
* @param app Optional app whose `MachineLearning` service to
* return. If not provided, the default `MachineLearning` service
* will be returned.
*
* @return The default `MachineLearning` service if no app is provided or the
* `MachineLearning` service associated with the provided app.
*/
export function getMachineLearning(app?: App): MachineLearning {
if (typeof app === 'undefined') {
app = getApp();
Expand Down
Loading

0 comments on commit 0ebb759

Please sign in to comment.