123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969 |
-
-
- export declare function areCookiesEnabled(): boolean;
-
-
- export declare const assert: (assertion: unknown, message: string) => void;
-
-
- export declare const assertionError: (message: string) => Error;
-
-
- export declare function async(fn: Function, onError?: ErrorFn): Function;
-
-
- declare interface Base64 {
- byteToCharMap_: {
- [key: number]: string;
- } | null;
- charToByteMap_: {
- [key: string]: number;
- } | null;
- byteToCharMapWebSafe_: {
- [key: number]: string;
- } | null;
- charToByteMapWebSafe_: {
- [key: string]: number;
- } | null;
- ENCODED_VALS_BASE: string;
- readonly ENCODED_VALS: string;
- readonly ENCODED_VALS_WEBSAFE: string;
- HAS_NATIVE_SUPPORT: boolean;
- encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string;
- encodeString(input: string, webSafe?: boolean): string;
- decodeString(input: string, webSafe: boolean): string;
- decodeStringToByteArray(input: string, webSafe: boolean): number[];
- init_(): void;
- }
-
- export declare const base64: Base64;
-
-
- export declare const base64Decode: (str: string) => string | null;
-
-
- export declare const base64Encode: (str: string) => string;
-
-
- export declare const base64urlEncodeWithoutPadding: (str: string) => string;
-
-
- export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number;
-
-
- declare interface Claims {
- [key: string]: {};
- }
-
-
- export declare interface Compat<T> {
- _delegate: T;
- }
-
- export declare type CompleteFn = () => void;
-
-
- export declare const CONSTANTS: {
-
-
- NODE_CLIENT: boolean;
-
-
- NODE_ADMIN: boolean;
-
-
- SDK_VERSION: string;
- };
-
-
- export declare function contains<T extends object>(obj: T, key: string): boolean;
-
- export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
-
-
- export declare function createSubscribe<T>(executor: Executor<T>, onNoObservers?: Executor<T>): Subscribe<T>;
-
-
- export declare const decode: (token: string) => DecodedToken;
-
- declare interface DecodedToken {
- header: object;
- claims: Claims;
- data: object;
- signature: string;
- }
-
- declare interface DecodedToken {
- header: object;
- claims: Claims;
- data: object;
- signature: string;
- }
-
-
-
- export declare function deepCopy<T>(value: T): T;
-
-
- export declare function deepEqual(a: object, b: object): boolean;
-
-
- export declare function deepExtend(target: unknown, source: unknown): unknown;
-
-
- export declare class Deferred<R> {
- promise: Promise<R>;
- reject: (value?: unknown) => void;
- resolve: (value?: unknown) => void;
- constructor();
- /**
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
- * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
- * and returns a node-style callback which will resolve or reject the Deferred's promise.
- */
- wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void;
- }
-
- export declare type EmulatorMockTokenOptions = ({
- user_id: string;
- } | {
- sub: string;
- }) & Partial<FirebaseIdToken>;
-
- export declare interface ErrorData {
- [key: string]: unknown;
- }
-
- export declare class ErrorFactory<ErrorCode extends string, ErrorParams extends {
- readonly [K in ErrorCode]?: ErrorData;
- } = {}> {
- private readonly service;
- private readonly serviceName;
- private readonly errors;
- constructor(service: string, serviceName: string, errors: ErrorMap<ErrorCode>);
- create<K extends ErrorCode>(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError;
- }
-
- export declare type ErrorFn = (error: Error) => void;
-
- /**
- * @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.
- */
- /**
- * @fileoverview Standardized Firebase Error.
- *
- * Usage:
- *
- * // Typescript string literals for type-safe codes
- * type Err =
- * 'unknown' |
- * 'object-not-found'
- * ;
- *
- * // Closure enum for type-safe error codes
- * // at-enum {string}
- * var Err = {
- * UNKNOWN: 'unknown',
- * OBJECT_NOT_FOUND: 'object-not-found',
- * }
- *
- * let errors: Map<Err, string> = {
- * 'generic-error': "Unknown error",
- * 'file-not-found': "Could not find file: {$file}",
- * };
- *
- *
- * let error = new ErrorFactory<Err>('service', 'Service', errors);
- *
- * ...
- * throw error.create(Err.GENERIC);
- * ...
- * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});
- * ...
- *
- *
- * catch (e) {
- * assert(e.message === "Could not find file: foo.txt.");
- * if ((e as FirebaseError)?.code === 'service/file-not-found') {
- * console.log("Could not read file: " + e['file']);
- * }
- * }
- */
- export declare type ErrorMap<ErrorCode extends string> = {
- readonly [K in ErrorCode]: string;
- };
-
- /**
- * Generates a string to prefix an error message about failed argument validation
- *
- * @param fnName The function name
- * @param argName The name of the argument
- * @return The prefix to add to the error thrown for validation.
- */
- export declare function errorPrefix(fnName: string, argName: string): string;
-
- export declare type Executor<T> = (observer: Observer<T>) => void;
-
-
-
- export declare type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';
-
-
- export declare function extractQuerystring(url: string): string;
-
-
- export declare interface FirebaseDefaults {
- config?: Record<string, string>;
- emulatorHosts?: Record<string, string>;
- _authTokenSyncURL?: string;
- _authIdTokenMaxAge?: number;
-
-
- forceEnvironment?: 'browser' | 'node';
- [key: string]: unknown;
- }
-
- export declare class FirebaseError extends Error {
-
- readonly code: string;
-
- customData?: Record<string, unknown> | undefined;
-
- readonly name: string;
- constructor(
-
- code: string, message: string,
-
- customData?: Record<string, unknown> | undefined);
- }
-
- declare interface FirebaseIdToken {
- iss: string;
- aud: string;
- sub: string;
- iat: number;
- exp: number;
- user_id: string;
- auth_time: number;
- provider_id?: 'anonymous';
- email?: string;
- email_verified?: boolean;
- phone_number?: string;
- name?: string;
- picture?: string;
- firebase: {
- sign_in_provider: FirebaseSignInProvider;
- identities?: {
- [provider in FirebaseSignInProvider]?: string[];
- };
- };
- [claim: string]: unknown;
- uid?: never;
- }
-
-
- export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
-
-
- export declare const getDefaultAppConfig: () => Record<string, string> | undefined;
-
-
- export declare const getDefaultEmulatorHost: (productName: string) => string | undefined;
-
-
- export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
-
-
- export declare const getDefaults: () => FirebaseDefaults | undefined;
-
-
- export declare const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];
-
-
-
- export declare function getGlobal(): typeof globalThis;
-
- export declare function getModularInstance<ExpService>(service: Compat<ExpService> | ExpService): ExpService;
-
-
-
- export declare function getUA(): string;
-
-
- export declare const isAdmin: (token: string) => boolean;
-
-
- export declare function isBrowser(): boolean;
-
- export declare function isBrowserExtension(): boolean;
-
-
- export declare function isElectron(): boolean;
-
- export declare function isEmpty(obj: object): obj is {};
-
-
- export declare function isIE(): boolean;
-
-
- export declare function isIndexedDBAvailable(): boolean;
-
-
- export declare function isMobileCordova(): boolean;
-
-
- export declare function isNode(): boolean;
-
-
- export declare function isNodeSdk(): boolean;
-
-
- export declare function isReactNative(): boolean;
-
-
- export declare function isSafari(): boolean;
-
-
- export declare const issuedAtTime: (token: string) => number | null;
-
-
- export declare function isUWP(): boolean;
-
-
- export declare const isValidFormat: (token: string) => boolean;
-
-
- export declare const isValidTimestamp: (token: string) => boolean;
-
-
-
- export declare function jsonEval(str: string): unknown;
-
- export declare function map<K extends string, V, U>(obj: {
- [key in K]: V;
- }, fn: (value: V, key: K, obj: {
- [key in K]: V;
- }) => U, contextObj?: unknown): {
- [key in K]: U;
- };
-
-
- export declare const MAX_VALUE_MILLIS: number;
-
-
- export declare type NextFn<T> = (value: T) => void;
-
- export declare interface Observable<T> {
- subscribe: Subscribe<T>;
- }
-
- export declare interface Observer<T> {
- next: NextFn<T>;
- error: ErrorFn;
- complete: CompleteFn;
- }
-
-
-
- export declare function ordinal(i: number): string;
-
- export declare type PartialObserver<T> = Partial<Observer<T>>;
-
-
-
- export declare function promiseWithTimeout<T>(promise: Promise<T>, timeInMS?: number): Promise<T>;
-
-
-
- export declare function querystring(querystringParams: {
- [key: string]: string | number;
- }): string;
-
-
- export declare function querystringDecode(querystring: string): Record<string, string>;
-
-
- export declare const RANDOM_FACTOR = 0.5;
-
- export declare function safeGet<T extends object, K extends keyof T>(obj: T, key: K): T[K] | undefined;
-
-
-
-
- export declare class Sha1 {
-
-
- private chain_;
-
-
- private buf_;
-
-
- private W_;
-
-
- private pad_;
-
-
- private inbuf_;
-
-
- private total_;
- blockSize: number;
- constructor();
- reset(): void;
- /**
- * Internal compress helper function.
- * @param buf Block to compress.
- * @param offset Offset of the block in the buffer.
- * @private
- */
- compress_(buf: number[] | Uint8Array | string, offset?: number): void;
- update(bytes?: number[] | Uint8Array | string, length?: number): void;
- /** @override */
- digest(): number[];
- }
-
- /**
- * Returns JSON representing a javascript object.
- * @param {*} data Javascript object to be stringified.
- * @return {string} The JSON contents of the object.
- */
- export declare function stringify(data: unknown): string;
-
- /**
- * Calculate length without actually converting; useful for doing cheaper validation.
- * @param {string} str
- * @return {number}
- */
- export declare const stringLength: (str: string) => number;
-
- export declare interface StringLike {
- toString(): string;
- }
-
- /**
- * @param {string} str
- * @return {Array}
- */
- export declare const stringToByteArray: (str: string) => number[];
-
- /**
- * The Subscribe interface has two forms - passing the inline function
- * callbacks, or a object interface with callback properties.
- */
- export declare interface Subscribe<T> {
- (next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;
- (observer: PartialObserver<T>): Unsubscribe;
- }
-
- export declare type Unsubscribe = () => void;
-
-
- export declare const uuidv4: () => string;
-
-
- export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void;
-
- export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void;
-
- export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void;
-
-
- export declare function validateIndexedDBOpenable(): Promise<boolean>;
-
-
- export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void;
-
- export { }
|