@firebase/storage 0.8.3-canary.85d2c4d29 → 0.8.3-canary.88ea06930

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,12 +14,8 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- /**
18
- * Network headers
19
- */
20
- export interface Headers {
21
- [name: string]: string;
22
- }
17
+ /** Network headers */
18
+ export declare type Headers = Record<string, string>;
23
19
  /**
24
20
  * A lightweight wrapper around XMLHttpRequest with a
25
21
  * goog.net.XhrIo-like interface.
@@ -22,6 +22,14 @@ import { Headers, Connection } from './connection';
22
22
  export interface UrlParams {
23
23
  [name: string]: string | number;
24
24
  }
25
+ /**
26
+ * A function that converts a server response to the API type expected by the
27
+ * SDK.
28
+ *
29
+ * @param I - the type of the backend's network response
30
+ * @param O - the output response type used by the rest of the SDK.
31
+ */
32
+ export declare type RequestHandler<I, O> = (connection: Connection, response: I) => O;
25
33
  export declare class RequestInfo<T> {
26
34
  url: string;
27
35
  method: string;
@@ -32,12 +40,12 @@ export declare class RequestInfo<T> {
32
40
  * Note: The XhrIo passed to this function may be reused after this callback
33
41
  * returns. Do not keep a reference to it in any way.
34
42
  */
35
- handler: (p1: Connection, p2: string) => T;
43
+ handler: RequestHandler<string, T>;
36
44
  timeout: number;
37
45
  urlParams: UrlParams;
38
46
  headers: Headers;
39
47
  body: Blob | string | Uint8Array | null;
40
- errorHandler: ((p1: Connection, p2: StorageError) => StorageError) | null;
48
+ errorHandler: RequestHandler<StorageError, StorageError> | null;
41
49
  /**
42
50
  * Called with the current number of bytes uploaded and total size (-1 if not
43
51
  * computable) of the request body (i.e. used to report upload progress).
@@ -53,5 +61,5 @@ export declare class RequestInfo<T> {
53
61
  * Note: The XhrIo passed to this function may be reused after this callback
54
62
  * returns. Do not keep a reference to it in any way.
55
63
  */
56
- handler: (p1: Connection, p2: string) => T, timeout: number);
64
+ handler: RequestHandler<string, T>, timeout: number);
57
65
  }
@@ -25,38 +25,14 @@ export declare class XhrConnection implements Connection {
25
25
  private sendPromise_;
26
26
  private sent_;
27
27
  constructor();
28
- /**
29
- * @override
30
- */
31
28
  send(url: string, method: string, body?: ArrayBufferView | Blob | string, headers?: Headers): Promise<void>;
32
- /**
33
- * @override
34
- */
35
29
  getErrorCode(): ErrorCode;
36
- /**
37
- * @override
38
- */
39
30
  getStatus(): number;
40
- /**
41
- * @override
42
- */
43
31
  getResponseText(): string;
44
- /**
45
- * Aborts the request.
46
- * @override
47
- */
32
+ /** Aborts the request. */
48
33
  abort(): void;
49
- /**
50
- * @override
51
- */
52
34
  getResponseHeader(header: string): string | null;
53
- /**
54
- * @override
55
- */
56
35
  addUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
57
- /**
58
- * @override
59
- */
60
36
  removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
61
37
  }
62
38
  export declare function newConnection(): Connection;
package/dist/storage.d.ts CHANGED
@@ -328,12 +328,8 @@ export declare function getStorage(app?: FirebaseApp, bucketUrl?: string): Fireb
328
328
  * See the License for the specific language governing permissions and
329
329
  * limitations under the License.
330
330
  */
331
- /**
332
- * Network headers
333
- */
334
- declare interface Headers_2 {
335
- [name: string]: string;
336
- }
331
+ /** Network headers */
332
+ declare type Headers_2 = Record<string, string>;
337
333
 
338
334
  /**
339
335
  * Internal enum for task state.
@@ -580,6 +576,15 @@ declare interface Request_2<T> {
580
576
  cancel(appDelete?: boolean): void;
581
577
  }
582
578
 
579
+ /**
580
+ * A function that converts a server response to the API type expected by the
581
+ * SDK.
582
+ *
583
+ * @param I - the type of the backend's network response
584
+ * @param O - the output response type used by the rest of the SDK.
585
+ */
586
+ declare type RequestHandler<I, O> = (connection: Connection, response: I) => O;
587
+
583
588
  declare class RequestInfo_2<T> {
584
589
  url: string;
585
590
  method: string;
@@ -590,12 +595,12 @@ declare class RequestInfo_2<T> {
590
595
  * Note: The XhrIo passed to this function may be reused after this callback
591
596
  * returns. Do not keep a reference to it in any way.
592
597
  */
593
- handler: (p1: Connection, p2: string) => T;
598
+ handler: RequestHandler<string, T>;
594
599
  timeout: number;
595
600
  urlParams: UrlParams;
596
601
  headers: Headers_2;
597
602
  body: Blob | string | Uint8Array | null;
598
- errorHandler: ((p1: Connection, p2: StorageError_2) => StorageError_2) | null;
603
+ errorHandler: RequestHandler<StorageError_2, StorageError_2> | null;
599
604
  /**
600
605
  * Called with the current number of bytes uploaded and total size (-1 if not
601
606
  * computable) of the request body (i.e. used to report upload progress).
@@ -611,7 +616,7 @@ declare class RequestInfo_2<T> {
611
616
  * Note: The XhrIo passed to this function may be reused after this callback
612
617
  * returns. Do not keep a reference to it in any way.
613
618
  */
614
- handler: (p1: Connection, p2: string) => T, timeout: number);
619
+ handler: RequestHandler<string, T>, timeout: number);
615
620
  }
616
621
 
617
622
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/storage",
3
- "version": "0.8.3-canary.85d2c4d29",
3
+ "version": "0.8.3-canary.88ea06930",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -30,18 +30,18 @@
30
30
  },
31
31
  "license": "Apache-2.0",
32
32
  "dependencies": {
33
- "@firebase/util": "1.4.0-canary.85d2c4d29",
34
- "@firebase/component": "0.5.7-canary.85d2c4d29",
35
- "node-fetch": "2.6.2",
33
+ "@firebase/util": "1.4.0-canary.88ea06930",
34
+ "@firebase/component": "0.5.7-canary.88ea06930",
35
+ "node-fetch": "2.6.5",
36
36
  "tslib": "^2.1.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@firebase/app": "0.7.1-canary.85d2c4d29"
39
+ "@firebase/app": "0.7.2-canary.88ea06930"
40
40
  },
41
41
  "devDependencies": {
42
- "@firebase/app": "0.7.1-canary.85d2c4d29",
43
- "@firebase/auth": "0.18.0-canary.85d2c4d29",
44
- "rollup": "2.56.3",
42
+ "@firebase/app": "0.7.2-canary.88ea06930",
43
+ "@firebase/auth": "0.18.1-canary.88ea06930",
44
+ "rollup": "2.57.0",
45
45
  "@rollup/plugin-alias": "3.1.5",
46
46
  "@rollup/plugin-json": "4.1.0",
47
47
  "rollup-plugin-typescript2": "0.30.0",