import { SettingsStore as SettingsStoreClass } from "../shared/SettingsStore"; import { DefinedSettings, SettingsChecks, SettingsDefinition } from "../utils/types"; export interface SettingsPluginUiElement { enabled: boolean; /** not implemented for now */ order?: number; } export type SettingsPluginUiElements = { /** id will be whatever id the element was registered with. Usually, but not always, the plugin name */ [id: string]: SettingsPluginUiElement; }; export interface Settings { autoUpdate: boolean; autoUpdateNotification: boolean; useQuickCss: boolean; eagerPatches: boolean; enabledThemes: string[]; enableReactDevtools: boolean; themeLinks: string[]; frameless: boolean; transparent: boolean; winCtrlQ: boolean; macosVibrancyStyle: "content" | "fullscreen-ui" | "header" | "hud" | "menu" | "popover" | "selection" | "sidebar" | "titlebar" | "tooltip" | "under-page" | "window" | undefined; disableMinSize: boolean; winNativeTitleBar: boolean; plugins: { [plugin: string]: { enabled: boolean; [setting: string]: any; }; }; uiElements: { messagePopoverButtons: SettingsPluginUiElements; chatBarButtons: SettingsPluginUiElements; }; notifications: { timeout: number; position: "top-right" | "bottom-right"; useNative: "always" | "never" | "not-focused"; logLimit: number; }; cloud: { authenticated: boolean; url: string; settingsSync: boolean; settingsSyncVersion: number; }; } export declare const SettingsStore: SettingsStoreClass; /** * Same as {@link Settings} but unproxied. You should treat this as readonly, * as modifying properties on this will not save to disk or call settings * listeners. * WARNING: default values specified in plugin.options will not be ensured here. In other words, * settings for which you specified a default value may be uninitialised. If you need proper * handling for default values, use {@link Settings} */ export declare const PlainSettings: Settings; /** * A smart settings object. Altering props automagically saves * the updated settings to disk. * This recursively proxies objects. If you need the object non proxied, use {@link PlainSettings} */ export declare const Settings: Settings; /** * Settings hook for React components. Returns a smart settings * object that automagically triggers a rerender if any properties * are altered * @param paths An optional list of paths to whitelist for rerenders * @returns Settings */ export declare function useSettings(paths?: UseSettings[]): Settings; export declare function migratePluginSettings(name: string, ...oldNames: string[]): void; export declare function migratePluginSetting(pluginName: string, oldSetting: string, newSetting: string): void; export declare function definePluginSettings, PrivateSettings extends object = {}>(def: Def, checks?: Checks): DefinedSettings; type UseSettings = ResolveUseSettings[keyof T]; type ResolveUseSettings = { [Key in keyof T]: Key extends string ? T[Key] extends Record ? `${Key}.*` | (ResolveUseSettings extends Record ? `${Key}.${ResolveUseSettings[keyof T[Key]]}` : never) : Key : never; }; export {};