import { Dialog } from "./dialog"; export declare const settings: Record; export type settings_type = typeof settings; type SettingsValue = string | number | boolean; declare enum SettingsType { Toggle = "toggle", Number = "number", Text = "text", Password = "password", Select = "select", Click = "click" } interface SettingOptions { name?: string; type?: SettingsType | `${SettingsType}`; value?: boolean | number | string; condition?: ConditionResolvable; category?: string; description?: string; requires_restart?: boolean; launch_setting?: boolean; min?: number; max?: number; step?: number; icon?: IconString; plugin?: string; click?(): void; options?: { [id: string]: string; }; onChange?(value: any): void; } /** * Settings can be used to add global configuration options to Blockbench. All settings are listed under File > Preferences > Settings. */ export declare class Setting { id: string; type: SettingsType; default_value: SettingsValue; /** * The master value, not affected by profiles */ master_value: SettingsValue; condition: ConditionResolvable; category: string; name: string; description: string; requires_restart: boolean; launch_setting: boolean; plugin?: string; min?: number; max?: number; step?: number; icon: IconString; click: (event: MouseEvent | KeyboardEvent) => void; options: Record; hidden: boolean; onChange: (value: SettingsValue) => void; keybind_label: string; constructor(id: string, data: SettingOptions); /** * The active value */ get value(): SettingsValue; set value(value: SettingsValue); /** * The value that is displayed in the settings dialog */ get ui_value(): SettingsValue; set ui_value(value: SettingsValue); delete(): void; /** * Sets the value of the setting, while triggering the onChange function if available, and saving the change. */ set(value: SettingsValue): void; /** * Triggers the setting, as if selected in action control. This toggles boolean settings, opens a dialog for string or numeric settings, etc. */ trigger(e: KeyboardEvent | MouseEvent): void; } declare enum SettingsProfileConditionType { selectable = "selectable", format = "format", file_path = "file_path" } interface SettingsProfileData { name?: string; color?: number; } export declare class SettingsProfile { uuid: string; name: string; color: number; condition: { type: SettingsProfileConditionType; value: string; }; settings: Record; selected: boolean; constructor(data?: SettingsProfileData); select(update?: boolean): void; extend(data: any): void; isActive(): boolean; clear(key: any): void; openDialog(): void; remove(): void; static all: SettingsProfile[]; static selected: SettingsProfile | null; static unselect: (update?: boolean) => void; } /** * Global namespace handling data and functionality related to settings. */ export declare const Settings: { profile_menu_button: HTMLElement | null; structure: Record; }>; stored: Record; dialog: Dialog | null; addCategory(id: string, data: { name?: string; open?: boolean; }): void; /** * Save all settings to the local storage */ saveLocalStorages(): void; /** * Save the settings and apply changes */ save(): void; updateSettingsInProfiles(): void; updateProfileButton(): void; import(file: any): void; /** * Returns the value of the specified setting */ get(id: string): SettingsValue; openDialog(options?: { search_term?: string; profile?: string; }): void; showRestartMessage(settings?: Setting[]): void; old: {}; }; declare const globals: { settings: Record; Setting: typeof import("./settings").Setting; SettingsProfile: typeof import("./settings").SettingsProfile; Settings: { profile_menu_button: HTMLElement | null; structure: Record; }>; stored: Record; dialog: Dialog | null; addCategory(id: string, data: { name?: string; open?: boolean; }): void; /** * Save all settings to the local storage */ saveLocalStorages(): void; /** * Save the settings and apply changes */ save(): void; updateSettingsInProfiles(): void; updateProfileButton(): void; import(file: any): void; /** * Returns the value of the specified setting */ get(id: string): SettingsValue; openDialog(options?: { search_term?: string; profile?: string; }): void; showRestartMessage(settings?: import("./settings").Setting[]): void; old: {}; }; }; declare global { const settings: typeof globals.settings; const Setting: typeof globals.Setting; type Setting = import('./settings').Setting; const SettingsProfile: typeof globals.SettingsProfile; type SettingsProfile = import('./settings').SettingsProfile; const Settings: typeof globals.Settings; } export {};