Deployed the page to Github Pages.

This commit is contained in:
Batuhan Berk Başoğlu 2024-11-03 21:30:09 -05:00
parent 1d79754e93
commit 2c89899458
Signed by: batuhan-basoglu
SSH key fingerprint: SHA256:kEsnuHX+qbwhxSAXPUQ4ox535wFHu/hIRaa53FzxRpo
62797 changed files with 6551425 additions and 15279 deletions

View file

@ -0,0 +1,438 @@
import { ErrorFactory, contains, deepExtend, createSubscribe, getGlobal } from '@firebase/util';
import { Component } from '@firebase/component';
import * as modularAPIs from '@firebase/app';
import { _addComponent, deleteApp, _DEFAULT_ENTRY_NAME, _addOrOverwriteComponent, registerVersion } from '@firebase/app';
import { Logger } from '@firebase/logger';
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Global context object for a collection of services using
* a shared authentication state.
*
* marked as internal because it references internal types exported from @firebase/app
* @internal
*/
class FirebaseAppImpl {
constructor(_delegate, firebase) {
this._delegate = _delegate;
this.firebase = firebase;
// add itself to container
_addComponent(_delegate, new Component('app-compat', () => this, "PUBLIC" /* ComponentType.PUBLIC */));
this.container = _delegate.container;
}
get automaticDataCollectionEnabled() {
return this._delegate.automaticDataCollectionEnabled;
}
set automaticDataCollectionEnabled(val) {
this._delegate.automaticDataCollectionEnabled = val;
}
get name() {
return this._delegate.name;
}
get options() {
return this._delegate.options;
}
delete() {
return new Promise(resolve => {
this._delegate.checkDestroyed();
resolve();
}).then(() => {
this.firebase.INTERNAL.removeApp(this.name);
return deleteApp(this._delegate);
});
}
/**
* Return a service instance associated with this app (creating it
* on demand), identified by the passed instanceIdentifier.
*
* NOTE: Currently storage and functions are the only ones that are leveraging this
* functionality. They invoke it by calling:
*
* ```javascript
* firebase.app().storage('STORAGE BUCKET ID')
* ```
*
* The service name is passed to this already
* @internal
*/
_getService(name, instanceIdentifier = _DEFAULT_ENTRY_NAME) {
var _a;
this._delegate.checkDestroyed();
// Initialize instance if InstantiationMode is `EXPLICIT`.
const provider = this._delegate.container.getProvider(name);
if (!provider.isInitialized() &&
((_a = provider.getComponent()) === null || _a === void 0 ? void 0 : _a.instantiationMode) === "EXPLICIT" /* InstantiationMode.EXPLICIT */) {
provider.initialize();
}
// getImmediate will always succeed because _getService is only called for registered components.
return provider.getImmediate({
identifier: instanceIdentifier
});
}
/**
* Remove a service instance from the cache, so we will create a new instance for this service
* when people try to get it again.
*
* NOTE: currently only firestore uses this functionality to support firestore shutdown.
*
* @param name The service name
* @param instanceIdentifier instance identifier in case multiple instances are allowed
* @internal
*/
_removeServiceInstance(name, instanceIdentifier = _DEFAULT_ENTRY_NAME) {
this._delegate.container
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.getProvider(name)
.clearInstance(instanceIdentifier);
}
/**
* @param component the component being added to this app's container
* @internal
*/
_addComponent(component) {
_addComponent(this._delegate, component);
}
_addOrOverwriteComponent(component) {
_addOrOverwriteComponent(this._delegate, component);
}
toJSON() {
return {
name: this.name,
automaticDataCollectionEnabled: this.automaticDataCollectionEnabled,
options: this.options
};
}
}
// TODO: investigate why the following needs to be commented out
// Prevent dead-code elimination of these methods w/o invalid property
// copying.
// (FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
// FirebaseAppImpl.prototype.delete ||
// console.log('dc');
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const ERRORS = {
["no-app" /* AppError.NO_APP */]: "No Firebase App '{$appName}' has been created - " +
'call Firebase App.initializeApp()',
["invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
'Firebase App instance.'
};
const ERROR_FACTORY = new ErrorFactory('app-compat', 'Firebase', ERRORS);
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Because auth can't share code with other components, we attach the utility functions
* in an internal namespace to share code.
* This function return a firebase namespace object without
* any utility functions, so it can be shared between the regular firebaseNamespace and
* the lite version.
*/
function createFirebaseNamespaceCore(firebaseAppImpl) {
const apps = {};
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
// const components = new Map<string, Component<any>>();
// A namespace is a plain JavaScript Object.
const namespace = {
// Hack to prevent Babel from modifying the object returned
// as the firebase namespace.
// @ts-ignore
__esModule: true,
initializeApp: initializeAppCompat,
// @ts-ignore
app,
registerVersion: modularAPIs.registerVersion,
setLogLevel: modularAPIs.setLogLevel,
onLog: modularAPIs.onLog,
// @ts-ignore
apps: null,
SDK_VERSION: modularAPIs.SDK_VERSION,
INTERNAL: {
registerComponent: registerComponentCompat,
removeApp,
useAsService,
modularAPIs
}
};
// Inject a circular default export to allow Babel users who were previously
// using:
//
// import firebase from 'firebase';
// which becomes: var firebase = require('firebase').default;
//
// instead of
//
// import * as firebase from 'firebase';
// which becomes: var firebase = require('firebase');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
namespace['default'] = namespace;
// firebase.apps is a read-only getter.
Object.defineProperty(namespace, 'apps', {
get: getApps
});
/**
* Called by App.delete() - but before any services associated with the App
* are deleted.
*/
function removeApp(name) {
delete apps[name];
}
/**
* Get the App object for a given name (or DEFAULT).
*/
function app(name) {
name = name || modularAPIs._DEFAULT_ENTRY_NAME;
if (!contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* AppError.NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
app['App'] = firebaseAppImpl;
/**
* Create a new App instance (name must be unique).
*
* This function is idempotent. It can be called more than once and return the same instance using the same options and config.
*/
function initializeAppCompat(options, rawConfig = {}) {
const app = modularAPIs.initializeApp(options, rawConfig);
if (contains(apps, app.name)) {
return apps[app.name];
}
const appCompat = new firebaseAppImpl(app, namespace);
apps[app.name] = appCompat;
return appCompat;
}
/*
* Return an array of all the non-deleted FirebaseApps.
*/
function getApps() {
// Make a copy so caller cannot mutate the apps list.
return Object.keys(apps).map(name => apps[name]);
}
function registerComponentCompat(component) {
const componentName = component.name;
const componentNameWithoutCompat = componentName.replace('-compat', '');
if (modularAPIs._registerComponent(component) &&
component.type === "PUBLIC" /* ComponentType.PUBLIC */) {
// create service namespace for public components
// The Service namespace is an accessor function ...
const serviceNamespace = (appArg = app()) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (typeof appArg[componentNameWithoutCompat] !== 'function') {
// Invalid argument.
// This happens in the following case: firebase.storage('gs:/')
throw ERROR_FACTORY.create("invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */, {
appName: componentName
});
}
// Forward service instance lookup to the FirebaseApp.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return appArg[componentNameWithoutCompat]();
};
// ... and a container for service-level properties.
if (component.serviceProps !== undefined) {
deepExtend(serviceNamespace, component.serviceProps);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
namespace[componentNameWithoutCompat] = serviceNamespace;
// Patch the FirebaseAppImpl prototype
// eslint-disable-next-line @typescript-eslint/no-explicit-any
firebaseAppImpl.prototype[componentNameWithoutCompat] =
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
// option added to the no-explicit-any rule when ESlint releases it.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function (...args) {
const serviceFxn = this._getService.bind(this, componentName);
return serviceFxn.apply(this, component.multipleInstances ? args : []);
};
}
return component.type === "PUBLIC" /* ComponentType.PUBLIC */
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
namespace[componentNameWithoutCompat]
: null;
}
// Map the requested service to a registered service name
// (used to map auth to serverAuth service when needed).
function useAsService(app, name) {
if (name === 'serverAuth') {
return null;
}
const useService = name;
return useService;
}
return namespace;
}
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Return a firebase namespace object.
*
* In production, this will be called exactly once and the result
* assigned to the 'firebase' global. It may be called multiple times
* in unit tests.
*/
function createFirebaseNamespace() {
const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
namespace.INTERNAL = Object.assign(Object.assign({}, namespace.INTERNAL), { createFirebaseNamespace,
extendNamespace,
createSubscribe,
ErrorFactory,
deepExtend });
/**
* Patch the top-level firebase namespace with additional properties.
*
* firebase.INTERNAL.extendNamespace()
*/
function extendNamespace(props) {
deepExtend(namespace, props);
}
return namespace;
}
const firebase$1 = createFirebaseNamespace();
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const logger = new Logger('@firebase/app-compat');
const name = "@firebase/app-compat";
const version = "0.2.45";
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function registerCoreComponents(variant) {
// Register `app` package.
registerVersion(name, version, variant);
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
try {
const globals = getGlobal();
// Firebase Lite detection
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (globals.firebase !== undefined) {
logger.warn(`
Warning: Firebase is already defined in the global scope. Please make sure
Firebase library is only loaded once.
`);
// eslint-disable-next-line
const sdkVersion = globals.firebase
.SDK_VERSION;
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
logger.warn(`
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
`);
}
}
}
catch (_a) {
// ignore errors thrown by getGlobal
}
const firebase = firebase$1;
registerCoreComponents();
export { firebase as default };
//# sourceMappingURL=index.esm2017.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"type":"module"}

View file

@ -0,0 +1,28 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ErrorFactory } from '@firebase/util';
export declare const enum AppError {
NO_APP = "no-app",
INVALID_APP_ARGUMENT = "invalid-app-argument"
}
declare type ErrorParams = {
[key in AppError]: {
appName: string;
};
};
export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
export {};

View file

@ -0,0 +1,91 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseOptions } from './public-types';
import { Component } from '@firebase/component';
import { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';
import { _FirebaseService, _FirebaseNamespace } from './types';
import { Compat } from '@firebase/util';
export interface _FirebaseApp {
/**
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
* App.
*/
name: string;
/**
* The (read-only) configuration options from the app initialization.
*/
options: FirebaseOptions;
/**
* The settable config flag for GDPR opt-in/opt-out
*/
automaticDataCollectionEnabled: boolean;
/**
* Make the given App unusable and free resources.
*/
delete(): Promise<void>;
}
/**
* Global context object for a collection of services using
* a shared authentication state.
*
* marked as internal because it references internal types exported from @firebase/app
* @internal
*/
export declare class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {
readonly _delegate: _FirebaseAppExp;
private readonly firebase;
private container;
constructor(_delegate: _FirebaseAppExp, firebase: _FirebaseNamespace);
get automaticDataCollectionEnabled(): boolean;
set automaticDataCollectionEnabled(val: boolean);
get name(): string;
get options(): FirebaseOptions;
delete(): Promise<void>;
/**
* Return a service instance associated with this app (creating it
* on demand), identified by the passed instanceIdentifier.
*
* NOTE: Currently storage and functions are the only ones that are leveraging this
* functionality. They invoke it by calling:
*
* ```javascript
* firebase.app().storage('STORAGE BUCKET ID')
* ```
*
* The service name is passed to this already
* @internal
*/
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
/**
* Remove a service instance from the cache, so we will create a new instance for this service
* when people try to get it again.
*
* NOTE: currently only firestore uses this functionality to support firestore shutdown.
*
* @param name The service name
* @param instanceIdentifier instance identifier in case multiple instances are allowed
* @internal
*/
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
/**
* @param component the component being added to this app's container
* @internal
*/
_addComponent(component: Component): void;
_addOrOverwriteComponent(component: Component): void;
toJSON(): object;
}

View file

@ -0,0 +1,26 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseNamespace } from './public-types';
/**
* Return a firebase namespace object.
*
* In production, this will be called exactly once and the result
* assigned to the 'firebase' global. It may be called multiple times
* in unit tests.
*/
export declare function createFirebaseNamespace(): FirebaseNamespace;
export declare const firebase: FirebaseNamespace;

View file

@ -0,0 +1,27 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { _FirebaseNamespace } from './types';
import { FirebaseAppImpl } from './firebaseApp';
import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
/**
* Because auth can't share code with other components, we attach the utility functions
* in an internal namespace to share code.
* This function return a firebase namespace object without
* any utility functions, so it can be shared between the regular firebaseNamespace and
* the lite version.
*/
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): _FirebaseNamespace;

View file

@ -0,0 +1,26 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseNamespace } from './public-types';
declare global {
interface Window {
firebase: FirebaseNamespace;
}
}
declare const firebase: FirebaseNamespace;
export default firebase;
export { _FirebaseNamespace, _FirebaseService } from './types';
export { FirebaseApp, FirebaseNamespace } from './public-types';

View file

@ -0,0 +1,18 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare const firebase: import("./public-types").FirebaseNamespace;
export default firebase;

View file

@ -0,0 +1,49 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseApp, FirebaseOptions } from '../public-types';
import { _FirebaseNamespace, _FirebaseService } from '../types';
import { _FirebaseAppInternal as FirebaseAppExp } from '@firebase/app';
import { Compat } from '@firebase/util';
/**
* Global context object for a collection of services using
* a shared authentication state.
*/
export declare class FirebaseAppLiteImpl implements FirebaseApp, Compat<FirebaseAppExp> {
readonly _delegate: FirebaseAppExp;
private readonly firebase;
constructor(_delegate: FirebaseAppExp, firebase: _FirebaseNamespace);
get automaticDataCollectionEnabled(): boolean;
set automaticDataCollectionEnabled(val: boolean);
get name(): string;
get options(): FirebaseOptions;
delete(): Promise<void>;
/**
* Return a service instance associated with this app (creating it
* on demand), identified by the passed instanceIdentifier.
*
* NOTE: Currently storage is the only one that is leveraging this
* functionality. They invoke it by calling:
*
* ```javascript
* firebase.app().storage('STORAGE BUCKET ID')
* ```
*
* The service name is passed to this already
* @internal
*/
_getService(name: string, instanceIdentifier?: string): _FirebaseService;
}

View file

@ -0,0 +1,18 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseNamespace } from '../public-types';
export declare function createFirebaseNamespaceLite(): FirebaseNamespace;

View file

@ -0,0 +1,18 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Logger } from '@firebase/logger';
export declare const logger: Logger;

View file

@ -0,0 +1,100 @@
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { LogCallback, LogLevelString, LogOptions } from '@firebase/logger';
import { _FirebaseApp } from './firebaseApp';
export interface FirebaseOptions {
apiKey?: string;
authDomain?: string;
databaseURL?: string;
projectId?: string;
storageBucket?: string;
messagingSenderId?: string;
appId?: string;
measurementId?: string;
}
export interface FirebaseAppConfig {
name?: string;
automaticDataCollectionEnabled?: boolean;
}
interface FirebaseAppConstructor {
new (): FirebaseApp;
}
/**
* This interface will be enhanced by other products by adding e.g. firestore(), messaging() methods.
* As a result, FirebaseAppImpl can't directly implement it, otherwise there will be typings errors:
*
* For example, "Class 'FirebaseAppImpl' incorrectly implements interface 'FirebaseApp'.
* Property 'installations' is missing in type 'FirebaseAppImpl' but required in type 'FirebaseApp'"
*
* To workaround this issue, we defined a _FirebaseApp interface which is implemented by FirebaseAppImpl
* and let FirebaseApp extends it.
*/
export interface FirebaseApp extends _FirebaseApp {
}
export interface FirebaseNamespace {
/**
* Create (and initialize) a FirebaseApp.
*
* @param options Options to configure the services used in the App.
* @param config The optional config for your firebase app
*/
initializeApp(options: FirebaseOptions, config?: FirebaseAppConfig): FirebaseApp;
/**
* Create (and initialize) a FirebaseApp.
*
* @param options Options to configure the services used in the App.
* @param name The optional name of the app to initialize ('[DEFAULT]' if
* omitted)
*/
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
app: {
/**
* Retrieve an instance of a FirebaseApp.
*
* Usage: firebase.app()
*
* @param name The optional name of the app to return ('[DEFAULT]' if omitted)
*/
(name?: string): FirebaseApp;
/**
* For testing FirebaseApp instances:
* app() instanceof firebase.app.App
*
* DO NOT call this constuctor directly (use firebase.app() instead).
*/
App: FirebaseAppConstructor;
};
/**
* A (read-only) array of all the initialized Apps.
*/
apps: FirebaseApp[];
/**
* Registers a library's name and version for platform logging purposes.
* @param library Name of 1p or 3p library (e.g. firestore, angularfire)
* @param version Current version of that library.
*/
registerVersion(library: string, version: string, variant?: string): void;
setLogLevel(logLevel: LogLevelString): void;
onLog(logCallback: LogCallback, options?: LogOptions): void;
SDK_VERSION: string;
}
declare module '@firebase/component' {
interface NameServiceMapping {
'app-compat': FirebaseApp;
}
}
export {};

View file

@ -0,0 +1,17 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare function registerCoreComponents(variant?: string): void;

View file

@ -0,0 +1,71 @@
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* THIS FILE IS FOR INTERNAL USAGE ONLY, IF YOU ARE NOT DEVELOPING THE FIREBASE
* SDKs, PLEASE DO NOT REFERENCE THIS FILE AS IT MAY CHANGE WITHOUT WARNING
*/
import { FirebaseApp, FirebaseNamespace } from './public-types';
import { Compat } from '@firebase/util';
import { Component, ComponentContainer, Name } from '@firebase/component';
export interface FirebaseServiceInternals {
/**
* Delete the service and free it's resources - called from
* app.delete().
*/
delete(): Promise<void>;
}
export interface _FirebaseService extends Compat<unknown> {
app: FirebaseApp;
INTERNAL?: FirebaseServiceInternals;
}
/**
* All ServiceNamespaces extend from FirebaseServiceNamespace
*/
export interface FirebaseServiceNamespace<T extends _FirebaseService> {
(app?: FirebaseApp): T;
}
export interface _FirebaseApp extends FirebaseApp {
container: ComponentContainer;
_addComponent<T extends Name>(component: Component<T>): void;
_addOrOverwriteComponent<T extends Name>(component: Component<T>): void;
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
}
export interface _FirebaseNamespace extends FirebaseNamespace {
INTERNAL: {
/**
* Internal API to register a Firebase Service into the firebase namespace.
*
* Each service will create a child namespace (firebase.<name>) which acts as
* both a namespace for service specific properties, and also as a service
* accessor function (firebase.<name>() or firebase.<name>(app)).
*
* @param name The Firebase Service being registered.
* @param createService Factory function to create a service instance.
* @param serviceProperties Properties to copy to the service's namespace.
* @param appHook All appHooks called before initializeApp returns to caller.
* @param allowMultipleInstances Whether the registered service supports
* multiple instances per app. If not specified, the default is false.
*/
registerComponent<T extends Name>(component: Component<T>): FirebaseServiceNamespace<_FirebaseService> | null;
/**
* Internal API to remove an app from the list of registered apps.
*/
removeApp(name: string): void;
useAsService(app: FirebaseApp, serviceName: string): string | null;
[index: string]: unknown;
};
}

View file

@ -0,0 +1,17 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import './setup';

View file

@ -0,0 +1,17 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {};

View file

@ -0,0 +1,28 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { _FirebaseService } from '../src/types';
import { FirebaseApp } from '../src/public-types';
import { ComponentType, Component } from '@firebase/component';
export declare class TestService implements _FirebaseService {
private app_;
instanceIdentifier?: string | undefined;
readonly _delegate: {};
constructor(app_: FirebaseApp, instanceIdentifier?: string | undefined);
get app(): FirebaseApp;
delete(): Promise<void>;
}
export declare function createTestComponent(name: string, multiInstances?: boolean, type?: ComponentType): Component;