Skip to content

Commit

Permalink
Update comments for installations, performance and remote config (#4766)
Browse files Browse the repository at this point in the history
* add package descriptions

* initial capitals and periods

* add parameter description to installations

* add interface descriptions for perf

* address comments

* address comments2
  • Loading branch information
Feiyang1 committed Apr 9, 2021
1 parent 626c05b commit 9df03c9
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 30 deletions.
6 changes: 6 additions & 0 deletions packages-exp/analytics-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Analytics
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2019 Google LLC
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/auth-exp/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Authentication
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2017 Google LLC
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/functions-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Cloud Functions for Firebase
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2017 Google LLC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { FirebaseInstallations } from '../interfaces/public-types';

/**
* Deletes the Firebase Installation and all associated data.
* @param installations - The `Installations` instance.
*
* @public
*/
Expand Down
1 change: 1 addition & 0 deletions packages-exp/installations-exp/src/api/get-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { FirebaseInstallations } from '../interfaces/public-types';
/**
* Creates a Firebase Installation if there isn't one for the app and
* returns the Installation ID.
* @param installations - The `Installations` instance.
*
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { FirebaseInstallations } from '../interfaces/public-types';

/**
* Returns an instance of FirebaseInstallations associated with the given FirebaseApp instance.
* @param app - The `FirebaseApp` instance.
*
* @public
*/
Expand Down
2 changes: 2 additions & 0 deletions packages-exp/installations-exp/src/api/get-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { FirebaseInstallations } from '../interfaces/public-types';

/**
* Returns an Installation auth token, identifying the current Firebase Installation.
* @param installations - The `Installations` instance.
* @param forceRefresh - Force refresh regardless of token expiration.
*
* @public
*/
Expand Down
3 changes: 3 additions & 0 deletions packages-exp/installations-exp/src/api/on-id-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export type IdChangeUnsubscribeFn = () => void;
/**
* Sets a new callback that will get called when Installation ID changes.
* Returns an unsubscribe function that will remove the callback when called.
* @param installations - The `Installations` instance.
* @param callback - The callback function that is invoked when FID changes.
* @returns A function that can be called to unsubscribe.
*
* @public
*/
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/installations-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Installations
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2019 Google LLC
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/messaging-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Cloud Messaging
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2017 Google LLC
Expand Down
16 changes: 11 additions & 5 deletions packages-exp/performance-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Performance Monitoring
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2020 Google LLC
Expand Down Expand Up @@ -45,7 +51,7 @@ const DEFAULT_ENTRY_NAME = '[DEFAULT]';

/**
* Returns a FirebasePerformance instance for the given app.
* @param app - The FirebaseApp to use.
* @param app - The `FirebaseApp` to use.
* @public
*/
export function getPerformance(
Expand All @@ -59,8 +65,8 @@ export function getPerformance(

/**
* Returns a FirebasePerformance instance for the given app. Can only be called once.
* @param app - The FirebaseApp to use.
* @param settings - Optional settings for the Performance instance.
* @param app - The `FirebaseApp` to use.
* @param settings - Optional settings for the `FirebasePerformance` instance.
* @public
*/
export function initializePerformance(
Expand All @@ -83,8 +89,8 @@ export function initializePerformance(
}

/**
* Returns a new PerformanceTrace instance.
* @param performance - The FirebasePerformance instance to use.
* Returns a new `PerformanceTrace` instance.
* @param performance - The `FirebasePerformance` instance to use.
* @param name - The name of the trace.
* @public
*/
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/performance-exp/src/public_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/

/**
* Defines configuration options for the Performance Monitoring SDK.
*
* @public
*/
export interface PerformanceSettings {
Expand All @@ -27,6 +29,8 @@ export interface PerformanceSettings {
}

/**
* The Firebase Performance Monitoring service interface.
*
* @public
*/
export interface FirebasePerformance {
Expand All @@ -42,6 +46,8 @@ export interface FirebasePerformance {
}

/**
* The interface representing a `Trace`.
*
* @public
*/
export interface PerformanceTrace {
Expand Down
46 changes: 23 additions & 23 deletions packages-exp/remote-config-exp/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { getModularInstance } from '@firebase/util';

/**
*
* @param app - the firebase app instance
* @returns a remote config instance
* @param app - The `FirebaseApp` instance.
* @returns A `RemoteConfig` instance.
*
* @public
*/
Expand All @@ -44,7 +44,7 @@ export function getRemoteConfig(app: FirebaseApp = getApp()): RemoteConfig {

/**
* Makes the last fetched config available to the getters.
* @param remoteConfig - the remote config instance
* @param remoteConfig - The `RemoteConfig` instance.
* @returns A promise which resolves to true if the current call activated the fetched configs.
* If the fetched configs were already activated, the promise will resolve to false.
*
Expand Down Expand Up @@ -75,9 +75,9 @@ export async function activate(remoteConfig: RemoteConfig): Promise<boolean> {

/**
* Ensures the last activated config are available to the getters.
* @param remoteConfig - the remote config instance
* @param remoteConfig - The `RemoteConfig` instance.
*
* @returns A promise that resolves when the last activated config is available to the getters
* @returns A promise that resolves when the last activated config is available to the getters.
* @public
*/
export function ensureInitialized(remoteConfig: RemoteConfig): Promise<void> {
Expand All @@ -92,7 +92,7 @@ export function ensureInitialized(remoteConfig: RemoteConfig): Promise<void> {

/**
* Fetches and caches configuration from the Remote Config service.
* @param remoteConfig - the remote config instance
* @param remoteConfig - The `RemoteConfig` instance.
* @public
*/
export async function fetchConfig(remoteConfig: RemoteConfig): Promise<void> {
Expand Down Expand Up @@ -134,8 +134,8 @@ export async function fetchConfig(remoteConfig: RemoteConfig): Promise<void> {
/**
* Gets all config.
*
* @param remoteConfig - the remote config instance
* @returns all config
* @param remoteConfig - The `RemoteConfig` instance.
* @returns All config.
*
* @public
*/
Expand All @@ -155,10 +155,10 @@ export function getAll(remoteConfig: RemoteConfig): Record<string, Value> {
*
* Convenience method for calling <code>remoteConfig.getValue(key).asBoolean()</code>.
*
* @param remoteConfig - the remote config instance
* @param key - the name of the parameter
* @param remoteConfig - The `RemoteConfig` instance.
* @param key - The name of the parameter.
*
* @returns the value for the given key as a boolean
* @returns The value for the given key as a boolean.
* @public
*/
export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean {
Expand All @@ -170,10 +170,10 @@ export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean {
*
* Convenience method for calling <code>remoteConfig.getValue(key).asNumber()</code>.
*
* @param remoteConfig - the remote config instance
* @param key - the name of the parameter
* @param remoteConfig - The `RemoteConfig` instance.
* @param key - The name of the parameter.
*
* @returns the value for the given key as a number
* @returns The value for the given key as a number.
*
* @public
*/
Expand All @@ -182,13 +182,13 @@ export function getNumber(remoteConfig: RemoteConfig, key: string): number {
}

/**
* Gets the value for the given key as a String.
* Gets the value for the given key as a string.
* Convenience method for calling <code>remoteConfig.getValue(key).asString()</code>.
*
* @param remoteConfig - the remote config instance
* @param key - the name of the parameter
* @param remoteConfig - The `RemoteConfig` instance.
* @param key - The name of the parameter.
*
* @returns the value for the given key as a String
* @returns The value for the given key as a string.
*
* @public
*/
Expand All @@ -199,10 +199,10 @@ export function getString(remoteConfig: RemoteConfig, key: string): string {
/**
* Gets the {@link Value} for the given key.
*
* @param remoteConfig - the remote config instance
* @param key - the name of the parameter
* @param remoteConfig - The `RemoteConfig` instance.
* @param key - The name of the parameter.
*
* @returns the value for the given key
* @returns The value for the given key.
*
* @public
*/
Expand Down Expand Up @@ -230,8 +230,8 @@ export function getValue(remoteConfig: RemoteConfig, key: string): Value {
/**
* Defines the log level to use.
*
* @param remoteConfig - the remote config instance
* @param logLevel - the log level to set
* @param remoteConfig - The `RemoteConfig` instance.
* @param logLevel - The log level to set.
*
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/remote-config-exp/src/api2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { getModularInstance } from '@firebase/util';
*
* Performs fetch and activate operations, as a convenience.
*
* @param remoteConfig - the remote config instance
* @param remoteConfig - The remote config instance.
*
* @returns A promise which resolves to true if the current call activated the fetched configs.
* If the fetched configs were already activated, the promise will resolve to false.
Expand Down
6 changes: 6 additions & 0 deletions packages-exp/remote-config-exp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Remote Config
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2020 Google LLC
Expand Down
2 changes: 1 addition & 1 deletion packages/database/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../config/api-extractor.json",
// Point it to your entry point d.ts file.
"mainEntryPointFilePath": "<projectFolder>/exp-types/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/exp/index.d.ts"
}
6 changes: 6 additions & 0 deletions packages/database/exp/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Realtime Database
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2020 Google LLC
Expand Down
6 changes: 6 additions & 0 deletions packages/firestore/exp/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Cloud Firestore
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2020 Google LLC
Expand Down
6 changes: 6 additions & 0 deletions packages/storage/exp/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Cloud Storage for Firebase
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2020 Google LLC
Expand Down
9 changes: 9 additions & 0 deletions scripts/exp/docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ async function generateDocs(forDevsite: boolean = false) {
}
);

// build database-exp
await spawn(
'yarn',
['lerna', 'run', '--scope', '@firebase/database', 'build:exp'],
{
stdio: 'inherit'
}
);

// generate public typings for firestore
await spawn(
'yarn',
Expand Down

0 comments on commit 9df03c9

Please sign in to comment.