///
import { type OnDidChangeCallback, type Options, type Unsubscribe, type OnDidAnyChangeCallback } from './types.js';
export default class Conf = Record> implements Iterable<[keyof T, T[keyof T]]> {
#private;
readonly path: string;
readonly events: EventTarget;
constructor(partialOptions?: Readonly>>);
/**
Get an item.
@param key - The key of the item to get.
@param defaultValue - The default value if the item does not exist.
*/
get(key: Key): T[Key];
get(key: Key, defaultValue: Required[Key]): Required[Key];
get(key: Exclude, defaultValue?: Value): Value;
/**
Set an item or multiple items at once.
@param {key|object} - You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a key to access nested properties. Or a hashmap of items to set at once.
@param value - Must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a `TypeError`.
*/
set(key: Key, value?: T[Key]): void;
set(key: string, value: unknown): void;
set(object: Partial): void;
/**
Check if an item exists.
@param key - The key of the item to check.
*/
has(key: Key | string): boolean;
/**
Reset items to their default values, as defined by the `defaults` or `schema` option.
@see `clear()` to reset all items.
@param keys - The keys of the items to reset.
*/
reset(...keys: Key[]): void;
/**
Delete an item.
@param key - The key of the item to delete.
*/
delete(key: Key): void;
/**
Delete all items.
This resets known items to their default values, if defined by the `defaults` or `schema` option.
*/
clear(): void;
/**
Watches the given `key`, calling `callback` on any changes.
@param key - The key to watch.
@param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
@returns A function, that when called, will unsubscribe.
*/
onDidChange(key: Key, callback: OnDidChangeCallback): Unsubscribe;
/**
Watches the whole config object, calling `callback` on any changes.
@param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
@returns A function, that when called, will unsubscribe.
*/
onDidAnyChange(callback: OnDidAnyChangeCallback): Unsubscribe;
get size(): number;
get store(): T;
set store(value: T);
[Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>;
private _encryptData;
private _handleChange;
private readonly _deserialize;
private readonly _serialize;
private _validate;
private _ensureDirectory;
private _write;
private _watch;
private _migrate;
private _containsReservedKey;
private _isVersionInRangeFormat;
private _shouldPerformMigration;
private _get;
private _set;
}
export type { Options, Schema } from './types.js';