import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller"; import type { Messenger } from "@metamask/messenger"; import type { RemoteFeatureFlagControllerState } from "@metamask/remote-feature-flag-controller"; import type { Json } from "@metamask/utils"; import type { AbstractConfigRegistryApiService } from "./config-registry-api-service/index.cjs"; declare const controllerName = "ConfigRegistryController"; export declare const DEFAULT_POLLING_INTERVAL: number; export type RegistryConfigEntry = { key: string; value: Json; metadata?: Json; }; export type ConfigRegistryState = { configs: { networks?: Record; }; version: string | null; lastFetched: number | null; fetchError: string | null; etag: string | null; }; type ConfigRegistryPollingInput = Record; export type ConfigRegistryControllerStateChangeEvent = ControllerStateChangeEvent; export type ConfigRegistryControllerGetStateAction = ControllerGetStateAction; export type ConfigRegistryControllerGetConfigAction = { type: `${typeof controllerName}:getConfig`; handler: ConfigRegistryController['getConfig']; }; export type ConfigRegistryControllerSetConfigAction = { type: `${typeof controllerName}:setConfig`; handler: ConfigRegistryController['setConfig']; }; export type ConfigRegistryControllerGetAllConfigsAction = { type: `${typeof controllerName}:getAllConfigs`; handler: ConfigRegistryController['getAllConfigs']; }; export type ConfigRegistryControllerStartPollingAction = { type: `${typeof controllerName}:startPolling`; handler: (input: ConfigRegistryPollingInput) => string; }; export type ConfigRegistryControllerStopPollingAction = { type: `${typeof controllerName}:stopPolling`; handler: () => void; }; export type ConfigRegistryControllerActions = ConfigRegistryControllerGetStateAction | ConfigRegistryControllerGetConfigAction | ConfigRegistryControllerSetConfigAction | ConfigRegistryControllerGetAllConfigsAction | ConfigRegistryControllerStartPollingAction | ConfigRegistryControllerStopPollingAction | { type: 'RemoteFeatureFlagController:getState'; handler: () => RemoteFeatureFlagControllerState; }; export type ConfigRegistryControllerEvents = ConfigRegistryControllerStateChangeEvent; export type ConfigRegistryMessenger = Messenger; export type ConfigRegistryControllerOptions = { messenger: ConfigRegistryMessenger; state?: Partial; pollingInterval?: number; fallbackConfig?: Record; apiService?: AbstractConfigRegistryApiService; }; declare const ConfigRegistryController_base: (abstract new (...args: any[]) => { readonly "__#15@#intervalIds": Record; "__#15@#intervalLength": number | undefined; setIntervalLength(intervalLength: number): void; getIntervalLength(): number | undefined; _startPolling(input: ConfigRegistryPollingInput): void; _stopPollingByPollingTokenSetId(key: string): void; readonly "__#3@#pollingTokenSets": Map>; readonly "__#3@#callbacks": Map void>>; _executePoll(input: ConfigRegistryPollingInput): Promise; startPolling(input: ConfigRegistryPollingInput): string; stopAllPolling(): void; stopPollingByPollingToken(pollingToken: string): void; onPollingComplete(input: ConfigRegistryPollingInput, callback: (input: ConfigRegistryPollingInput) => void): void; }) & typeof import("@metamask/base-controller").BaseController; export declare class ConfigRegistryController extends ConfigRegistryController_base { #private; /** * @param options - The controller options. * @param options.messenger - The controller messenger. * @param options.state - Initial state. * @param options.pollingInterval - Polling interval in milliseconds. * @param options.fallbackConfig - Fallback configuration. * @param options.apiService - The API service. */ constructor({ messenger, state, pollingInterval, fallbackConfig, apiService, }: ConfigRegistryControllerOptions); _executePoll(_input: ConfigRegistryPollingInput): Promise; getConfig(key: string): RegistryConfigEntry | undefined; getAllConfigs(): Record; getConfigValue(key: string): TValue | undefined; setConfig(key: string, value: Json, metadata?: Json): void; removeConfig(key: string): void; clearConfigs(): void; startPolling(input?: ConfigRegistryPollingInput): string; stopPolling(): void; } export {}; //# sourceMappingURL=ConfigRegistryController.d.cts.map