UNPKG

@firebase/firestore

Version:

The Cloud Firestore component of the Firebase JS SDK.

78 lines (77 loc) 3.1 kB
/** * @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 { EmulatorMockTokenOptions } from '@firebase/util'; import { FirestoreLocalCache } from '../api/cache_config'; import { CredentialsSettings } from '../api/credentials'; import { ExperimentalLongPollingOptions } from '../api/long_polling_options'; export declare const DEFAULT_HOST = "firestore.googleapis.com"; export declare const DEFAULT_SSL = true; /** * Specifies custom configurations for your Cloud Firestore instance. * You must set these before invoking any other methods. */ export interface FirestoreSettings { /** The hostname to connect to. */ host?: string; /** Whether to use SSL when connecting. */ ssl?: boolean; /** * Whether to skip nested properties that are set to `undefined` during * object serialization. If set to `true`, these properties are skipped * and not written to Firestore. If set to `false` or omitted, the SDK * throws an exception when it encounters properties of type `undefined`. */ ignoreUndefinedProperties?: boolean; } /** * @internal * Undocumented, private additional settings not exposed in our public API. */ export interface PrivateSettings extends FirestoreSettings { credentials?: CredentialsSettings; cacheSizeBytes?: number; experimentalForceLongPolling?: boolean; experimentalAutoDetectLongPolling?: boolean; experimentalLongPollingOptions?: ExperimentalLongPollingOptions; useFetchStreams?: boolean; emulatorOptions?: { mockUserToken?: EmulatorMockTokenOptions | string; }; localCache?: FirestoreLocalCache; } /** * A concrete type describing all the values that can be applied via a * user-supplied `FirestoreSettings` object. This is a separate type so that * defaults can be supplied and the value can be checked for equality. */ export declare class FirestoreSettingsImpl { /** The hostname to connect to. */ readonly host: string; /** Whether to use SSL when connecting. */ readonly ssl: boolean; readonly cacheSizeBytes: number; readonly experimentalForceLongPolling: boolean; readonly experimentalAutoDetectLongPolling: boolean; readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions; readonly ignoreUndefinedProperties: boolean; readonly useFetchStreams: boolean; readonly localCache?: FirestoreLocalCache; readonly isUsingEmulator: boolean; credentials?: any; constructor(settings: PrivateSettings); isEqual(other: FirestoreSettingsImpl): boolean; }