mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 08:00:21 +00:00
39
src/types/settingTypes.ts
Normal file
39
src/types/settingTypes.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
export type StorageLocation = "browser" | "server";
|
||||
|
||||
export type SettingInputType =
|
||||
| "boolean"
|
||||
| "number"
|
||||
| "slider"
|
||||
| "combo"
|
||||
| "text"
|
||||
| "hidden";
|
||||
|
||||
export type SettingCustomRenderer = (
|
||||
name: string,
|
||||
setter: (v: any) => void,
|
||||
value: any,
|
||||
attrs: any
|
||||
) => HTMLElement;
|
||||
|
||||
export interface SettingOption {
|
||||
text: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface Setting {
|
||||
id: string;
|
||||
onChange?: (value: any, oldValue?: any) => void;
|
||||
name: string;
|
||||
render: () => HTMLElement;
|
||||
}
|
||||
|
||||
export interface SettingParams {
|
||||
id: string;
|
||||
name: string;
|
||||
type: SettingInputType | SettingCustomRenderer;
|
||||
defaultValue: any;
|
||||
onChange?: (newValue: any, oldValue?: any) => void;
|
||||
attrs?: any;
|
||||
tooltip?: string;
|
||||
options?: Array<string | SettingOption> | ((value: any) => SettingOption[]);
|
||||
}
|
||||
Reference in New Issue
Block a user