import EventEmitter from 'eventemitter3'; import { Config, Overwrite, ValidateOptions, InternalSchema } from 'convict'; import { LogLevelDesc as LogLevel } from 'loglevel'; export { LogLevel }; import { DeepPartial } from './deep-partial'; export declare const DEFAULT_CONFIG_DIR = "."; export declare const DEFAULT_CONFIG_FILE_NAME = "rdplibconfig"; export declare const DEFAULT_CONFIG_PLATFORM = "prod"; export declare const DEFAULT_CONFIG_FILE_EXTENSION = "json"; export declare const CONFIG_TEMPLATE_DIVIDER = ":"; export declare const CONFIG_TEMPLATE_TO_REPLACE: RegExp; export declare const CONFIG_FILE_UPDATED = "update"; export declare const NEW_CONFIG_VALUE_SET = "set"; export interface ConfigEvents { [CONFIG_FILE_UPDATED]: (newConfig: T, source: string) => void; [NEW_CONFIG_VALUE_SET]: (newConfig: T, path: string, value: any) => void; [event: string]: (...args: any[]) => void; } export declare enum StreamingType { OMM = "OMM", RDP = "RDP" } export interface StreamingConnectionConfig { url: string; endpoints: { [key: string]: StreamingConnectionEndpointConfig; }; 'streaming-service'?: string; } export interface StreamingConnectionEndpointConfig { protocols: StreamingType[]; locations: string[]; path: string; 'websocket-url': string; } export interface ConfigEndpoint { url: string; endpoints: { [subpath: string]: string; }; } export interface Datagrid extends ConfigEndpoint { 'underlying-platform': UnderlyingPlatform; layout: PlatformLayout; } export declare enum UnderlyingPlatform { RDP = "rdp", UDF = "udf" } export interface PlatformLayout { [UnderlyingPlatform.RDP]: { output: string; }; [UnderlyingPlatform.UDF]: { layout: { columns: LayoutItem[]; rows: LayoutItem[]; }; }; } export interface LayoutItem { item: string; [key: string]: string; } export interface SessionBasicConfig { 'base-url': string; apis?: DeepPartial<{ data: { [endpointName: string]: ConfigEndpoint; }; discovery: { [endpointName: string]: ConfigEndpoint; }; tsi: { [endpointName: string]: ConfigEndpoint; }; streaming: { [connection: string]: StreamingConnectionConfig; }; }>; } export interface DefaultPlatformSessionConfig extends SessionBasicConfig { 'auto-reconnect': boolean; auth: { v1: { url: string; authorize: string; token: string; }; v2: { url: string; token: string; }; }; 'realtime-distribution-system': { url: string; dacs: { username: string; 'application-id': string; position: string; }; }; } export interface DefaultDesktopSessionConfig extends SessionBasicConfig { 'platform-paths': { rdp: string; udf: string; tsi: string; }; 'handshake-url': string; } export interface ConfigEnvironment { platform: string; dir: string; } export interface ConfigConsoleTransport { enabled: boolean; } export interface ConfigFileTransport { enabled: boolean; name: string; size: string; interval: string; maxFiles: number; maxSize: string; history: string; } interface HttpConfig { 'request-timeout': number; } export interface ConfigSchema extends ConfigEnvironment { 'config-change-notifications-enabled': boolean; http: HttpConfig; logs: { level: LogLevel; filter: string; transports: { console: ConfigConsoleTransport; file: ConfigFileTransport; [transportName: string]: any; }; }; sessions: { platform: { 'default-session': DefaultPlatformSessionConfig; [customSession: string]: Partial; }; desktop: { 'default-session': DefaultDesktopSessionConfig; [customSession: string]: Partial; }; }; apis: { data: { 'historical-pricing': { url: string; endpoints: { events: string; 'interday-summaries': string; 'intraday-summaries': string; }; }; 'quantitative-analytics-financial-contracts': { url: string; endpoints: { 'financial-contracts': string; }; }; 'quantitative-analytics-curves-and-surfaces': { url: string; endpoints: { 'forward-curves': string; surfaces: string; 'zc-curves': string; 'zc-curve-definitions': string; }; }; 'quantitative-analytics-dates-and-calendars': { url: string; endpoints: { 'add-periods': string; c3: string; 'count-periods': string; 'date-schedule': string; holidays: string; 'is-working-day': string; }; }; news: { url: string; endpoints: { headlines: string; stories: string; }; }; 'environmental-social-governance': { url: string; endpoints: { universe: string; basic: string; 'measures-full': string; 'measures-standard': string; 'scores-full': string; 'scores-standard': string; }; }; datagrid: { url: string; endpoints: { standard: string; }; 'underlying-platform': UnderlyingPlatform; layout: PlatformLayout; }; [endpointName: string]: ConfigEndpoint | Datagrid; }; discovery: { search: { url: string; endpoints: { search: string; lookup: string; metadata: string; }; }; [endpointName: string]: ConfigEndpoint; }; tsi: { metadata: { url: string; endpoints: { 'global-metadata': string; 'instrument-metadata': string; partialbar: string; viewlist: string; }; }; [endpointName: string]: ConfigEndpoint; }; streaming: { pricing: StreamingConnectionConfig; 'quantitative-analytics': StreamingConnectionConfig; benchmark: StreamingConnectionConfig; 'custom-instruments': StreamingConnectionConfig; [connection: string]: StreamingConnectionConfig; }; }; } export interface ILibraryConfig extends Config, EventEmitter> { defaultConfig: Config; CONFIG_FILE_UPDATED: typeof CONFIG_FILE_UPDATED; CONFIG_SET: typeof NEW_CONFIG_VALUE_SET; get(name?: K): K extends null | undefined ? T : K extends keyof T ? T[K] : any; get(name: string): T[K][K2]; get(name: K): T[K][K2][K3]; get(name: string): T[K][K2][K3][K4]; get(name?: any): any; set(name: K, value: K extends keyof T ? T[K] : any): Config; set(name: K, value: K2 extends keyof T[K] ? T[K][K2] : any): Config; set(name: K, value: K3 extends keyof T[K][K2] ? T[K][K2][K3] : any): Config; set(name: K, value: K4 extends keyof T[K][K2][K3] ? T[K][K2][K3][K4] : any): Config; set(name: string, value: any): any; default(name?: K | undefined): K extends keyof T ? T[K] : K extends null | undefined ? T : any; default(name?: K | undefined): T[K]; default(name: string): T[K][K2]; default(name: K): T[K][K2][K3]; default(name: string): T[K][K2][K3][K4]; default(name?: any): any; has(name: K): boolean; has(name: string): boolean; has(name: K): boolean; has(name: string): boolean; has(name: any): boolean; load(conf: U): Config>; loadFile(files: string | string[]): Config>; validate(options?: ValidateOptions | undefined): Config; getProperties(): T; getSchema(): InternalSchema; toString(): string; getSchemaString(): string; getConfigFilesPath(): string[]; notifyConfigUpdated(event: string, data: Partial, source?: string): boolean; watch(): void; unwatch(): void; extendDefault(configExtend: { [key: string]: any; }): void; }