UNPKG

svelte-settings

Version:

> [!WARNING] > This project is a work in progress. Do not use it in any of your projects yet.

16 lines (15 loc) 913 B
type Settings = Record<string, unknown>; interface SettingsMigrationStep { description: string; callback: (settings: Settings) => Settings; } export type SettingsMigrations = SettingsMigrationStep[][]; export declare function get(settings: Settings, path: string[]): unknown; export declare function write(settings: Settings, path: string[], value: unknown): Settings; export declare function writeNew(settings: Settings, path: string[], value: unknown): Settings | undefined; export declare function copy(settings: Settings, fromPath: string[], toPath: string[]): Settings; export declare function asBoolean(v: unknown): boolean | undefined; export declare function asArray(v: unknown): unknown[]; export declare function asObject(v: unknown): Record<string, unknown>; export declare function renameArrayEntry(settings: Settings, path: string[], oldEntry: string, newEntry: string): Settings; export {};