Refactor Setting class to fix state loss issue, update range callback return type, and remove isStringOrNumber utility function

This commit is contained in:
Harvey Zack committed 2024-10-20 13:56:22 +08:00
1 parent 191c7736c4
commit b949fedc06
9 files changed
+22 -40

No files matched your search

+7 -3
View File
@@ -4,13 +4,17 @@ type Props<T> = {
html: string;
icon: string;
tooltip: string;
$item: HTMLDivElement;
$icon: HTMLDivElement;
$html: HTMLDivElement;
$tooltip: HTMLDivElement;
$switch: boolean;
$switch: HTMLDivElement;
$range: HTMLInputElement;
$parentItem: Setting;
$parentList: Setting[];
$parent: Setting;
$parents: Setting[];
$option: Setting[];
$events: Function[];
$formatted: boolean;
} & Omit<T, 'html' | 'icon' | 'tooltip'>;
export type SettingOption = Props<Setting>;
-1
View File
@@ -49,7 +49,6 @@ export type Utils = {
secondToTime(second: number): string;
escape(str: string): string;
capitalize(str: string): string;
isStringOrNumber(val: any): boolean;
getIcon(key: string, html: string | HTMLElement): HTMLElement;
supportsFlex(): boolean;
setStyleText(element: HTMLElement, text: string): void;