UNPKG

ipfs-repo

Version:
58 lines 1.94 kB
/** * @typedef {import('./types').Config} Config * @typedef {import('interface-datastore').Datastore} Datastore */ /** * @param {Datastore} store */ export function config(store: Datastore): { /** * Get the current configuration from the repo. * * @param {object} [options] - options * @param {AbortSignal} [options.signal] - abort this config read * @returns {Promise<Config>} */ getAll(options?: { signal?: AbortSignal | undefined; } | undefined): Promise<Config>; /** * Get the value for the passed configuration key from the repo. * * @param {string} key - the config key to get * @param {object} [options] - options * @param {AbortSignal} [options.signal] - abort this config read */ get(key: string, options?: { signal?: AbortSignal | undefined; } | undefined): Promise<any>; /** * Set the current configuration for this repo. * * @param {string} key - the config key to be written * @param {any} [value] - the config value to be written * @param {object} [options] - options * @param {AbortSignal} [options.signal] - abort this config write */ set(key: string, value?: any, options?: { signal?: AbortSignal | undefined; } | undefined): any; /** * Set the current configuration for this repo. * * @param {Config} [value] - the config value to be written * @param {object} [options] - options * @param {AbortSignal} [options.signal] - abort this config write */ replace(value?: import("./types").Config | undefined, options?: { signal?: AbortSignal | undefined; } | undefined): any; /** * Check if a config file exists. * */ exists(): Promise<boolean>; }; export type Config = import('./types').Config; export type Datastore = import('interface-datastore').Datastore; //# sourceMappingURL=config.d.ts.map