@firebase/util 1.10.1 → 1.10.2-canary.0755a723d

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.
Files changed (81) hide show
  1. package/dist/index.cjs.js +2059 -2088
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +38 -39
  4. package/dist/index.esm2017.js +2060 -2088
  5. package/dist/index.esm2017.js.map +1 -1
  6. package/dist/index.node.cjs.js +2076 -2105
  7. package/dist/index.node.cjs.js.map +1 -1
  8. package/dist/index.node.d.ts +38 -39
  9. package/dist/node-esm/index.d.ts +38 -39
  10. package/dist/node-esm/index.node.d.ts +38 -39
  11. package/dist/node-esm/index.node.esm.js +2077 -2105
  12. package/dist/node-esm/index.node.esm.js.map +1 -1
  13. package/dist/node-esm/src/assert.d.ts +24 -24
  14. package/dist/node-esm/src/compat.d.ts +20 -20
  15. package/dist/node-esm/src/constants.d.ts +33 -33
  16. package/dist/node-esm/src/crypt.d.ts +66 -66
  17. package/dist/node-esm/src/deepCopy.d.ts +35 -35
  18. package/dist/node-esm/src/defaults.d.ts +79 -79
  19. package/dist/node-esm/src/deferred.d.ts +28 -28
  20. package/dist/node-esm/src/emulator.d.ts +47 -47
  21. package/dist/node-esm/src/environment.d.ts +90 -90
  22. package/dist/node-esm/src/errors.d.ts +87 -87
  23. package/dist/node-esm/src/exponential_backoff.d.ts +37 -37
  24. package/dist/node-esm/src/formatters.d.ts +20 -20
  25. package/dist/node-esm/src/global.d.ts +22 -22
  26. package/dist/node-esm/src/json.d.ts +29 -29
  27. package/dist/node-esm/src/jwt.d.ts +73 -73
  28. package/dist/node-esm/src/obj.d.ts +30 -30
  29. package/dist/node-esm/src/promise.d.ts +21 -21
  30. package/dist/node-esm/src/query.d.ts +33 -33
  31. package/dist/node-esm/src/sha1.d.ts +84 -84
  32. package/dist/node-esm/src/subscribe.d.ts +49 -49
  33. package/dist/node-esm/src/utf8.d.ts +27 -27
  34. package/dist/node-esm/src/validation.d.ts +43 -43
  35. package/dist/node-esm/test/base64.test.d.ts +1 -1
  36. package/dist/node-esm/test/compat.test.d.ts +17 -17
  37. package/dist/node-esm/test/deepCopy.test.d.ts +1 -1
  38. package/dist/node-esm/test/defaults.test.d.ts +1 -1
  39. package/dist/node-esm/test/emulator.test.d.ts +1 -1
  40. package/dist/node-esm/test/environments.test.d.ts +17 -17
  41. package/dist/node-esm/test/errors.test.d.ts +1 -1
  42. package/dist/node-esm/test/exponential_backoff.test.d.ts +17 -17
  43. package/dist/node-esm/test/object.test.d.ts +17 -17
  44. package/dist/node-esm/test/subscribe.test.d.ts +17 -17
  45. package/dist/src/assert.d.ts +24 -24
  46. package/dist/src/compat.d.ts +20 -20
  47. package/dist/src/constants.d.ts +33 -33
  48. package/dist/src/crypt.d.ts +66 -66
  49. package/dist/src/deepCopy.d.ts +35 -35
  50. package/dist/src/defaults.d.ts +79 -79
  51. package/dist/src/deferred.d.ts +28 -28
  52. package/dist/src/emulator.d.ts +47 -47
  53. package/dist/src/environment.d.ts +90 -90
  54. package/dist/src/errors.d.ts +87 -87
  55. package/dist/src/exponential_backoff.d.ts +37 -37
  56. package/dist/src/formatters.d.ts +20 -20
  57. package/dist/src/global.d.ts +22 -22
  58. package/dist/src/json.d.ts +29 -29
  59. package/dist/src/jwt.d.ts +73 -73
  60. package/dist/src/obj.d.ts +30 -30
  61. package/dist/src/promise.d.ts +21 -21
  62. package/dist/src/query.d.ts +33 -33
  63. package/dist/src/sha1.d.ts +84 -84
  64. package/dist/src/subscribe.d.ts +49 -49
  65. package/dist/src/utf8.d.ts +27 -27
  66. package/dist/src/validation.d.ts +43 -43
  67. package/dist/test/base64.test.d.ts +1 -1
  68. package/dist/test/compat.test.d.ts +17 -17
  69. package/dist/test/deepCopy.test.d.ts +1 -1
  70. package/dist/test/defaults.test.d.ts +1 -1
  71. package/dist/test/emulator.test.d.ts +1 -1
  72. package/dist/test/environments.test.d.ts +17 -17
  73. package/dist/test/errors.test.d.ts +1 -1
  74. package/dist/test/exponential_backoff.test.d.ts +17 -17
  75. package/dist/test/object.test.d.ts +17 -17
  76. package/dist/test/subscribe.test.d.ts +17 -17
  77. package/dist/util-public.d.ts +0 -7
  78. package/dist/util.d.ts +0 -7
  79. package/package.json +2 -2
  80. package/dist/node-esm/src/uuid.d.ts +0 -22
  81. package/dist/src/uuid.d.ts +0 -22
@@ -1,35 +1,35 @@
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
- * Do a deep-copy of basic JavaScript Objects or Arrays.
19
- */
20
- export declare function deepCopy<T>(value: T): T;
21
- /**
22
- * Copy properties from source to target (recursively allows extension
23
- * of Objects and Arrays). Scalar values in the target are over-written.
24
- * If target is undefined, an object of the appropriate type will be created
25
- * (and returned).
26
- *
27
- * We recursively copy all child properties of plain Objects in the source- so
28
- * that namespace- like dictionaries are merged.
29
- *
30
- * Note that the target can be a function, in which case the properties in
31
- * the source Object are copied onto it as static properties of the Function.
32
- *
33
- * Note: we don't merge __proto__ to prevent prototype pollution
34
- */
35
- export declare function deepExtend(target: unknown, source: unknown): unknown;
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
+ * Do a deep-copy of basic JavaScript Objects or Arrays.
19
+ */
20
+ export declare function deepCopy<T>(value: T): T;
21
+ /**
22
+ * Copy properties from source to target (recursively allows extension
23
+ * of Objects and Arrays). Scalar values in the target are over-written.
24
+ * If target is undefined, an object of the appropriate type will be created
25
+ * (and returned).
26
+ *
27
+ * We recursively copy all child properties of plain Objects in the source- so
28
+ * that namespace- like dictionaries are merged.
29
+ *
30
+ * Note that the target can be a function, in which case the properties in
31
+ * the source Object are copied onto it as static properties of the Function.
32
+ *
33
+ * Note: we don't merge __proto__ to prevent prototype pollution
34
+ */
35
+ export declare function deepExtend(target: unknown, source: unknown): unknown;
@@ -1,79 +1,79 @@
1
- /**
2
- * @license
3
- * Copyright 2022 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
- * Keys for experimental properties on the `FirebaseDefaults` object.
19
- * @public
20
- */
21
- export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';
22
- /**
23
- * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
24
- * either as a property of globalThis, a shell environment variable, or a
25
- * cookie.
26
- *
27
- * This object can be used to automatically configure and initialize
28
- * a Firebase app as well as any emulators.
29
- *
30
- * @public
31
- */
32
- export interface FirebaseDefaults {
33
- config?: Record<string, string>;
34
- emulatorHosts?: Record<string, string>;
35
- _authTokenSyncURL?: string;
36
- _authIdTokenMaxAge?: number;
37
- /**
38
- * Override Firebase's runtime environment detection and
39
- * force the SDK to act as if it were in the specified environment.
40
- */
41
- forceEnvironment?: 'browser' | 'node';
42
- [key: string]: unknown;
43
- }
44
- declare global {
45
- var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined;
46
- }
47
- /**
48
- * Get the __FIREBASE_DEFAULTS__ object. It checks in order:
49
- * (1) if such an object exists as a property of `globalThis`
50
- * (2) if such an object was provided on a shell environment variable
51
- * (3) if such an object exists in a cookie
52
- * @public
53
- */
54
- export declare const getDefaults: () => FirebaseDefaults | undefined;
55
- /**
56
- * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object
57
- * for the given product.
58
- * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available
59
- * @public
60
- */
61
- export declare const getDefaultEmulatorHost: (productName: string) => string | undefined;
62
- /**
63
- * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object
64
- * for the given product.
65
- * @returns a pair of hostname and port like `["::1", 4000]` if available
66
- * @public
67
- */
68
- export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
69
- /**
70
- * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.
71
- * @public
72
- */
73
- export declare const getDefaultAppConfig: () => Record<string, string> | undefined;
74
- /**
75
- * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties
76
- * prefixed by "_")
77
- * @public
78
- */
79
- export declare const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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
+ * Keys for experimental properties on the `FirebaseDefaults` object.
19
+ * @public
20
+ */
21
+ export type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';
22
+ /**
23
+ * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
24
+ * either as a property of globalThis, a shell environment variable, or a
25
+ * cookie.
26
+ *
27
+ * This object can be used to automatically configure and initialize
28
+ * a Firebase app as well as any emulators.
29
+ *
30
+ * @public
31
+ */
32
+ export interface FirebaseDefaults {
33
+ config?: Record<string, string>;
34
+ emulatorHosts?: Record<string, string>;
35
+ _authTokenSyncURL?: string;
36
+ _authIdTokenMaxAge?: number;
37
+ /**
38
+ * Override Firebase's runtime environment detection and
39
+ * force the SDK to act as if it were in the specified environment.
40
+ */
41
+ forceEnvironment?: 'browser' | 'node';
42
+ [key: string]: unknown;
43
+ }
44
+ declare global {
45
+ var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined;
46
+ }
47
+ /**
48
+ * Get the __FIREBASE_DEFAULTS__ object. It checks in order:
49
+ * (1) if such an object exists as a property of `globalThis`
50
+ * (2) if such an object was provided on a shell environment variable
51
+ * (3) if such an object exists in a cookie
52
+ * @public
53
+ */
54
+ export declare const getDefaults: () => FirebaseDefaults | undefined;
55
+ /**
56
+ * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object
57
+ * for the given product.
58
+ * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available
59
+ * @public
60
+ */
61
+ export declare const getDefaultEmulatorHost: (productName: string) => string | undefined;
62
+ /**
63
+ * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object
64
+ * for the given product.
65
+ * @returns a pair of hostname and port like `["::1", 4000]` if available
66
+ * @public
67
+ */
68
+ export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
69
+ /**
70
+ * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.
71
+ * @public
72
+ */
73
+ export declare const getDefaultAppConfig: () => Record<string, string> | undefined;
74
+ /**
75
+ * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties
76
+ * prefixed by "_")
77
+ * @public
78
+ */
79
+ export declare const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];
@@ -1,28 +1,28 @@
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
- export declare class Deferred<R> {
18
- promise: Promise<R>;
19
- reject: (value?: unknown) => void;
20
- resolve: (value?: unknown) => void;
21
- constructor();
22
- /**
23
- * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
24
- * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
25
- * and returns a node-style callback which will resolve or reject the Deferred's promise.
26
- */
27
- wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void;
28
- }
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
+ export declare class Deferred<R> {
18
+ promise: Promise<R>;
19
+ reject: (value?: unknown) => void;
20
+ resolve: (value?: unknown) => void;
21
+ constructor();
22
+ /**
23
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
24
+ * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
25
+ * and returns a node-style callback which will resolve or reject the Deferred's promise.
26
+ */
27
+ wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void;
28
+ }
@@ -1,47 +1,47 @@
1
- /**
2
- * @license
3
- * Copyright 2021 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 type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
18
- interface FirebaseIdToken {
19
- iss: string;
20
- aud: string;
21
- sub: string;
22
- iat: number;
23
- exp: number;
24
- user_id: string;
25
- auth_time: number;
26
- provider_id?: 'anonymous';
27
- email?: string;
28
- email_verified?: boolean;
29
- phone_number?: string;
30
- name?: string;
31
- picture?: string;
32
- firebase: {
33
- sign_in_provider: FirebaseSignInProvider;
34
- identities?: {
35
- [provider in FirebaseSignInProvider]?: string[];
36
- };
37
- };
38
- [claim: string]: unknown;
39
- uid?: never;
40
- }
41
- export declare type EmulatorMockTokenOptions = ({
42
- user_id: string;
43
- } | {
44
- sub: string;
45
- }) & Partial<FirebaseIdToken>;
46
- export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
47
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2021 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 type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
18
+ interface FirebaseIdToken {
19
+ iss: string;
20
+ aud: string;
21
+ sub: string;
22
+ iat: number;
23
+ exp: number;
24
+ user_id: string;
25
+ auth_time: number;
26
+ provider_id?: 'anonymous';
27
+ email?: string;
28
+ email_verified?: boolean;
29
+ phone_number?: string;
30
+ name?: string;
31
+ picture?: string;
32
+ firebase: {
33
+ sign_in_provider: FirebaseSignInProvider;
34
+ identities?: {
35
+ [provider in FirebaseSignInProvider]?: string[];
36
+ };
37
+ };
38
+ [claim: string]: unknown;
39
+ uid?: never;
40
+ }
41
+ export type EmulatorMockTokenOptions = ({
42
+ user_id: string;
43
+ } | {
44
+ sub: string;
45
+ }) & Partial<FirebaseIdToken>;
46
+ export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
47
+ export {};
@@ -1,90 +1,90 @@
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 navigator.userAgent string or '' if it's not defined.
19
- * @return user agent string
20
- */
21
- export declare function getUA(): string;
22
- /**
23
- * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
24
- *
25
- * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap
26
- * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally
27
- * wait for a callback.
28
- */
29
- export declare function isMobileCordova(): boolean;
30
- /**
31
- * Detect Node.js.
32
- *
33
- * @return true if Node.js environment is detected or specified.
34
- */
35
- export declare function isNode(): boolean;
36
- /**
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.
41
- */
42
- export declare function isBrowser(): boolean;
43
- /**
44
- * Detect Web Worker context.
45
- */
46
- export declare function isWebWorker(): boolean;
47
- /**
48
- * Detect Cloudflare Worker context.
49
- */
50
- export declare function isCloudflareWorker(): boolean;
51
- export declare function isBrowserExtension(): boolean;
52
- /**
53
- * Detect React Native.
54
- *
55
- * @return true if ReactNative environment is detected.
56
- */
57
- export declare function isReactNative(): boolean;
58
- /** Detects Electron apps. */
59
- export declare function isElectron(): boolean;
60
- /** Detects Internet Explorer. */
61
- export declare function isIE(): boolean;
62
- /** Detects Universal Windows Platform apps. */
63
- export declare function isUWP(): boolean;
64
- /**
65
- * Detect whether the current SDK build is the Node version.
66
- *
67
- * @return true if it's the Node SDK build.
68
- */
69
- export declare function isNodeSdk(): boolean;
70
- /** Returns true if we are running in Safari. */
71
- export declare function isSafari(): boolean;
72
- /**
73
- * This method checks if indexedDB is supported by current browser/service worker context
74
- * @return true if indexedDB is supported by current browser/service worker context
75
- */
76
- export declare function isIndexedDBAvailable(): boolean;
77
- /**
78
- * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject
79
- * if errors occur during the database open operation.
80
- *
81
- * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox
82
- * private browsing)
83
- */
84
- export declare function validateIndexedDBOpenable(): Promise<boolean>;
85
- /**
86
- *
87
- * This method checks whether cookie is enabled within current browser
88
- * @return true if cookie is enabled within current browser
89
- */
90
- export declare function areCookiesEnabled(): boolean;
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 navigator.userAgent string or '' if it's not defined.
19
+ * @return user agent string
20
+ */
21
+ export declare function getUA(): string;
22
+ /**
23
+ * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
24
+ *
25
+ * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap
26
+ * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally
27
+ * wait for a callback.
28
+ */
29
+ export declare function isMobileCordova(): boolean;
30
+ /**
31
+ * Detect Node.js.
32
+ *
33
+ * @return true if Node.js environment is detected or specified.
34
+ */
35
+ export declare function isNode(): boolean;
36
+ /**
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.
41
+ */
42
+ export declare function isBrowser(): boolean;
43
+ /**
44
+ * Detect Web Worker context.
45
+ */
46
+ export declare function isWebWorker(): boolean;
47
+ /**
48
+ * Detect Cloudflare Worker context.
49
+ */
50
+ export declare function isCloudflareWorker(): boolean;
51
+ export declare function isBrowserExtension(): boolean;
52
+ /**
53
+ * Detect React Native.
54
+ *
55
+ * @return true if ReactNative environment is detected.
56
+ */
57
+ export declare function isReactNative(): boolean;
58
+ /** Detects Electron apps. */
59
+ export declare function isElectron(): boolean;
60
+ /** Detects Internet Explorer. */
61
+ export declare function isIE(): boolean;
62
+ /** Detects Universal Windows Platform apps. */
63
+ export declare function isUWP(): boolean;
64
+ /**
65
+ * Detect whether the current SDK build is the Node version.
66
+ *
67
+ * @return true if it's the Node SDK build.
68
+ */
69
+ export declare function isNodeSdk(): boolean;
70
+ /** Returns true if we are running in Safari. */
71
+ export declare function isSafari(): boolean;
72
+ /**
73
+ * This method checks if indexedDB is supported by current browser/service worker context
74
+ * @return true if indexedDB is supported by current browser/service worker context
75
+ */
76
+ export declare function isIndexedDBAvailable(): boolean;
77
+ /**
78
+ * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject
79
+ * if errors occur during the database open operation.
80
+ *
81
+ * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox
82
+ * private browsing)
83
+ */
84
+ export declare function validateIndexedDBOpenable(): Promise<boolean>;
85
+ /**
86
+ *
87
+ * This method checks whether cookie is enabled within current browser
88
+ * @return true if cookie is enabled within current browser
89
+ */
90
+ export declare function areCookiesEnabled(): boolean;