UNPKG

@launchmenu/core

Version:

An environment for visual keyboard controlled applets

43 lines 1.91 kB
import { IIdentifiedSettingsConfig } from "./_types/IIdentifiedSettingsConfig"; import { ISettingsFolderMenuItem } from "./_types/ISettingsFolderMenuItem"; import { TSettingsTree } from "./_types/TSettingsTree"; /** * A context to store the setting values for given configs in */ export declare class SettingsContext { protected settings: { [ID: string]: ISettingsFolderMenuItem<import("./_types/IRenderableSettingsTree").IRenderableSettingsTree>; }; /** * Creates a new empty settings context * @param settings The settings to begin with, mapped under their config ids */ constructor(settings?: { [ID: string]: ISettingsFolderMenuItem; }); /** * Augments the current context with the given settings, resulting in a new context * @param config The config for the settings to augment * @param values The values to store for this config * @returns The newly created context */ augment<F extends ISettingsFolderMenuItem>(config: IIdentifiedSettingsConfig<any, F>, values: F): SettingsContext; /** * Retrieves a selection of settings from its config * @param config The settings group to retrieve * @returns The values for these settings within this context */ get<F extends ISettingsFolderMenuItem>(config: IIdentifiedSettingsConfig<any, F>): TSettingsTree<F["children"]>; /** * Retrieves all of the UI for settings in this menu * @returns The UI to represent the settings */ getUI(): ISettingsFolderMenuItem[]; /** * Retrieves a selection of settings and UI from its config * @param config The settings group to retrieve * @returns The UI to represent the settings */ getUI<F extends ISettingsFolderMenuItem>(config: IIdentifiedSettingsConfig<any, F>): F; } //# sourceMappingURL=SettingsContext.d.ts.map