import type { DeepReadonly, DeepWritable } from "ts-essentials"; import { type Fixed, type Fixer } from "./fixers.js"; import { ResourceComponent } from "./obsidian.js"; import type { PluginContext } from "./plugin.js"; export declare abstract class AbstractSettingsManager extends ResourceComponent> { #private; protected readonly fixer: Fixer; constructor(fixer: Fixer); mutate(mutator: (settings: DeepWritable) => unknown): Promise; read(reader?: () => unknown): Promise; onMutate(accessor: (settings: DeepReadonly) => V, callback: (cur: V, prev: V, settings: DeepReadonly) => unknown): () => void; onload(): void; protected load0(): Promise>; abstract write(): unknown; protected abstract onInvalidData(actual: unknown, fixed: DeepWritable): unknown; protected abstract read0(): unknown; } export declare namespace AbstractSettingsManager { export interface Type { readonly [Type]?: never; } const Type: unique symbol; export function fix(self0: unknown): Fixed; export {}; } export declare class StorageSettingsManager extends AbstractSettingsManager { #private; protected readonly context: PluginContext; protected readonly storage: Storage; constructor(context: PluginContext, fixer: Fixer, storage?: Storage); protected get key(): PromiseLike; write(): Promise; protected onInvalidData(actual: unknown, fixed: DeepWritable): Promise; protected read0(): Promise; } export declare namespace StorageSettingsManager { const FAILED: unique symbol, KEY = "settings", RECOVERY_PREFIX = "local-settings."; type Recovery = Readonly>; interface Type extends AbstractSettingsManager.Type { readonly [FAILED]?: true; readonly recovery: Recovery; } function fix(self0: unknown): Fixed; function getRecovery(recovery: Recovery, prefix: string): Map; function setRecovery(recovery: DeepWritable, prefix: string, map: Map): void; function hasFailed(value: Type): boolean; } export declare class SettingsManager extends AbstractSettingsManager { #private; protected readonly context: PluginContext; constructor(context: PluginContext, fixer: Fixer); write(): Promise; protected onInvalidData(actual: unknown, fixed: DeepWritable): Promise; protected read0(): Promise; } export declare namespace SettingsManager { type Type = AbstractSettingsManager.Type; const RECOVERY_PREFIX = "settings.", fix: typeof AbstractSettingsManager.fix; } export declare function registerSettingsCommands(context: PluginContext): void; //# sourceMappingURL=settings.d.ts.map