/** * @description Adds a key-value pair to the config * @param key - The key to add * @param value - The value to add * @returns The config object */ declare function put(key: string, value: T): { put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; }; /** * @description Gets a key-value pair with a fallback from the config * @param key - The key to add * @param fallback - The fallback value to return if key is not found * @returns The value found at key or fallback */ declare function get(key: string, fallback?: T): Promise; /** * @description Returns the first non null config value or the fallback * @param wants - The keys to search for * @param fallback - The fallback value to return if key is not found * @returns The value found at key or fallback */ declare function first(wants: string[] | undefined, fallback: T): Promise; /** * @description Returns the current config * @returns The config object */ declare function all(): Promise>; /** * @description Updates a key-value pair in the config * @param key - The key to update * @param fn - The function to update the value with * @returns The config object */ declare function update(key: string, fn?: (x: T) => T): { put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; }; /** * @description Deletes a key-value pair from the config * @param key - The key to delete * @returns The config object */ declare function _delete(key: string): { put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; }; /** * @description Returns a subset of the config based on a pattern * @param pattern - The pattern to match keys against * @returns The subset of the config */ declare function where(pattern: RegExp): Promise>; /** * @description Subscribes to config updates * @param callback - The callback to call when config is updated * @returns The unsubscribe function */ declare function subscribe(callback: (config: Record | null, error: Error | null) => void): () => void; /** * @description Clears the config */ export declare function clearConfig(): Promise; /** * @description Takes in flow.json or array of flow.json files and creates contract placeholders * @param data - The data to load * @param data.flowJSON - The flow.json or array of flow.json files * @param options - override flag * @param options.ignoreConflicts - ignore conflicts and override config */ declare function load(data: { flowJSON: Record | Record[]; }, { ignoreConflicts, }?: { ignoreConflicts?: boolean; }): Promise; /** * @description Sets the config * @param values - The values to set * @returns The config object */ declare function config(values?: Record): { put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; }; declare namespace config { export var put: (key: string, value: T) => { put: /*elided*/ any; get: (key: string, fallback?: T_1) => Promise; all: () => Promise>; first: (wants: string[] | undefined, fallback: T_1) => Promise; update: (key: string, fn?: (x: T_1) => T_1) => /*elided*/ any; delete: typeof _delete; where: (pattern: RegExp) => Promise>; subscribe: (callback: (config: Record | null, error: Error | null) => void) => () => void; overload: (values: Record, callback: (oldConfig: Record) => T_1) => Promise; load: (data: { flowJSON: Record | Record[]; }, { ignoreConflicts, }?: { ignoreConflicts?: boolean; }) => Promise; }; export var get: (key: string, fallback?: T) => Promise; export var all: () => Promise>; export var first: (wants: string[] | undefined, fallback: T) => Promise; export var update: (key: string, fn?: (x: T) => T) => { put: (key: string, value: T_1) => /*elided*/ any; get: (key: string, fallback?: T_1) => Promise; all: () => Promise>; first: (wants: string[] | undefined, fallback: T_1) => Promise; update: /*elided*/ any; delete: typeof _delete; where: (pattern: RegExp) => Promise>; subscribe: (callback: (config: Record | null, error: Error | null) => void) => () => void; overload: (values: Record, callback: (oldConfig: Record) => T_1) => Promise; load: (data: { flowJSON: Record | Record[]; }, { ignoreConflicts, }?: { ignoreConflicts?: boolean; }) => Promise; }; var _a: typeof _delete; export var where: (pattern: RegExp) => Promise>; export var subscribe: (callback: (config: Record | null, error: Error | null) => void) => () => void; export var overload: (values: Record, callback: (oldConfig: Record) => T) => Promise; export var load: (data: { flowJSON: Record | Record[]; }, { ignoreConflicts, }?: { ignoreConflicts?: boolean; }) => Promise; export { _a as delete }; } export { config }; export { getContracts } from "./utils/utils"; /** * @description Temporarily overloads the config with the given values and calls the callback * @param values - The values to overload the config with * @param callback - The callback to call with the overloaded config * @returns The result of the callback */ declare function overload(values: Record, callback: (oldConfig: Record) => T): Promise;