mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 18:07:02 -04:00
feat: settings sliders (#120)
Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
parent
efab399309
commit
1f50f78912
10 changed files with 123 additions and 40 deletions
|
@ -70,13 +70,15 @@ export enum OptionType {
|
|||
BIGINT,
|
||||
BOOLEAN,
|
||||
SELECT,
|
||||
SLIDER,
|
||||
}
|
||||
|
||||
export type PluginOptionsItem =
|
||||
| PluginOptionString
|
||||
| PluginOptionNumber
|
||||
| PluginOptionBoolean
|
||||
| PluginOptionSelect;
|
||||
| PluginOptionSelect
|
||||
| PluginOptionSlider;
|
||||
|
||||
export interface PluginOptionBase {
|
||||
description: string;
|
||||
|
@ -132,4 +134,24 @@ export interface PluginOptionSelectOption {
|
|||
default?: boolean;
|
||||
}
|
||||
|
||||
export interface PluginOptionSlider extends PluginOptionBase {
|
||||
type: OptionType.SLIDER;
|
||||
/**
|
||||
* All the possible values in the slider. Needs at least two values.
|
||||
*/
|
||||
markers: number[];
|
||||
/**
|
||||
* Default value to use
|
||||
*/
|
||||
default: number;
|
||||
/**
|
||||
* If false, allow users to select values in-between your markers.
|
||||
*/
|
||||
stickToMarkers?: boolean;
|
||||
/**
|
||||
* Prevents the user from saving settings if this is false or a string
|
||||
*/
|
||||
isValid?(value: number): number;
|
||||
}
|
||||
|
||||
export type IpcRes<V = any> = { ok: true; value: V; } | { ok: false, error: any; };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue