UNPKG

tauri-settings

Version:

A user settings manager for Tauri inspired by electron-settings.

21 lines (20 loc) 1.34 kB
import { ConfigOptions } from '../config/config'; import type { Path, PathValue } from '../types/dot-notation'; /** * Checks whether a key exists in the settings. * @param key The key for the setting. Key supports dot notation. See https://github.com/harshkhandeparkar/tauri-settings#dot-notation. */ export declare function has<SettingsSchema, K extends Path<SettingsSchema> = Path<SettingsSchema>>(key: K, options?: ConfigOptions): Promise<boolean>; /** * Get the value of a particular setting. * @param key The key for the setting. Key supports dot notation. See https://github.com/harshkhandeparkar/tauri-settings#dot-notation. * @returns The value of the setting */ export declare function get<SettingsSchema, K extends Path<SettingsSchema> = Path<SettingsSchema>>(key: K, options?: ConfigOptions): Promise<PathValue<SettingsSchema, K>>; /** * Sets the value of a particular setting * @param key The key for the setting. Key supports dot notation. See https://github.com/harshkhandeparkar/tauri-settings#dot-notation. * @param value The new value * @returns The entire settings object */ export declare function set<SettingsSchema, K extends Path<SettingsSchema> = Path<SettingsSchema>, V extends PathValue<SettingsSchema, K> = PathValue<SettingsSchema, K>>(key: K, value: V, options?: ConfigOptions): Promise<SettingsSchema>;