@firebase/util 1.9.7-canary.fd8bd4b02 → 1.9.7-dataconnect-preview.d986d4bf2

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.
@@ -20,7 +20,7 @@ export declare class Deferred<R> {
20
20
  resolve: (value?: unknown) => void;
21
21
  constructor();
22
22
  /**
23
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
23
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
24
24
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
25
25
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
26
26
  */
@@ -35,6 +35,9 @@ export declare function isMobileCordova(): boolean;
35
35
  export declare function isNode(): boolean;
36
36
  /**
37
37
  * Detect Browser Environment
38
+ * Note: This will return true for certain test frameworks that are incompletely
39
+ * mimicking a browser, and should not lead to assuming all browser APIs are
40
+ * available.
38
41
  */
39
42
  export declare function isBrowser(): boolean;
40
43
  /**
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * Usage:
21
21
  *
22
- * // Typescript string literals for type-safe codes
22
+ * // TypeScript string literals for type-safe codes
23
23
  * type Err =
24
24
  * 'unknown' |
25
25
  * 'object-not-found'
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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
+ export declare class FetchProvider {
18
+ private static fetchImpl;
19
+ private static headersImpl;
20
+ private static responseImpl;
21
+ static initialize(fetchImpl: typeof fetch, headersImpl?: typeof Headers, responseImpl?: typeof Response): void;
22
+ static fetch(): typeof fetch;
23
+ static headers(): typeof Headers;
24
+ static response(): typeof Response;
25
+ }
@@ -23,7 +23,7 @@
23
23
  export declare function jsonEval(str: string): unknown;
24
24
  /**
25
25
  * Returns JSON representing a javascript object.
26
- * @param {*} data Javascript object to be stringified.
26
+ * @param {*} data JavaScript object to be stringified.
27
27
  * @return {string} The JSON contents of the object.
28
28
  */
29
29
  export declare function stringify(data: unknown): string;
@@ -20,7 +20,7 @@ export declare class Deferred<R> {
20
20
  resolve: (value?: unknown) => void;
21
21
  constructor();
22
22
  /**
23
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
23
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
24
24
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
25
25
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
26
26
  */
@@ -35,6 +35,9 @@ export declare function isMobileCordova(): boolean;
35
35
  export declare function isNode(): boolean;
36
36
  /**
37
37
  * Detect Browser Environment
38
+ * Note: This will return true for certain test frameworks that are incompletely
39
+ * mimicking a browser, and should not lead to assuming all browser APIs are
40
+ * available.
38
41
  */
39
42
  export declare function isBrowser(): boolean;
40
43
  /**
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * Usage:
21
21
  *
22
- * // Typescript string literals for type-safe codes
22
+ * // TypeScript string literals for type-safe codes
23
23
  * type Err =
24
24
  * 'unknown' |
25
25
  * 'object-not-found'
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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
+ export declare class FetchProvider {
18
+ private static fetchImpl;
19
+ private static headersImpl;
20
+ private static responseImpl;
21
+ static initialize(fetchImpl: typeof fetch, headersImpl?: typeof Headers, responseImpl?: typeof Response): void;
22
+ static fetch(): typeof fetch;
23
+ static headers(): typeof Headers;
24
+ static response(): typeof Response;
25
+ }
@@ -23,7 +23,7 @@
23
23
  export declare function jsonEval(str: string): unknown;
24
24
  /**
25
25
  * Returns JSON representing a javascript object.
26
- * @param {*} data Javascript object to be stringified.
26
+ * @param {*} data JavaScript object to be stringified.
27
27
  * @return {string} The JSON contents of the object.
28
28
  */
29
29
  export declare function stringify(data: unknown): string;
@@ -274,7 +274,7 @@ export declare class Deferred<R> {
274
274
  resolve: (value?: unknown) => void;
275
275
  constructor();
276
276
  /**
277
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
277
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
278
278
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
279
279
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
280
280
  */
@@ -324,7 +324,7 @@ export declare type ErrorFn = (error: Error) => void;
324
324
  *
325
325
  * Usage:
326
326
  *
327
- * // Typescript string literals for type-safe codes
327
+ * // TypeScript string literals for type-safe codes
328
328
  * type Err =
329
329
  * 'unknown' |
330
330
  * 'object-not-found'
@@ -401,6 +401,32 @@ export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';
401
401
  */
402
402
  export declare function extractQuerystring(url: string): string;
403
403
 
404
+ /**
405
+ * @license
406
+ * Copyright 2023 Google LLC
407
+ *
408
+ * Licensed under the Apache License, Version 2.0 (the "License");
409
+ * you may not use this file except in compliance with the License.
410
+ * You may obtain a copy of the License at
411
+ *
412
+ * http://www.apache.org/licenses/LICENSE-2.0
413
+ *
414
+ * Unless required by applicable law or agreed to in writing, software
415
+ * distributed under the License is distributed on an "AS IS" BASIS,
416
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
417
+ * See the License for the specific language governing permissions and
418
+ * limitations under the License.
419
+ */
420
+ export declare class FetchProvider {
421
+ private static fetchImpl;
422
+ private static headersImpl;
423
+ private static responseImpl;
424
+ static initialize(fetchImpl: typeof fetch, headersImpl?: typeof Headers, responseImpl?: typeof Response): void;
425
+ static fetch(): typeof fetch;
426
+ static headers(): typeof Headers;
427
+ static response(): typeof Response;
428
+ }
429
+
404
430
  /**
405
431
  * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
406
432
  * either as a property of globalThis, a shell environment variable, or a
@@ -576,6 +602,9 @@ export declare const isAdmin: (token: string) => boolean;
576
602
 
577
603
  /**
578
604
  * Detect Browser Environment
605
+ * Note: This will return true for certain test frameworks that are incompletely
606
+ * mimicking a browser, and should not lead to assuming all browser APIs are
607
+ * available.
579
608
  */
580
609
  export declare function isBrowser(): boolean;
581
610
 
@@ -886,7 +915,7 @@ export declare class Sha1 {
886
915
 
887
916
  /**
888
917
  * Returns JSON representing a javascript object.
889
- * @param {*} data Javascript object to be stringified.
918
+ * @param {*} data JavaScript object to be stringified.
890
919
  * @return {string} The JSON contents of the object.
891
920
  */
892
921
  export declare function stringify(data: unknown): string;
package/dist/util.d.ts CHANGED
@@ -274,7 +274,7 @@ export declare class Deferred<R> {
274
274
  resolve: (value?: unknown) => void;
275
275
  constructor();
276
276
  /**
277
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
277
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
278
278
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
279
279
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
280
280
  */
@@ -324,7 +324,7 @@ export declare type ErrorFn = (error: Error) => void;
324
324
  *
325
325
  * Usage:
326
326
  *
327
- * // Typescript string literals for type-safe codes
327
+ * // TypeScript string literals for type-safe codes
328
328
  * type Err =
329
329
  * 'unknown' |
330
330
  * 'object-not-found'
@@ -401,6 +401,32 @@ export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';
401
401
  */
402
402
  export declare function extractQuerystring(url: string): string;
403
403
 
404
+ /**
405
+ * @license
406
+ * Copyright 2023 Google LLC
407
+ *
408
+ * Licensed under the Apache License, Version 2.0 (the "License");
409
+ * you may not use this file except in compliance with the License.
410
+ * You may obtain a copy of the License at
411
+ *
412
+ * http://www.apache.org/licenses/LICENSE-2.0
413
+ *
414
+ * Unless required by applicable law or agreed to in writing, software
415
+ * distributed under the License is distributed on an "AS IS" BASIS,
416
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
417
+ * See the License for the specific language governing permissions and
418
+ * limitations under the License.
419
+ */
420
+ export declare class FetchProvider {
421
+ private static fetchImpl;
422
+ private static headersImpl;
423
+ private static responseImpl;
424
+ static initialize(fetchImpl: typeof fetch, headersImpl?: typeof Headers, responseImpl?: typeof Response): void;
425
+ static fetch(): typeof fetch;
426
+ static headers(): typeof Headers;
427
+ static response(): typeof Response;
428
+ }
429
+
404
430
  /**
405
431
  * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
406
432
  * either as a property of globalThis, a shell environment variable, or a
@@ -576,6 +602,9 @@ export declare const isAdmin: (token: string) => boolean;
576
602
 
577
603
  /**
578
604
  * Detect Browser Environment
605
+ * Note: This will return true for certain test frameworks that are incompletely
606
+ * mimicking a browser, and should not lead to assuming all browser APIs are
607
+ * available.
579
608
  */
580
609
  export declare function isBrowser(): boolean;
581
610
 
@@ -906,7 +935,7 @@ export declare class Sha1 {
906
935
 
907
936
  /**
908
937
  * Returns JSON representing a javascript object.
909
- * @param {*} data Javascript object to be stringified.
938
+ * @param {*} data JavaScript object to be stringified.
910
939
  * @return {string} The JSON contents of the object.
911
940
  */
912
941
  export declare function stringify(data: unknown): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/util",
3
- "version": "1.9.7-canary.fd8bd4b02",
3
+ "version": "1.9.7-dataconnect-preview.d986d4bf2",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",