refactor: introduce dedicated identifier types for improved clarity and type safety
This commit is contained in:
@@ -4,10 +4,10 @@ import { PlusIcon } from './icons';
|
||||
|
||||
import useFloatingMenu from './useFloatingMenu';
|
||||
|
||||
type QuickAddOption = string | number | { id?: string | number; label?: string; name?: string;[key: string]: unknown };
|
||||
type QuickAddOption = string | { id?: string; label?: string; name?: string;[key: string]: unknown };
|
||||
|
||||
interface NormalizedOption {
|
||||
id?: string | number;
|
||||
id?: string;
|
||||
label: string;
|
||||
original: QuickAddOption;
|
||||
index: number;
|
||||
@@ -47,7 +47,7 @@ interface FloatingMenuState {
|
||||
updatePosition: () => void;
|
||||
}
|
||||
|
||||
type CSSVarStyle = CSSProperties & Record<string, string | number>;
|
||||
type CSSVarStyle = CSSProperties & Record<string, string>;
|
||||
|
||||
export interface QuickAddMenuProps {
|
||||
onSelectOption?: (value: QuickAddOption, normalized: NormalizedOption) => Promise<void> | void;
|
||||
|
||||
Reference in New Issue
Block a user