@firebase/app-compat 0.2.45 → 0.2.46
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/esm/index.esm2017.js +408 -408
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/errors.d.ts +28 -28
- package/dist/esm/src/firebaseApp.d.ts +91 -91
- package/dist/esm/src/firebaseNamespace.d.ts +26 -26
- package/dist/esm/src/firebaseNamespaceCore.d.ts +27 -27
- package/dist/esm/src/index.d.ts +26 -26
- package/dist/esm/src/index.lite.d.ts +18 -18
- package/dist/esm/src/lite/firebaseAppLite.d.ts +49 -49
- package/dist/esm/src/lite/firebaseNamespaceLite.d.ts +18 -18
- package/dist/esm/src/logger.d.ts +18 -18
- package/dist/esm/src/public-types.d.ts +100 -100
- package/dist/esm/src/registerCoreComponents.d.ts +17 -17
- package/dist/esm/src/types.d.ts +71 -71
- package/dist/esm/test/firebaseAppCompat.test.d.ts +17 -17
- package/dist/esm/test/setup.d.ts +17 -17
- package/dist/esm/test/util.d.ts +28 -28
- package/dist/index.cjs.js +408 -408
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.lite.js +317 -317
- package/dist/index.lite.js.map +1 -1
- package/dist/src/errors.d.ts +28 -28
- package/dist/src/firebaseApp.d.ts +91 -91
- package/dist/src/firebaseNamespace.d.ts +26 -26
- package/dist/src/firebaseNamespaceCore.d.ts +27 -27
- package/dist/src/index.d.ts +26 -26
- package/dist/src/index.lite.d.ts +18 -18
- package/dist/src/lite/firebaseAppLite.d.ts +49 -49
- package/dist/src/lite/firebaseNamespaceLite.d.ts +18 -18
- package/dist/src/logger.d.ts +18 -18
- package/dist/src/public-types.d.ts +100 -100
- package/dist/src/registerCoreComponents.d.ts +17 -17
- package/dist/src/types.d.ts +71 -71
- package/dist/test/firebaseAppCompat.test.d.ts +17 -17
- package/dist/test/setup.d.ts +17 -17
- package/dist/test/util.d.ts +28 -28
- package/package.json +6 -6
package/dist/index.lite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.lite.js","sources":["../src/lite/firebaseAppLite.ts","../src/errors.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../src/registerCoreComponents.ts","../src/index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '../public-types';\nimport { _FirebaseNamespace, _FirebaseService } from '../types';\nimport {\n deleteApp,\n _addComponent,\n _DEFAULT_ENTRY_NAME,\n _FirebaseAppInternal as FirebaseAppExp\n} from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\nimport { Compat } from '@firebase/util';\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl\n implements FirebaseApp, Compat<FirebaseAppExp>\n{\n constructor(\n readonly _delegate: FirebaseAppExp,\n private readonly firebase: _FirebaseNamespace\n ) {\n // add itself to container\n _addComponent(\n _delegate,\n new Component('app-compat', () => this, ComponentType.PUBLIC)\n );\n }\n\n get automaticDataCollectionEnabled(): boolean {\n return this._delegate.automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n return this._delegate.name;\n }\n\n get options(): FirebaseOptions {\n return this._delegate.options;\n }\n\n delete(): Promise<void> {\n this.firebase.INTERNAL.removeApp(this.name);\n return deleteApp(this._delegate);\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): _FirebaseService {\n this._delegate.checkDestroyed();\n\n // getImmediate will always succeed because _getService is only called for registered components.\n return this._delegate.container.getProvider(name as Name).getImmediate({\n identifier: instanceIdentifier\n }) as unknown as _FirebaseService;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\ntype ErrorParams = { [key in AppError]: { appName: string } };\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app-compat',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from './public-types';\nimport {\n _FirebaseNamespace,\n _FirebaseService,\n FirebaseServiceNamespace\n} from './types';\nimport * as modularAPIs from '@firebase/app';\nimport { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\n\nimport { deepExtend, contains } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): _FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // const components = new Map<string, Component<any>>();\n\n // A namespace is a plain JavaScript Object.\n const namespace: _FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeAppCompat,\n // @ts-ignore\n app,\n registerVersion: modularAPIs.registerVersion,\n setLogLevel: modularAPIs.setLogLevel,\n onLog: modularAPIs.onLog,\n // @ts-ignore\n apps: null,\n SDK_VERSION: modularAPIs.SDK_VERSION,\n INTERNAL: {\n registerComponent: registerComponentCompat,\n removeApp,\n useAsService,\n modularAPIs\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)['default'] = namespace;\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || modularAPIs._DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n return apps[name];\n }\n\n // @ts-ignore\n app['App'] = firebaseAppImpl;\n\n /**\n * Create a new App instance (name must be unique).\n *\n * This function is idempotent. It can be called more than once and return the same instance using the same options and config.\n */\n function initializeAppCompat(\n options: FirebaseOptions,\n rawConfig = {}\n ): FirebaseApp {\n const app = modularAPIs.initializeApp(\n options,\n rawConfig\n ) as _FirebaseAppExp;\n\n if (contains(apps, app.name)) {\n return apps[app.name];\n }\n\n const appCompat = new firebaseAppImpl(app, namespace);\n apps[app.name] = appCompat;\n return appCompat;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n function registerComponentCompat<T extends Name>(\n component: Component<T>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n const componentName = component.name;\n const componentNameWithoutCompat = componentName.replace('-compat', '');\n if (\n modularAPIs._registerComponent(component) &&\n component.type === ComponentType.PUBLIC\n ) {\n // create service namespace for public components\n // The Service namespace is an accessor function ...\n const serviceNamespace = (\n appArg: FirebaseApp = app()\n ): _FirebaseService => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (appArg as any)[componentNameWithoutCompat] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(AppError.INVALID_APP_ARGUMENT, {\n appName: componentName\n });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (appArg as any)[componentNameWithoutCompat]();\n };\n\n // ... and a container for service-level properties.\n if (component.serviceProps !== undefined) {\n deepExtend(serviceNamespace, component.serviceProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (firebaseAppImpl.prototype as any)[componentNameWithoutCompat] =\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\n // option added to the no-explicit-any rule when ESlint releases it.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (...args: any) {\n const serviceFxn = this._getService.bind(this, componentName);\n return serviceFxn.apply(\n this,\n component.multipleInstances ? args : []\n );\n };\n }\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat]\n : null;\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '../public-types';\nimport { FirebaseServiceNamespace, _FirebaseService } from '../types';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\nimport { Component, ComponentType } from '@firebase/component';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`;\n\n const registerComponent = namespace.INTERNAL.registerComponent;\n namespace.INTERNAL.registerComponent = registerComponentForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerComponentForLite(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: Component<any>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n // only allow performance to register with firebase lite\n if (\n component.type === ComponentType.PUBLIC &&\n !component.name.includes('performance') &&\n !component.name.includes('installations')\n ) {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerComponent(component);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerVersion } from '@firebase/app';\n\nimport { name, version } from '../package.json';\n\nexport function registerCoreComponents(variant?: string): void {\n // Register `app` package.\n registerVersion(name, version, variant);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './lite/firebaseNamespaceLite';\nimport { registerCoreComponents } from './registerCoreComponents';\n\nconst firebase = createFirebaseNamespaceLite();\n\nregisterCoreComponents('lite');\n\n// eslint-disable-next-line import/no-default-export\nexport default firebase;\n"],"names":["name"],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAaH;;;AAGG;MACU,mBAAmB,CAAA;IAG9B,WACW,CAAA,SAAyB,EACjB,QAA4B,EAAA;QADpC,IAAS,CAAA,SAAA,GAAT,SAAS,CAAgB;QACjB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAoB;;AAG7C,QAAA,aAAa,CACX,SAAS,EACT,IAAI,SAAS,CAAC,YAAY,EAAE,MAAM,IAAI,EAAA,QAAA,4BAAuB,CAC9D,CAAC;KACH;AAED,IAAA,IAAI,8BAA8B,GAAA;AAChC,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;KACtD;IAED,IAAI,8BAA8B,CAAC,GAAG,EAAA;AACpC,QAAA,IAAI,CAAC,8BAA8B,GAAG,GAAG,CAAC;KAC3C;AAED,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC5B;AAED,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC/B;IAED,MAAM,GAAA;QACJ,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,QAAA,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAClC;AAED;;;;;;;;;;;;;AAaG;AACH,IAAA,WAAW,CACT,IAAY,EACZ,kBAAA,GAA6B,mBAAmB,EAAA;AAEhD,QAAA,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;;AAGhC,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,IAAY,CAAC,CAAC,YAAY,CAAC;AACrE,YAAA,UAAU,EAAE,kBAAkB;AAC/B,SAAA,CAAgC,CA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,SAAS,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IAEnE,SAAS,CAAC,WAAW,GAAG,CAAA,EAAG,SAAS,CAAC,WAAW,OAAO,CAAC;AAExD,IAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC/D,IAAA,SAAS,CAAC,QAAQ,CAAC,iBAAiB,GAAG,wBAAwB,CAAC;AAEhE;;;AAGG;AACH,IAAA,SAAS,wBAAwB;;IAE/B,SAAyB,EAAA;;QAGzB,IACE,SAAS,CAAC,IAAI,KAAyB,QAAA;AACvC,YAAA,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YACvC,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EACzC;AACA,YAAA,MAAM,KAAK,CAAC,CAAA,EAAG,IAAI,CAAA,kDAAA,CAAoD,CAAC,CAAC;AAC1E,SAAA;AAED,QAAA,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;KACrC;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;;ACpDA;;;;;;;;;;;;;;;AAeG;AAMG,SAAU,sBAAsB,CAAC,OAAgB,EAAA;;AAErD,IAAA,eAAe,CAACA,MAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C;;ACxBA;;;;;;;;;;;;;;;AAeG;AAKH,MAAM,QAAQ,GAAG,2BAA2B,GAAG;AAE/C,sBAAsB,CAAC,MAAM,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.lite.js","sources":["../src/lite/firebaseAppLite.ts","../src/errors.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../src/registerCoreComponents.ts","../src/index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '../public-types';\nimport { _FirebaseNamespace, _FirebaseService } from '../types';\nimport {\n deleteApp,\n _addComponent,\n _DEFAULT_ENTRY_NAME,\n _FirebaseAppInternal as FirebaseAppExp\n} from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\nimport { Compat } from '@firebase/util';\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl\n implements FirebaseApp, Compat<FirebaseAppExp>\n{\n constructor(\n readonly _delegate: FirebaseAppExp,\n private readonly firebase: _FirebaseNamespace\n ) {\n // add itself to container\n _addComponent(\n _delegate,\n new Component('app-compat', () => this, ComponentType.PUBLIC)\n );\n }\n\n get automaticDataCollectionEnabled(): boolean {\n return this._delegate.automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n return this._delegate.name;\n }\n\n get options(): FirebaseOptions {\n return this._delegate.options;\n }\n\n delete(): Promise<void> {\n this.firebase.INTERNAL.removeApp(this.name);\n return deleteApp(this._delegate);\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): _FirebaseService {\n this._delegate.checkDestroyed();\n\n // getImmediate will always succeed because _getService is only called for registered components.\n return this._delegate.container.getProvider(name as Name).getImmediate({\n identifier: instanceIdentifier\n }) as unknown as _FirebaseService;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\ntype ErrorParams = { [key in AppError]: { appName: string } };\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app-compat',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from './public-types';\nimport {\n _FirebaseNamespace,\n _FirebaseService,\n FirebaseServiceNamespace\n} from './types';\nimport * as modularAPIs from '@firebase/app';\nimport { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\n\nimport { deepExtend, contains } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): _FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // const components = new Map<string, Component<any>>();\n\n // A namespace is a plain JavaScript Object.\n const namespace: _FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeAppCompat,\n // @ts-ignore\n app,\n registerVersion: modularAPIs.registerVersion,\n setLogLevel: modularAPIs.setLogLevel,\n onLog: modularAPIs.onLog,\n // @ts-ignore\n apps: null,\n SDK_VERSION: modularAPIs.SDK_VERSION,\n INTERNAL: {\n registerComponent: registerComponentCompat,\n removeApp,\n useAsService,\n modularAPIs\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)['default'] = namespace;\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || modularAPIs._DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n return apps[name];\n }\n\n // @ts-ignore\n app['App'] = firebaseAppImpl;\n\n /**\n * Create a new App instance (name must be unique).\n *\n * This function is idempotent. It can be called more than once and return the same instance using the same options and config.\n */\n function initializeAppCompat(\n options: FirebaseOptions,\n rawConfig = {}\n ): FirebaseApp {\n const app = modularAPIs.initializeApp(\n options,\n rawConfig\n ) as _FirebaseAppExp;\n\n if (contains(apps, app.name)) {\n return apps[app.name];\n }\n\n const appCompat = new firebaseAppImpl(app, namespace);\n apps[app.name] = appCompat;\n return appCompat;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n function registerComponentCompat<T extends Name>(\n component: Component<T>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n const componentName = component.name;\n const componentNameWithoutCompat = componentName.replace('-compat', '');\n if (\n modularAPIs._registerComponent(component) &&\n component.type === ComponentType.PUBLIC\n ) {\n // create service namespace for public components\n // The Service namespace is an accessor function ...\n const serviceNamespace = (\n appArg: FirebaseApp = app()\n ): _FirebaseService => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (appArg as any)[componentNameWithoutCompat] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(AppError.INVALID_APP_ARGUMENT, {\n appName: componentName\n });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (appArg as any)[componentNameWithoutCompat]();\n };\n\n // ... and a container for service-level properties.\n if (component.serviceProps !== undefined) {\n deepExtend(serviceNamespace, component.serviceProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (firebaseAppImpl.prototype as any)[componentNameWithoutCompat] =\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\n // option added to the no-explicit-any rule when ESlint releases it.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (...args: any) {\n const serviceFxn = this._getService.bind(this, componentName);\n return serviceFxn.apply(\n this,\n component.multipleInstances ? args : []\n );\n };\n }\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat]\n : null;\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '../public-types';\nimport { FirebaseServiceNamespace, _FirebaseService } from '../types';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\nimport { Component, ComponentType } from '@firebase/component';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`;\n\n const registerComponent = namespace.INTERNAL.registerComponent;\n namespace.INTERNAL.registerComponent = registerComponentForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerComponentForLite(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: Component<any>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n // only allow performance to register with firebase lite\n if (\n component.type === ComponentType.PUBLIC &&\n !component.name.includes('performance') &&\n !component.name.includes('installations')\n ) {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerComponent(component);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerVersion } from '@firebase/app';\n\nimport { name, version } from '../package.json';\n\nexport function registerCoreComponents(variant?: string): void {\n // Register `app` package.\n registerVersion(name, version, variant);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './lite/firebaseNamespaceLite';\nimport { registerCoreComponents } from './registerCoreComponents';\n\nconst firebase = createFirebaseNamespaceLite();\n\nregisterCoreComponents('lite');\n\n// eslint-disable-next-line import/no-default-export\nexport default firebase;\n"],"names":["name"],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAaH;;;AAGG;MACU,mBAAmB,CAAA;IAG9B,WACW,CAAA,SAAyB,EACjB,QAA4B,EAAA;QADpC,IAAS,CAAA,SAAA,GAAT,SAAS,CAAgB;QACjB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAoB;;AAG7C,QAAA,aAAa,CACX,SAAS,EACT,IA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I,KAAyB,QAAA;AACvC,YAAA,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YACvC,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EACzC;AACA,YAAA,MAAM,KAAK,CAAC,CAAA,EAAG,IAAI,CAAA,kDAAA,CAAoD,CAAC,CAAC;SAC1E;AAED,QAAA,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;KACrC;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;;ACpDA;;;;;;;;;;;;;;;AAeG;AAMG,SAAU,sBAAsB,CAAC,OAAgB,EAAA;;AAErD,IAAA,eAAe,CAACA,MAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C;;ACxBA;;;;;;;;;;;;;;;AAeG;AAKH,MAAM,QAAQ,GAAG,2BAA2B,GAAG;AAE/C,sBAAsB,CAAC,MAAM,CAAC;;;;"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
import { ErrorFactory } from '@firebase/util';
|
|
18
|
-
export declare const enum AppError {
|
|
19
|
-
NO_APP = "no-app",
|
|
20
|
-
INVALID_APP_ARGUMENT = "invalid-app-argument"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[key in AppError]: {
|
|
24
|
-
appName: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
|
|
28
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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
|
+
import { ErrorFactory } from '@firebase/util';
|
|
18
|
+
export declare const enum AppError {
|
|
19
|
+
NO_APP = "no-app",
|
|
20
|
+
INVALID_APP_ARGUMENT = "invalid-app-argument"
|
|
21
|
+
}
|
|
22
|
+
type ErrorParams = {
|
|
23
|
+
[key in AppError]: {
|
|
24
|
+
appName: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
|
|
28
|
+
export {};
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 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
|
-
import { FirebaseOptions } from './public-types';
|
|
18
|
-
import { Component } from '@firebase/component';
|
|
19
|
-
import { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';
|
|
20
|
-
import { _FirebaseService, _FirebaseNamespace } from './types';
|
|
21
|
-
import { Compat } from '@firebase/util';
|
|
22
|
-
export interface _FirebaseApp {
|
|
23
|
-
/**
|
|
24
|
-
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
|
|
25
|
-
* App.
|
|
26
|
-
*/
|
|
27
|
-
name: string;
|
|
28
|
-
/**
|
|
29
|
-
* The (read-only) configuration options from the app initialization.
|
|
30
|
-
*/
|
|
31
|
-
options: FirebaseOptions;
|
|
32
|
-
/**
|
|
33
|
-
* The settable config flag for GDPR opt-in/opt-out
|
|
34
|
-
*/
|
|
35
|
-
automaticDataCollectionEnabled: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Make the given App unusable and free resources.
|
|
38
|
-
*/
|
|
39
|
-
delete(): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Global context object for a collection of services using
|
|
43
|
-
* a shared authentication state.
|
|
44
|
-
*
|
|
45
|
-
* marked as internal because it references internal types exported from @firebase/app
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {
|
|
49
|
-
readonly _delegate: _FirebaseAppExp;
|
|
50
|
-
private readonly firebase;
|
|
51
|
-
private container;
|
|
52
|
-
constructor(_delegate: _FirebaseAppExp, firebase: _FirebaseNamespace);
|
|
53
|
-
get automaticDataCollectionEnabled(): boolean;
|
|
54
|
-
set automaticDataCollectionEnabled(val: boolean);
|
|
55
|
-
get name(): string;
|
|
56
|
-
get options(): FirebaseOptions;
|
|
57
|
-
delete(): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Return a service instance associated with this app (creating it
|
|
60
|
-
* on demand), identified by the passed instanceIdentifier.
|
|
61
|
-
*
|
|
62
|
-
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
|
63
|
-
* functionality. They invoke it by calling:
|
|
64
|
-
*
|
|
65
|
-
* ```javascript
|
|
66
|
-
* firebase.app().storage('STORAGE BUCKET ID')
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* The service name is passed to this already
|
|
70
|
-
* @internal
|
|
71
|
-
*/
|
|
72
|
-
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
|
|
73
|
-
/**
|
|
74
|
-
* Remove a service instance from the cache, so we will create a new instance for this service
|
|
75
|
-
* when people try to get it again.
|
|
76
|
-
*
|
|
77
|
-
* NOTE: currently only firestore uses this functionality to support firestore shutdown.
|
|
78
|
-
*
|
|
79
|
-
* @param name The service name
|
|
80
|
-
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* @param component the component being added to this app's container
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
_addComponent(component: Component): void;
|
|
89
|
-
_addOrOverwriteComponent(component: Component): void;
|
|
90
|
-
toJSON(): object;
|
|
91
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 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
|
+
import { FirebaseOptions } from './public-types';
|
|
18
|
+
import { Component } from '@firebase/component';
|
|
19
|
+
import { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';
|
|
20
|
+
import { _FirebaseService, _FirebaseNamespace } from './types';
|
|
21
|
+
import { Compat } from '@firebase/util';
|
|
22
|
+
export interface _FirebaseApp {
|
|
23
|
+
/**
|
|
24
|
+
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
|
|
25
|
+
* App.
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* The (read-only) configuration options from the app initialization.
|
|
30
|
+
*/
|
|
31
|
+
options: FirebaseOptions;
|
|
32
|
+
/**
|
|
33
|
+
* The settable config flag for GDPR opt-in/opt-out
|
|
34
|
+
*/
|
|
35
|
+
automaticDataCollectionEnabled: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Make the given App unusable and free resources.
|
|
38
|
+
*/
|
|
39
|
+
delete(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Global context object for a collection of services using
|
|
43
|
+
* a shared authentication state.
|
|
44
|
+
*
|
|
45
|
+
* marked as internal because it references internal types exported from @firebase/app
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {
|
|
49
|
+
readonly _delegate: _FirebaseAppExp;
|
|
50
|
+
private readonly firebase;
|
|
51
|
+
private container;
|
|
52
|
+
constructor(_delegate: _FirebaseAppExp, firebase: _FirebaseNamespace);
|
|
53
|
+
get automaticDataCollectionEnabled(): boolean;
|
|
54
|
+
set automaticDataCollectionEnabled(val: boolean);
|
|
55
|
+
get name(): string;
|
|
56
|
+
get options(): FirebaseOptions;
|
|
57
|
+
delete(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Return a service instance associated with this app (creating it
|
|
60
|
+
* on demand), identified by the passed instanceIdentifier.
|
|
61
|
+
*
|
|
62
|
+
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
|
63
|
+
* functionality. They invoke it by calling:
|
|
64
|
+
*
|
|
65
|
+
* ```javascript
|
|
66
|
+
* firebase.app().storage('STORAGE BUCKET ID')
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* The service name is passed to this already
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
|
|
73
|
+
/**
|
|
74
|
+
* Remove a service instance from the cache, so we will create a new instance for this service
|
|
75
|
+
* when people try to get it again.
|
|
76
|
+
*
|
|
77
|
+
* NOTE: currently only firestore uses this functionality to support firestore shutdown.
|
|
78
|
+
*
|
|
79
|
+
* @param name The service name
|
|
80
|
+
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* @param component the component being added to this app's container
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
_addComponent(component: Component): void;
|
|
89
|
+
_addOrOverwriteComponent(component: Component): void;
|
|
90
|
+
toJSON(): object;
|
|
91
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
import { FirebaseNamespace } from './public-types';
|
|
18
|
-
/**
|
|
19
|
-
* Return a firebase namespace object.
|
|
20
|
-
*
|
|
21
|
-
* In production, this will be called exactly once and the result
|
|
22
|
-
* assigned to the 'firebase' global. It may be called multiple times
|
|
23
|
-
* in unit tests.
|
|
24
|
-
*/
|
|
25
|
-
export declare function createFirebaseNamespace(): FirebaseNamespace;
|
|
26
|
-
export declare const firebase: FirebaseNamespace;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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
|
+
import { FirebaseNamespace } from './public-types';
|
|
18
|
+
/**
|
|
19
|
+
* Return a firebase namespace object.
|
|
20
|
+
*
|
|
21
|
+
* In production, this will be called exactly once and the result
|
|
22
|
+
* assigned to the 'firebase' global. It may be called multiple times
|
|
23
|
+
* in unit tests.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createFirebaseNamespace(): FirebaseNamespace;
|
|
26
|
+
export declare const firebase: FirebaseNamespace;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
import { _FirebaseNamespace } from './types';
|
|
18
|
-
import { FirebaseAppImpl } from './firebaseApp';
|
|
19
|
-
import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
|
|
20
|
-
/**
|
|
21
|
-
* Because auth can't share code with other components, we attach the utility functions
|
|
22
|
-
* in an internal namespace to share code.
|
|
23
|
-
* This function return a firebase namespace object without
|
|
24
|
-
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
|
25
|
-
* the lite version.
|
|
26
|
-
*/
|
|
27
|
-
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): _FirebaseNamespace;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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
|
+
import { _FirebaseNamespace } from './types';
|
|
18
|
+
import { FirebaseAppImpl } from './firebaseApp';
|
|
19
|
+
import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
|
|
20
|
+
/**
|
|
21
|
+
* Because auth can't share code with other components, we attach the utility functions
|
|
22
|
+
* in an internal namespace to share code.
|
|
23
|
+
* This function return a firebase namespace object without
|
|
24
|
+
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
|
25
|
+
* the lite version.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): _FirebaseNamespace;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 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
|
-
import { FirebaseNamespace } from './public-types';
|
|
18
|
-
declare global {
|
|
19
|
-
interface Window {
|
|
20
|
-
firebase: FirebaseNamespace;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
declare const firebase: FirebaseNamespace;
|
|
24
|
-
export default firebase;
|
|
25
|
-
export { _FirebaseNamespace, _FirebaseService } from './types';
|
|
26
|
-
export { FirebaseApp, FirebaseNamespace } from './public-types';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 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
|
+
import { FirebaseNamespace } from './public-types';
|
|
18
|
+
declare global {
|
|
19
|
+
interface Window {
|
|
20
|
+
firebase: FirebaseNamespace;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
declare const firebase: FirebaseNamespace;
|
|
24
|
+
export default firebase;
|
|
25
|
+
export { _FirebaseNamespace, _FirebaseService } from './types';
|
|
26
|
+
export { FirebaseApp, FirebaseNamespace } from './public-types';
|
package/dist/src/index.lite.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
declare const firebase: import("./public-types").FirebaseNamespace;
|
|
18
|
-
export default firebase;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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
|
+
declare const firebase: import("./public-types").FirebaseNamespace;
|
|
18
|
+
export default firebase;
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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
|
-
import { FirebaseApp, FirebaseOptions } from '../public-types';
|
|
18
|
-
import { _FirebaseNamespace, _FirebaseService } from '../types';
|
|
19
|
-
import { _FirebaseAppInternal as FirebaseAppExp } from '@firebase/app';
|
|
20
|
-
import { Compat } from '@firebase/util';
|
|
21
|
-
/**
|
|
22
|
-
* Global context object for a collection of services using
|
|
23
|
-
* a shared authentication state.
|
|
24
|
-
*/
|
|
25
|
-
export declare class FirebaseAppLiteImpl implements FirebaseApp, Compat<FirebaseAppExp> {
|
|
26
|
-
readonly _delegate: FirebaseAppExp;
|
|
27
|
-
private readonly firebase;
|
|
28
|
-
constructor(_delegate: FirebaseAppExp, firebase: _FirebaseNamespace);
|
|
29
|
-
get automaticDataCollectionEnabled(): boolean;
|
|
30
|
-
set automaticDataCollectionEnabled(val: boolean);
|
|
31
|
-
get name(): string;
|
|
32
|
-
get options(): FirebaseOptions;
|
|
33
|
-
delete(): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Return a service instance associated with this app (creating it
|
|
36
|
-
* on demand), identified by the passed instanceIdentifier.
|
|
37
|
-
*
|
|
38
|
-
* NOTE: Currently storage is the only one that is leveraging this
|
|
39
|
-
* functionality. They invoke it by calling:
|
|
40
|
-
*
|
|
41
|
-
* ```javascript
|
|
42
|
-
* firebase.app().storage('STORAGE BUCKET ID')
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* The service name is passed to this already
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
|
|
49
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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
|
+
import { FirebaseApp, FirebaseOptions } from '../public-types';
|
|
18
|
+
import { _FirebaseNamespace, _FirebaseService } from '../types';
|
|
19
|
+
import { _FirebaseAppInternal as FirebaseAppExp } from '@firebase/app';
|
|
20
|
+
import { Compat } from '@firebase/util';
|
|
21
|
+
/**
|
|
22
|
+
* Global context object for a collection of services using
|
|
23
|
+
* a shared authentication state.
|
|
24
|
+
*/
|
|
25
|
+
export declare class FirebaseAppLiteImpl implements FirebaseApp, Compat<FirebaseAppExp> {
|
|
26
|
+
readonly _delegate: FirebaseAppExp;
|
|
27
|
+
private readonly firebase;
|
|
28
|
+
constructor(_delegate: FirebaseAppExp, firebase: _FirebaseNamespace);
|
|
29
|
+
get automaticDataCollectionEnabled(): boolean;
|
|
30
|
+
set automaticDataCollectionEnabled(val: boolean);
|
|
31
|
+
get name(): string;
|
|
32
|
+
get options(): FirebaseOptions;
|
|
33
|
+
delete(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Return a service instance associated with this app (creating it
|
|
36
|
+
* on demand), identified by the passed instanceIdentifier.
|
|
37
|
+
*
|
|
38
|
+
* NOTE: Currently storage is the only one that is leveraging this
|
|
39
|
+
* functionality. They invoke it by calling:
|
|
40
|
+
*
|
|
41
|
+
* ```javascript
|
|
42
|
+
* firebase.app().storage('STORAGE BUCKET ID')
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* The service name is passed to this already
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
|
|
49
|
+
}
|