@firebase/remote-config-types

  • Version 0.3.3
  • Published
  • 5.93 kB
  • No dependencies
  • Apache-2.0 license

Install

npm i @firebase/remote-config-types
yarn add @firebase/remote-config-types
pnpm add @firebase/remote-config-types

Overview

@firebase/remote-config Types

Index

Interfaces

interface RemoteConfig

interface RemoteConfig {}
  • 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.

property defaultConfig

defaultConfig: { [key: string]: string | number | boolean };
  • Object containing default values for configs.

property fetchTimeMillis

fetchTimeMillis: number;
  • The Unix timestamp in milliseconds of the last successful fetch, or negative one if the RemoteConfig instance either hasn't fetched or initialization is incomplete.

property lastFetchStatus

lastFetchStatus: FetchStatus;
  • The status of the last fetch attempt.

property settings

settings: Settings;
  • Defines configuration for the Remote Config SDK.

method activate

activate: () => Promise<boolean>;
  • Makes the last fetched config available to the getters. Returns a promise which resolves to true if the current call activated the fetched configs. If the fetched configs were already activated, the promise will resolve to false.

method ensureInitialized

ensureInitialized: () => Promise<void>;
  • Ensures the last activated config are available to the getters.

method fetch

fetch: () => Promise<void>;
  • Fetches and caches configuration from the Remote Config service.

method fetchAndActivate

fetchAndActivate: () => Promise<boolean>;
  • Performs fetch and activate operations, as a convenience. Returns a promise which resolves to true if the current call activated the fetched configs. If the fetched configs were already activated, the promise will resolve to false.

method getAll

getAll: () => { [key: string]: Value };
  • Gets all config.

method getBoolean

getBoolean: (key: string) => boolean;
  • Gets the value for the given key as a boolean.

    Convenience method for calling remoteConfig.getValue(key).asBoolean().

method getNumber

getNumber: (key: string) => number;
  • Gets the value for the given key as a number.

    Convenience method for calling remoteConfig.getValue(key).asNumber().

method getString

getString: (key: string) => string;
  • Gets the value for the given key as a String.

    Convenience method for calling remoteConfig.getValue(key).asString().

method getValue

getValue: (key: string) => Value;
  • Gets the Value for the given key.

method setLogLevel

setLogLevel: (logLevel: LogLevel) => void;
  • Defines the log level to use.

interface Settings

interface Settings {}
  • Defines configuration options for the Remote Config SDK.

property fetchTimeoutMillis

fetchTimeoutMillis: number;
  • Defines the maximum amount of milliseconds to wait for a response when fetching configuration from the Remote Config server. Defaults to 60000 (One minute).

property minimumFetchIntervalMillis

minimumFetchIntervalMillis: number;
  • Defines the maximum age in milliseconds of an entry in the config cache before it is considered stale. Defaults to 43200000 (Twelve hours).

interface Value

interface Value {}
  • Wraps a value with metadata and type-safe getters.

method asBoolean

asBoolean: () => boolean;
  • Gets the value as a boolean.

    The following values (case-insensitive) are interpreted as true: "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.

method asNumber

asNumber: () => number;
  • Gets the value as a number. Comparable to calling Number(value) || 0.

method asString

asString: () => string;
  • Gets the value as a string.

method getSource

getSource: () => ValueSource;

Type Aliases

type FetchStatus

type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
  • Summarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.

    "no-fetch-yet" indicates the RemoteConfig instance has not yet attempted to fetch config, or that SDK initialization is incomplete. "success" indicates the last attempt succeeded. "failure" indicates the last attempt failed. "throttle" indicates the last attempt was rate-limited.

type LogLevel

type LogLevel = 'debug' | 'error' | 'silent';
  • Defines levels of Remote Config logging.

type ValueSource

type ValueSource = 'static' | 'default' | 'remote';
  • Indicates the source of a value.

    "static" indicates the value was defined by a static constant. "default" indicates the value was defined by default config. "remote" indicates the value was defined by fetched config.

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (1)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@firebase/remote-config-types.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@firebase/remote-config-types)
  • HTML
    <a href="https://www.jsdocs.io/package/@firebase/remote-config-types"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>