@firebase/storage 0.13.3 → 0.13.4
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.
- package/dist/index.browser.cjs.js +3571 -3571
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.cjs.js +3571 -3571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +3571 -3571
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +3596 -3596
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +3596 -3596
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api.browser.d.ts +47 -47
- package/dist/node-esm/src/api.d.ts +200 -200
- package/dist/node-esm/src/api.node.d.ts +47 -47
- package/dist/node-esm/src/constants.d.ts +20 -20
- package/dist/node-esm/src/implementation/async.d.ts +22 -22
- package/dist/node-esm/src/implementation/backoff.d.ts +43 -43
- package/dist/node-esm/src/implementation/blob.d.ts +34 -34
- package/dist/node-esm/src/implementation/connection.d.ts +56 -56
- package/dist/node-esm/src/implementation/constants.d.ts +48 -48
- package/dist/node-esm/src/implementation/error.d.ts +126 -126
- package/dist/node-esm/src/implementation/failrequest.d.ts +29 -29
- package/dist/node-esm/src/implementation/fs.d.ts +17 -17
- package/dist/node-esm/src/implementation/json.d.ts +7 -7
- package/dist/node-esm/src/implementation/list.d.ts +19 -19
- package/dist/node-esm/src/implementation/location.d.ts +32 -32
- package/dist/node-esm/src/implementation/metadata.d.ts +40 -40
- package/dist/node-esm/src/implementation/observer.d.ts +47 -47
- package/dist/node-esm/src/implementation/path.d.ts +31 -31
- package/dist/node-esm/src/implementation/request.d.ts +47 -47
- package/dist/node-esm/src/implementation/requestinfo.d.ts +73 -73
- package/dist/node-esm/src/implementation/requests.d.ts +84 -84
- package/dist/node-esm/src/implementation/string.d.ts +73 -73
- package/dist/node-esm/src/implementation/taskenums.d.ts +77 -77
- package/dist/node-esm/src/implementation/type.d.ts +23 -23
- package/dist/node-esm/src/implementation/url.d.ts +22 -22
- package/dist/node-esm/src/implementation/utils.d.ts +23 -23
- package/dist/node-esm/src/index.d.ts +7 -7
- package/dist/node-esm/src/index.node.d.ts +7 -7
- package/dist/node-esm/src/list.d.ts +41 -41
- package/dist/node-esm/src/metadata.d.ts +27 -27
- package/dist/node-esm/src/platform/base64.d.ts +20 -20
- package/dist/node-esm/src/platform/browser/base64.d.ts +19 -19
- package/dist/node-esm/src/platform/browser/connection.d.ts +55 -55
- package/dist/node-esm/src/platform/connection.d.ts +22 -22
- package/dist/node-esm/src/platform/node/base64.d.ts +19 -19
- package/dist/node-esm/src/platform/node/connection.d.ts +58 -59
- package/dist/node-esm/src/public-types.d.ts +424 -424
- package/dist/node-esm/src/reference.d.ts +208 -208
- package/dist/node-esm/src/service.d.ts +130 -130
- package/dist/node-esm/src/task.d.ts +148 -148
- package/dist/node-esm/test/browser/blob.test.d.ts +17 -17
- package/dist/node-esm/test/browser/connection.test.d.ts +17 -17
- package/dist/node-esm/test/browser/string.browser.test.d.ts +17 -17
- package/dist/node-esm/test/integration/integration.test.d.ts +24 -24
- package/dist/node-esm/test/node/connection.test.d.ts +17 -17
- package/dist/node-esm/test/node/stream.test.d.ts +17 -17
- package/dist/node-esm/test/unit/connection.d.ts +47 -47
- package/dist/node-esm/test/unit/index.test.d.ts +4 -4
- package/dist/node-esm/test/unit/location.test.d.ts +1 -1
- package/dist/node-esm/test/unit/reference.test.d.ts +1 -1
- package/dist/node-esm/test/unit/request.test.d.ts +1 -1
- package/dist/node-esm/test/unit/requests.test.d.ts +1 -1
- package/dist/node-esm/test/unit/service.test.d.ts +1 -1
- package/dist/node-esm/test/unit/string.test.d.ts +1 -1
- package/dist/node-esm/test/unit/task.test.d.ts +1 -1
- package/dist/node-esm/test/unit/testshared.d.ts +60 -60
- package/dist/node-esm/test/unit/utils.test.d.ts +17 -17
- package/dist/src/api.browser.d.ts +47 -47
- package/dist/src/api.d.ts +200 -200
- package/dist/src/api.node.d.ts +47 -47
- package/dist/src/constants.d.ts +20 -20
- package/dist/src/implementation/async.d.ts +22 -22
- package/dist/src/implementation/backoff.d.ts +43 -43
- package/dist/src/implementation/blob.d.ts +34 -34
- package/dist/src/implementation/connection.d.ts +56 -56
- package/dist/src/implementation/constants.d.ts +48 -48
- package/dist/src/implementation/error.d.ts +126 -126
- package/dist/src/implementation/failrequest.d.ts +29 -29
- package/dist/src/implementation/fs.d.ts +17 -17
- package/dist/src/implementation/json.d.ts +7 -7
- package/dist/src/implementation/list.d.ts +19 -19
- package/dist/src/implementation/location.d.ts +32 -32
- package/dist/src/implementation/metadata.d.ts +40 -40
- package/dist/src/implementation/observer.d.ts +47 -47
- package/dist/src/implementation/path.d.ts +31 -31
- package/dist/src/implementation/request.d.ts +47 -47
- package/dist/src/implementation/requestinfo.d.ts +73 -73
- package/dist/src/implementation/requests.d.ts +84 -84
- package/dist/src/implementation/string.d.ts +73 -73
- package/dist/src/implementation/taskenums.d.ts +77 -77
- package/dist/src/implementation/type.d.ts +23 -23
- package/dist/src/implementation/url.d.ts +22 -22
- package/dist/src/implementation/utils.d.ts +23 -23
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.node.d.ts +7 -7
- package/dist/src/list.d.ts +41 -41
- package/dist/src/metadata.d.ts +27 -27
- package/dist/src/platform/base64.d.ts +20 -20
- package/dist/src/platform/browser/base64.d.ts +19 -19
- package/dist/src/platform/browser/connection.d.ts +55 -55
- package/dist/src/platform/connection.d.ts +22 -22
- package/dist/src/platform/node/base64.d.ts +19 -19
- package/dist/src/platform/node/connection.d.ts +58 -59
- package/dist/src/public-types.d.ts +424 -424
- package/dist/src/reference.d.ts +208 -208
- package/dist/src/service.d.ts +130 -130
- package/dist/src/task.d.ts +148 -148
- package/dist/test/browser/blob.test.d.ts +17 -17
- package/dist/test/browser/connection.test.d.ts +17 -17
- package/dist/test/browser/string.browser.test.d.ts +17 -17
- package/dist/test/integration/integration.test.d.ts +24 -24
- package/dist/test/node/connection.test.d.ts +17 -17
- package/dist/test/node/stream.test.d.ts +17 -17
- package/dist/test/unit/connection.d.ts +47 -47
- package/dist/test/unit/index.test.d.ts +4 -4
- package/dist/test/unit/location.test.d.ts +1 -1
- package/dist/test/unit/reference.test.d.ts +1 -1
- package/dist/test/unit/request.test.d.ts +1 -1
- package/dist/test/unit/requests.test.d.ts +1 -1
- package/dist/test/unit/service.test.d.ts +1 -1
- package/dist/test/unit/string.test.d.ts +1 -1
- package/dist/test/unit/task.test.d.ts +1 -1
- package/dist/test/unit/testshared.d.ts +60 -60
- package/dist/test/unit/utils.test.d.ts +17 -17
- package/package.json +6 -6
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Returns a function that invokes f with its arguments asynchronously as a
|
|
19
|
-
* microtask, i.e. as soon as possible after the current script returns back
|
|
20
|
-
* into browser code.
|
|
21
|
-
*/
|
|
22
|
-
export declare function async(f: Function): Function;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Returns a function that invokes f with its arguments asynchronously as a
|
|
19
|
+
* microtask, i.e. as soon as possible after the current script returns back
|
|
20
|
+
* into browser code.
|
|
21
|
+
*/
|
|
22
|
+
export declare function async(f: Function): Function;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* @fileoverview Provides a method for running a function with exponential
|
|
19
|
-
* backoff.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export { id };
|
|
23
|
-
/**
|
|
24
|
-
* Accepts a callback for an action to perform (`doRequest`),
|
|
25
|
-
* and then a callback for when the backoff has completed (`backoffCompleteCb`).
|
|
26
|
-
* The callback sent to start requires an argument to call (`onRequestComplete`).
|
|
27
|
-
* When `start` calls `doRequest`, it passes a callback for when the request has
|
|
28
|
-
* completed, `onRequestComplete`. Based on this, the backoff continues, with
|
|
29
|
-
* another call to `doRequest` and the above loop continues until the timeout
|
|
30
|
-
* is hit, or a successful response occurs.
|
|
31
|
-
* @description
|
|
32
|
-
* @param doRequest Callback to perform request
|
|
33
|
-
* @param backoffCompleteCb Callback to call when backoff has been completed
|
|
34
|
-
*/
|
|
35
|
-
export declare function start(doRequest: (onRequestComplete: (success: boolean) => void, canceled: boolean) => void, backoffCompleteCb: (...args: any[]) => unknown, timeout: number): id;
|
|
36
|
-
/**
|
|
37
|
-
* Stops the retry loop from repeating.
|
|
38
|
-
* If the function is currently "in between" retries, it is invoked immediately
|
|
39
|
-
* with the second parameter as "true". Otherwise, it will be invoked once more
|
|
40
|
-
* after the current invocation finishes iff the current invocation would have
|
|
41
|
-
* triggered another retry.
|
|
42
|
-
*/
|
|
43
|
-
export declare function stop(id: id): void;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @fileoverview Provides a method for running a function with exponential
|
|
19
|
+
* backoff.
|
|
20
|
+
*/
|
|
21
|
+
type id = (p1: boolean) => void;
|
|
22
|
+
export { id };
|
|
23
|
+
/**
|
|
24
|
+
* Accepts a callback for an action to perform (`doRequest`),
|
|
25
|
+
* and then a callback for when the backoff has completed (`backoffCompleteCb`).
|
|
26
|
+
* The callback sent to start requires an argument to call (`onRequestComplete`).
|
|
27
|
+
* When `start` calls `doRequest`, it passes a callback for when the request has
|
|
28
|
+
* completed, `onRequestComplete`. Based on this, the backoff continues, with
|
|
29
|
+
* another call to `doRequest` and the above loop continues until the timeout
|
|
30
|
+
* is hit, or a successful response occurs.
|
|
31
|
+
* @description
|
|
32
|
+
* @param doRequest Callback to perform request
|
|
33
|
+
* @param backoffCompleteCb Callback to call when backoff has been completed
|
|
34
|
+
*/
|
|
35
|
+
export declare function start(doRequest: (onRequestComplete: (success: boolean) => void, canceled: boolean) => void, backoffCompleteCb: (...args: any[]) => unknown, timeout: number): id;
|
|
36
|
+
/**
|
|
37
|
+
* Stops the retry loop from repeating.
|
|
38
|
+
* If the function is currently "in between" retries, it is invoked immediately
|
|
39
|
+
* with the second parameter as "true". Otherwise, it will be invoked once more
|
|
40
|
+
* after the current invocation finishes iff the current invocation would have
|
|
41
|
+
* triggered another retry.
|
|
42
|
+
*/
|
|
43
|
+
export declare function stop(id: id): void;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* @param opt_elideCopy - If true, doesn't copy mutable input data
|
|
19
|
-
* (e.g. Uint8Arrays). Pass true only if you know the objects will not be
|
|
20
|
-
* modified after this blob's construction.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export declare class FbsBlob {
|
|
25
|
-
private data_;
|
|
26
|
-
private size_;
|
|
27
|
-
private type_;
|
|
28
|
-
constructor(data: Blob | Uint8Array | ArrayBuffer, elideCopy?: boolean);
|
|
29
|
-
size(): number;
|
|
30
|
-
type(): string;
|
|
31
|
-
slice(startByte: number, endByte: number): FbsBlob | null;
|
|
32
|
-
static getBlob(...args: Array<string | FbsBlob>): FbsBlob | null;
|
|
33
|
-
uploadData(): Blob | Uint8Array;
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @param opt_elideCopy - If true, doesn't copy mutable input data
|
|
19
|
+
* (e.g. Uint8Arrays). Pass true only if you know the objects will not be
|
|
20
|
+
* modified after this blob's construction.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare class FbsBlob {
|
|
25
|
+
private data_;
|
|
26
|
+
private size_;
|
|
27
|
+
private type_;
|
|
28
|
+
constructor(data: Blob | Uint8Array | ArrayBuffer, elideCopy?: boolean);
|
|
29
|
+
size(): number;
|
|
30
|
+
type(): string;
|
|
31
|
+
slice(startByte: number, endByte: number): FbsBlob | null;
|
|
32
|
+
static getBlob(...args: Array<string | FbsBlob>): FbsBlob | null;
|
|
33
|
+
uploadData(): Blob | Uint8Array;
|
|
34
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/** Network headers */
|
|
18
|
-
export
|
|
19
|
-
/** Response type exposed by the networking APIs. */
|
|
20
|
-
export
|
|
21
|
-
/**
|
|
22
|
-
* A lightweight wrapper around XMLHttpRequest with a
|
|
23
|
-
* goog.net.XhrIo-like interface.
|
|
24
|
-
*
|
|
25
|
-
* You can create a new connection by invoking `newTextConnection()`,
|
|
26
|
-
* `newBytesConnection()` or `newStreamConnection()`.
|
|
27
|
-
*/
|
|
28
|
-
export interface Connection<T extends ConnectionType> {
|
|
29
|
-
/**
|
|
30
|
-
* Sends a request to the provided URL.
|
|
31
|
-
*
|
|
32
|
-
* This method never rejects its promise. In case of encountering an error,
|
|
33
|
-
* it sets an error code internally which can be accessed by calling
|
|
34
|
-
* getErrorCode() by callers.
|
|
35
|
-
*/
|
|
36
|
-
send(url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers): Promise<void>;
|
|
37
|
-
getErrorCode(): ErrorCode;
|
|
38
|
-
getStatus(): number;
|
|
39
|
-
getResponse(): T;
|
|
40
|
-
getErrorText(): string;
|
|
41
|
-
/**
|
|
42
|
-
* Abort the request.
|
|
43
|
-
*/
|
|
44
|
-
abort(): void;
|
|
45
|
-
getResponseHeader(header: string): string | null;
|
|
46
|
-
addUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
|
|
47
|
-
removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Error codes for requests made by the XhrIo wrapper.
|
|
51
|
-
*/
|
|
52
|
-
export declare enum ErrorCode {
|
|
53
|
-
NO_ERROR = 0,
|
|
54
|
-
NETWORK_ERROR = 1,
|
|
55
|
-
ABORT = 2
|
|
56
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/** Network headers */
|
|
18
|
+
export type Headers = Record<string, string>;
|
|
19
|
+
/** Response type exposed by the networking APIs. */
|
|
20
|
+
export type ConnectionType = string | ArrayBuffer | Blob | ReadableStream<Uint8Array>;
|
|
21
|
+
/**
|
|
22
|
+
* A lightweight wrapper around XMLHttpRequest with a
|
|
23
|
+
* goog.net.XhrIo-like interface.
|
|
24
|
+
*
|
|
25
|
+
* You can create a new connection by invoking `newTextConnection()`,
|
|
26
|
+
* `newBytesConnection()` or `newStreamConnection()`.
|
|
27
|
+
*/
|
|
28
|
+
export interface Connection<T extends ConnectionType> {
|
|
29
|
+
/**
|
|
30
|
+
* Sends a request to the provided URL.
|
|
31
|
+
*
|
|
32
|
+
* This method never rejects its promise. In case of encountering an error,
|
|
33
|
+
* it sets an error code internally which can be accessed by calling
|
|
34
|
+
* getErrorCode() by callers.
|
|
35
|
+
*/
|
|
36
|
+
send(url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers): Promise<void>;
|
|
37
|
+
getErrorCode(): ErrorCode;
|
|
38
|
+
getStatus(): number;
|
|
39
|
+
getResponse(): T;
|
|
40
|
+
getErrorText(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Abort the request.
|
|
43
|
+
*/
|
|
44
|
+
abort(): void;
|
|
45
|
+
getResponseHeader(header: string): string | null;
|
|
46
|
+
addUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
|
|
47
|
+
removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Error codes for requests made by the XhrIo wrapper.
|
|
51
|
+
*/
|
|
52
|
+
export declare enum ErrorCode {
|
|
53
|
+
NO_ERROR = 0,
|
|
54
|
+
NETWORK_ERROR = 1,
|
|
55
|
+
ABORT = 2
|
|
56
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* @fileoverview Constants used in the Firebase Storage library.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Domain name for firebase storage.
|
|
22
|
-
*/
|
|
23
|
-
export declare const DEFAULT_HOST = "firebasestorage.googleapis.com";
|
|
24
|
-
/**
|
|
25
|
-
* The key in Firebase config json for the storage bucket.
|
|
26
|
-
*/
|
|
27
|
-
export declare const CONFIG_STORAGE_BUCKET_KEY = "storageBucket";
|
|
28
|
-
/**
|
|
29
|
-
* 2 minutes
|
|
30
|
-
*
|
|
31
|
-
* The timeout for all operations except upload.
|
|
32
|
-
*/
|
|
33
|
-
export declare const DEFAULT_MAX_OPERATION_RETRY_TIME: number;
|
|
34
|
-
/**
|
|
35
|
-
* 10 minutes
|
|
36
|
-
*
|
|
37
|
-
* The timeout for upload.
|
|
38
|
-
*/
|
|
39
|
-
export declare const DEFAULT_MAX_UPLOAD_RETRY_TIME: number;
|
|
40
|
-
/**
|
|
41
|
-
* 1 second
|
|
42
|
-
*/
|
|
43
|
-
export declare const DEFAULT_MIN_SLEEP_TIME_MILLIS = 1000;
|
|
44
|
-
/**
|
|
45
|
-
* This is the value of Number.MIN_SAFE_INTEGER, which is not well supported
|
|
46
|
-
* enough for us to use it directly.
|
|
47
|
-
*/
|
|
48
|
-
export declare const MIN_SAFE_INTEGER = -9007199254740991;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @fileoverview Constants used in the Firebase Storage library.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Domain name for firebase storage.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_HOST = "firebasestorage.googleapis.com";
|
|
24
|
+
/**
|
|
25
|
+
* The key in Firebase config json for the storage bucket.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CONFIG_STORAGE_BUCKET_KEY = "storageBucket";
|
|
28
|
+
/**
|
|
29
|
+
* 2 minutes
|
|
30
|
+
*
|
|
31
|
+
* The timeout for all operations except upload.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_MAX_OPERATION_RETRY_TIME: number;
|
|
34
|
+
/**
|
|
35
|
+
* 10 minutes
|
|
36
|
+
*
|
|
37
|
+
* The timeout for upload.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEFAULT_MAX_UPLOAD_RETRY_TIME: number;
|
|
40
|
+
/**
|
|
41
|
+
* 1 second
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_MIN_SLEEP_TIME_MILLIS = 1000;
|
|
44
|
+
/**
|
|
45
|
+
* This is the value of Number.MIN_SAFE_INTEGER, which is not well supported
|
|
46
|
+
* enough for us to use it directly.
|
|
47
|
+
*/
|
|
48
|
+
export declare const MIN_SAFE_INTEGER = -9007199254740991;
|