From d9986617dece2f1e3c7df03c8b73e9518fca8b1b Mon Sep 17 00:00:00 2001 From: Feiyang Date: Mon, 23 Aug 2021 17:01:11 -0700 Subject: [PATCH] Use public typings for release (#5358) * use public typings for storage * use public typings for database --- common/api-review/storage.api.md | 18 +++++++----------- packages/database/package.json | 3 ++- packages/storage/package.json | 3 ++- .../storage/src/implementation/taskenums.ts | 4 ++++ packages/storage/src/service.ts | 2 ++ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/common/api-review/storage.api.md b/common/api-review/storage.api.md index 842b35258c0..27ce6e38fe1 100644 --- a/common/api-review/storage.api.md +++ b/common/api-review/storage.api.md @@ -56,21 +56,19 @@ export interface FirebaseStorageError extends FirebaseError { serverResponse: string | null; } -// @public +// @internal export class _FirebaseStorageImpl implements FirebaseStorage { constructor( app: FirebaseApp, _authProvider: Provider, _appCheckProvider: Provider, _pool: ConnectionPool, _url?: string | undefined, _firebaseVersion?: string | undefined); readonly app: FirebaseApp; - // @internal (undocumented) + // (undocumented) readonly _appCheckProvider: Provider; // (undocumented) protected readonly _appId: string | null; // (undocumented) readonly _authProvider: Provider; - // Warning: (ae-incompatible-release-tags) The symbol "_bucket" is marked as @public, but its signature references "Location" which is marked as @internal - // // (undocumented) _bucket: _Location | null; _delete(): Promise; @@ -90,8 +88,6 @@ export class _FirebaseStorageImpl implements FirebaseStorage { _makeRequest(requestInfo: RequestInfo_2, authToken: string | null, appCheckToken: string | null): Request_2; // (undocumented) makeRequestWithTokens(requestInfo: RequestInfo_2): Promise>; - // Warning: (ae-incompatible-release-tags) The symbol "_makeStorageReference" is marked as @public, but its signature references "Location" which is marked as @internal - // Warning: (ae-incompatible-release-tags) The symbol "_makeStorageReference" is marked as @public, but its signature references "Reference" which is marked as @internal _makeStorageReference(loc: _Location): _Reference; get maxOperationRetryTime(): number; set maxOperationRetryTime(time: number); @@ -101,7 +97,7 @@ export class _FirebaseStorageImpl implements FirebaseStorage { _overrideAuthToken?: string; // Warning: (ae-forgotten-export) The symbol "ConnectionPool" needs to be exported by the entry point index.d.ts // - // @internal (undocumented) + // (undocumented) readonly _pool: ConnectionPool; // (undocumented) readonly _url?: string | undefined; @@ -250,10 +246,10 @@ export const StringFormat: { // @public export type TaskEvent = 'state_changed'; -// @public +// @internal export type _TaskEvent = string; -// @public +// @internal export const _TaskEvent: { STATE_CHANGED: string; }; @@ -261,10 +257,10 @@ export const _TaskEvent: { // @public export type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error'; -// @public +// @internal export type _TaskState = typeof _TaskState[keyof typeof _TaskState]; -// @public +// @internal export const _TaskState: { readonly RUNNING: "running"; readonly PAUSED: "paused"; diff --git a/packages/database/package.json b/packages/database/package.json index 2e5b231489c..edf1a1b471f 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -25,7 +25,8 @@ "test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/database-test-runner.ts", "api-report": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package database --packageRoot . --typescriptDts ./dist/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/public.d.ts && yarn api-report:api-json", "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", - "doc": "api-documenter markdown --input temp --output docs" + "doc": "api-documenter markdown --input temp --output docs", + "typings:public": "node ../../scripts/exp/use_typings.js ./dist/public.d.ts" }, "license": "Apache-2.0", "peerDependencies": {}, diff --git a/packages/storage/package.json b/packages/storage/package.json index 6b64a3c3eb5..c0258ddb465 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -25,7 +25,8 @@ "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.ts --config ../../config/mocharc.node.js", "test:debug": "karma start --browser=Chrome", "prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'", - "api-report": "api-extractor run --local --verbose && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/storage-public.d.ts --output dist/storage-public.d.ts" + "api-report": "api-extractor run --local --verbose && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/storage-public.d.ts --output dist/storage-public.d.ts", + "typings:public": "node ../../scripts/exp/use_typings.js ./dist/storage-public.d.ts" }, "license": "Apache-2.0", "dependencies": { diff --git a/packages/storage/src/implementation/taskenums.ts b/packages/storage/src/implementation/taskenums.ts index c57c58a9f45..8be4e3a34c6 100644 --- a/packages/storage/src/implementation/taskenums.ts +++ b/packages/storage/src/implementation/taskenums.ts @@ -21,11 +21,13 @@ /** * An event that is triggered on a task. + * @internal */ export type TaskEvent = string; /** * An event that is triggered on a task. + * @internal */ export const TaskEvent = { /** @@ -58,12 +60,14 @@ export const enum InternalTaskState { /** * Represents the current state of a running upload. + * @internal */ export type TaskState = typeof TaskState[keyof typeof TaskState]; // type keys = keyof TaskState /** * Represents the current state of a running upload. + * @internal */ export const TaskState = { /** The task is currently transferring data. */ diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 3f41f966ac7..7db60f4c7ff 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -149,6 +149,8 @@ export function connectStorageEmulator( /** * A service that provides Firebase Storage Reference instances. * @param opt_url - gs:// url to a custom Storage Bucket + * + * @internal */ export class FirebaseStorageImpl implements FirebaseStorage { _bucket: Location | null = null;