Skip to content

(WIP): Add ability to generate documentation from auto-generated typings #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 260 additions & 28 deletions docgen/generate-docs.js

Large diffs are not rendered by default.

171 changes: 58 additions & 113 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"@types/node": "^10.10.0",
"dicer": "^0.3.0",
"jsonwebtoken": "^8.5.1",
"node-forge": "^0.9.1"
"node-forge": "^0.9.1",
"typedoc": "^0.18.0"
},
"optionalDependencies": {
"@google-cloud/firestore": "^4.0.0",
Expand Down Expand Up @@ -112,7 +113,6 @@
"sinon": "^9.0.0",
"sinon-chai": "^3.0.0",
"ts-node": "^3.3.0",
"typedoc": "^0.15.0",
"typescript": "^3.7.3",
"yargs": "^13.2.2"
}
Expand Down
1 change: 0 additions & 1 deletion src/database/database-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class DatabaseInternals implements FirebaseServiceInternalsInterface {
}

export class DatabaseService implements FirebaseServiceInterface {

public readonly INTERNAL: DatabaseInternals = new DatabaseInternals();

private readonly appInternal: FirebaseApp;
Expand Down
2 changes: 2 additions & 0 deletions src/instance-id/instance-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class InstanceIdInternals implements FirebaseServiceInternalsInterface {
* current app.
*/
export class InstanceId implements FirebaseServiceInterface {
/** @hidden */
public INTERNAL: InstanceIdInternals = new InstanceIdInternals();

private app_: FirebaseApp;
Expand All @@ -59,6 +60,7 @@ export class InstanceId implements FirebaseServiceInterface {
/**
* @param {FirebaseApp} app The app for this InstanceId service.
* @constructor
* @hidden
*/
constructor(app: FirebaseApp) {
if (!validator.isNonNullObject(app) || !('options' in app)) {
Expand Down
28 changes: 13 additions & 15 deletions src/messaging/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,29 +194,27 @@ class MessagingInternals implements FirebaseServiceInternalsInterface {


/**
* Messaging service bound to the provided app.
* Gets the {@link admin.messaging.Messaging `Messaging`} service for the
* current app.
*
* @example
* ```javascript
* var messaging = app.messaging();
* // The above is shorthand for:
* // var messaging = admin.messaging(app);
* ```
*
* @return The `Messaging` service for the current app.
*/
export class Messaging implements FirebaseServiceInterface {

/** @hidden */
public INTERNAL: MessagingInternals = new MessagingInternals();

private urlPath: string;
private readonly appInternal: FirebaseApp;
private readonly messagingRequestHandler: FirebaseMessagingRequestHandler;

/**
* Gets the {@link admin.messaging.Messaging `Messaging`} service for the
* current app.
*
* @example
* ```javascript
* var messaging = app.messaging();
* // The above is shorthand for:
* // var messaging = admin.messaging(app);
* ```
*
* @return The `Messaging` service for the current app.
*/
/** @hidden */
constructor(app: FirebaseApp) {
if (!validator.isNonNullObject(app) || !('options' in app)) {
throw new FirebaseMessagingError(
Expand Down
2 changes: 2 additions & 0 deletions src/project-management/android-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { AndroidAppMetadata, AppPlatform } from './app-metadata';
export class AndroidApp {
private readonly resourceName: string;

/** @hidden */
constructor(
public readonly appId: string,
private readonly requestHandler: ProjectManagementRequestHandler) {
Expand Down Expand Up @@ -205,6 +206,7 @@ export class ShaCertificate {
* ```javascript
* var resourceName = shaCertificate.resourceName;
* ```
* @hidden
*/
constructor(public readonly shaHash: string, public readonly resourceName?: string) {
if (/^[a-fA-F0-9]{40}$/.test(shaHash)) {
Expand Down
2 changes: 1 addition & 1 deletion src/project-management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export namespace admin.projectManagement {
// See https://github.com/typescript-eslint/typescript-eslint/issues/363
export import AndroidAppMetadata = appMetadataApi.AndroidAppMetadata
export import AppMetadata = appMetadataApi.AppMetadata
export import AppPlatform = appMetadataApi.AppPlatform
export import AppPlatform = appMetadataApi.AppPlatform;
export import IosAppMetadata = appMetadataApi.IosAppMetadata

// Allows for exposing classes as interfaces in typings
Expand Down
1 change: 1 addition & 0 deletions src/project-management/ios-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { IosAppMetadata, AppPlatform } from './app-metadata';
export class IosApp {
private readonly resourceName: string;

/** @hidden */
constructor(
public readonly appId: string,
private readonly requestHandler: ProjectManagementRequestHandler) {
Expand Down
2 changes: 2 additions & 0 deletions src/project-management/project-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ProjectManagementInternals implements FirebaseServiceInternalsInterface {
* [`admin.projectManagement()`](admin.projectManagement#projectManagement).
*/
export class ProjectManagement implements FirebaseServiceInterface {
/** @hidden */
public readonly INTERNAL: ProjectManagementInternals = new ProjectManagementInternals();

private readonly requestHandler: ProjectManagementRequestHandler;
Expand All @@ -54,6 +55,7 @@ export class ProjectManagement implements FirebaseServiceInterface {
/**
* @param {object} app The app for this ProjectManagement service.
* @constructor
* @hidden
*/
constructor(readonly app: FirebaseApp) {
if (!validator.isNonNullObject(app) || !('options' in app)) {
Expand Down
7 changes: 6 additions & 1 deletion src/remote-config/remote-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@ class RemoteConfigInternals implements FirebaseServiceInternalsInterface {
}

/**
* Remote Config service bound to the provided app.
* The Firebase `RemoteConfig` service interface.
*
* Do not call this constructor directly. Instead, use
* [`admin.remoteConfig()`](admin.remoteConfig#remoteConfig).
*/
export class RemoteConfig implements FirebaseServiceInterface {
/** @hidden */
public readonly INTERNAL: RemoteConfigInternals = new RemoteConfigInternals();

private readonly client: RemoteConfigApiClient;

/**
* @param {FirebaseApp} app The app for this RemoteConfig service.
* @constructor
* @hidden
*/
constructor(readonly app: FirebaseApp) {
this.client = new RemoteConfigApiClient(app);
Expand Down
3 changes: 3 additions & 0 deletions src/security-rules/security-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class Ruleset implements RulesetMetadata {
public readonly createTime: string;
public readonly source: RulesFile[];

/** @hidden */
constructor(ruleset: RulesetResponse) {
if (!validator.isNonNullObject(ruleset) ||
!validator.isNonEmptyString(ruleset.name) ||
Expand Down Expand Up @@ -124,13 +125,15 @@ export class SecurityRules implements FirebaseServiceInterface {
private static readonly CLOUD_FIRESTORE = 'cloud.firestore';
private static readonly FIREBASE_STORAGE = 'firebase.storage';

/** @hidden */
public readonly INTERNAL = new SecurityRulesInternals();

private readonly client: SecurityRulesApiClient;

/**
* @param {object} app The app for this SecurityRules service.
* @constructor
* @hidden
*/
constructor(readonly app: FirebaseApp) {
this.client = new SecurityRulesApiClient(app);
Expand Down