UNPKG

@highlite/core

Version:
77 lines (71 loc) 2.26 kB
/*! Copyright (C) 2025 HighLite This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ export declare enum SettingsTypes { checkbox = 0, range = 1, color = 2, text = 3, button = 4, combobox = 5, textarea = 6, alert = 7, warning = 8, info = 9 } interface BaseSettings<T> { text: string; description?: string; type: SettingsTypes; value: T; callback: Function; validation?: (value: T) => boolean; hidden?: boolean; disabled?: boolean; onLoaded?: Function; } interface RangeSettings extends BaseSettings<number> { type: SettingsTypes.range; min: number; max: number; } interface ComboBoxSettings extends BaseSettings<string> { type: SettingsTypes.combobox; options: string[]; } interface CheckboxSettings extends BaseSettings<boolean> { type: SettingsTypes.checkbox; } interface ButtonSettings extends BaseSettings<string> { type: SettingsTypes.button; } interface TextSettings extends BaseSettings<string> { type: SettingsTypes.text; } interface ColorSettings extends BaseSettings<string> { type: SettingsTypes.color; } interface TextAreaSettings extends BaseSettings<string> { type: SettingsTypes.textarea; } interface AlertSettings extends BaseSettings<string> { type: SettingsTypes.alert; } interface WarningSettings extends BaseSettings<string> { type: SettingsTypes.warning; } interface InfoSettings extends BaseSettings<string> { type: SettingsTypes.info; } export type PluginSettings = RangeSettings | ComboBoxSettings | CheckboxSettings | ButtonSettings | TextSettings | ColorSettings | TextAreaSettings | AlertSettings | WarningSettings | InfoSettings; export {};