Skip to content

Commit 6c0f61b

Browse files
committed
Initial commit
1 parent 145c62b commit 6c0f61b

File tree

7 files changed

+21
-23
lines changed

7 files changed

+21
-23
lines changed

packages/storage/exp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
SettableMetadata,
5353
UploadMetadata,
5454
FullMetadata
55-
} from '@firebase/storage-types/exp';
55+
} from './public-types';
5656
import { Metadata as MetadataInternal } from '../src/metadata';
5757
import {
5858
uploadBytes as uploadBytesInternal,

packages/storage-types/exp/index.d.ts renamed to packages/storage/exp/public-types.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FirebaseApp, _FirebaseService } from '@firebase/app-types-exp';
19-
import { CompleteFn, FirebaseError, NextFn, Unsubscribe } from '@firebase/util';
18+
// eslint-disable-next-line import/no-extraneous-dependencies
19+
import { FirebaseApp } from '@firebase/app-exp';
20+
import {
21+
CompleteFn,
22+
FirebaseError,
23+
NextFn,
24+
Subscribe,
25+
Unsubscribe
26+
} from '@firebase/util';
2027

2128
/**
2229
* A Firebase Storage instance.
@@ -245,7 +252,7 @@ export type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error';
245252
* An error returned by the Firebase Storage SDK.
246253
* @public
247254
*/
248-
interface FirebaseStorageError extends FirebaseError {
255+
export interface FirebaseStorageError extends FirebaseError {
249256
/**
250257
* A server response message for the error, if applicable.
251258
*/
@@ -276,7 +283,7 @@ export interface UploadTask {
276283
/**
277284
* Equivalent to calling `then(null, onRejected)`.
278285
*/
279-
catch(onRejected: (error: FirebaseStorageError) => any): Promise<any>;
286+
catch(onRejected: (error: FirebaseStorageError) => unknown): Promise<unknown>;
280287
/**
281288
* Listens for events on this task.
282289
*
@@ -391,10 +398,10 @@ export interface UploadTask {
391398
nextOrObserver?:
392399
| StorageObserver<UploadTaskSnapshot>
393400
| null
394-
| ((snapshot: UploadTaskSnapshot) => any),
395-
error?: ((a: FirebaseStorageError) => any) | null,
401+
| ((snapshot: UploadTaskSnapshot) => unknown),
402+
error?: ((a: FirebaseStorageError) => unknown) | null,
396403
complete?: Unsubscribe | null
397-
): Function;
404+
): Unsubscribe | Subscribe<UploadTaskSnapshot>;
398405

399406
/**
400407
* Pauses a currently running task. Has no effect on a paused or failed task.
@@ -419,9 +426,9 @@ export interface UploadTask {
419426
* @param onRejected - The rejection callback.
420427
*/
421428
then(
422-
onFulfilled?: ((snapshot: UploadTaskSnapshot) => any) | null,
423-
onRejected?: ((error: FirebaseStorageError) => any) | null
424-
): Promise<any>;
429+
onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null,
430+
onRejected?: ((error: FirebaseStorageError) => unknown) | null
431+
): Promise<unknown>;
425432
}
426433

427434
/**

packages/storage/src/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FullMetadata } from '@firebase/storage-types/exp';
18+
import { FullMetadata } from '../exp/public-types';
1919

2020
/**
2121
* @fileoverview Documentation for the metadata format.

packages/storage/src/reference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
deleteObject as requestsDeleteObject,
3232
multipartUpload
3333
} from './implementation/requests';
34-
import { ListOptions } from '@firebase/storage-types/exp';
34+
import { ListOptions } from '../exp/public-types';
3535
import { StringFormat, dataFromString } from './implementation/string';
3636
import { Metadata } from './metadata';
3737
import { StorageService } from './service';

packages/storage/test/integration/integration.exp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434

3535
import { use, expect } from 'chai';
3636
import * as chaiAsPromised from 'chai-as-promised';
37-
import * as types from '@firebase/storage-types/exp';
37+
import * as types from '../../exp/public-types';
3838

3939
use(chaiAsPromised);
4040

scripts/exp/prepare-storage-for-exp-release.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ export async function prepare() {
3737
// Update package.json
3838
const packageJson = await readPackageJson(packagePath);
3939
const expPackageJson = await readPackageJson(`${packagePath}/exp`);
40-
const typesPackageJson = await readPackageJson(`${packagePath}-types`);
4140
packageJson.version = '0.0.900';
42-
typesPackageJson.version = '0.0.900';
43-
typesPackageJson.files = `['exp/index.d.ts']`;
4441

4542
packageJson.peerDependencies = {
4643
'@firebase/app-exp': '0.x'
@@ -62,9 +59,4 @@ export async function prepare() {
6259
`${JSON.stringify(packageJson, null, 2)}\n`,
6360
{ encoding: 'utf-8' }
6461
);
65-
await writeFile(
66-
`${packagePath}-types/package.json`,
67-
`${JSON.stringify(typesPackageJson, null, 2)}\n`,
68-
{ encoding: 'utf-8' }
69-
);
7062
}

scripts/exp/release.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ async function publishExpPackages({ dryRun }: { dryRun: boolean }) {
7575

7676
packagePaths.push(`${projectRoot}/packages/firestore`);
7777
packagePaths.push(`${projectRoot}/packages/storage`);
78-
packagePaths.push(`${projectRoot}/packages/storage-types`);
7978
packagePaths.push(`${projectRoot}/packages/database`);
8079

8180
/**

0 commit comments

Comments
 (0)