import { DynamicPropertiesUpdater } from '../dynamicPropertiesUpdater'; import { PropertiesFactory } from './propertiesFactory'; import { DynamicProperty } from './dynamicProperty'; import { IDynamicProperty } from '../dynamicProperty'; import { ConfigurationSourceBuilder } from "../configurationSources/configurationSourceBuilder"; import { ConfigurationSource } from "../configurationSources/configurationSource"; import * as rx from 'rx'; /** * * Provides dynamic properties updated when config change. * Accessing a dynamic property is very fast. The last value is cached and updated on the fly * from a ConfigurationSource at fixed interval. * Updates are made using polling requests on a list of sources. *

* Dynamic properties are read only. You can set a value but it will be valid only as a default value. *

* * let i:number = DynamicProperties.instance.getProperty("prop1"); * let i2:number = DynamicProperties.instance.getOrDefaultProperty("prop1", 1); * */ export declare class DynamicProperties implements DynamicPropertiesUpdater { private _propertyChanged; propertyChanged: rx.Observable>; private static _instance; private _configurationManager; private _properties; private _factory; /** * for test only */ static __forcePollingAsync(): Promise; static factory: PropertiesFactory; static instance: DynamicProperties; static init(pollingIntervalInSeconds?: number, sourceTimeoutInMs?: number): ConfigurationSourceBuilder; addProperty(name: string, prop: IDynamicProperty): void; /** * Private constructor * * */ constructor(pollingIntervalInSeconds?: number, sourceTimeoutInMs?: number); /** /// Reset configuration and properties. /// All current properties will be invalid and all current sources will be lost. /// /// /// */ reset(pollingIntervalInSeconds?: number, sourceTimeoutInMs?: number): void; pollingIntervalInSeconds: number; onPropertyChanged(property: any, action: string): void; registerSourceAsync(source: ConfigurationSource): Promise<{}>; getProperty(name: string): IDynamicProperty; clear(): void; createOrUpdateProperty(name: string, value: any): IDynamicProperty; getOrCreateProperty(name: string, defaultValue: any): IDynamicProperty; Updater_getOrCreate(name: string, factory: () => DynamicProperty): IDynamicProperty; Updater_removeProperty(name: string): void; dispose(): void; }