-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(event-display): add types for Phoenix menu configs
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
packages/phoenix-event-display/src/managers/ui-manager/phoenix-menu/config-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** Type for Phoenix menu "label" config. */ | ||
export type ConfigLabel = { | ||
label: string; | ||
}; | ||
|
||
/** Type for Phoenix menu "checkbox" config. */ | ||
export type ConfigCheckbox = ConfigLabel & { | ||
isChecked: boolean; | ||
onChange: (value: boolean) => void; | ||
}; | ||
|
||
/** Type for Phoenix menu "slider" config. */ | ||
export type ConfigConfigSlider = ConfigLabel & { | ||
value: number; | ||
min: number; | ||
max: number; | ||
step: number; | ||
allowCustomValue: boolean; | ||
onChange: (value: number) => void; | ||
}; | ||
|
||
/** Type for Phoenix menu "button" config. */ | ||
export type ConfigButton = ConfigLabel & { | ||
onClick: () => void; | ||
}; | ||
|
||
/** Type for Phoenix menu "color" config. */ | ||
export type ConfigColor = ConfigLabel & { | ||
color: string; | ||
onChange: (value: string) => void; | ||
}; | ||
|
||
/** Type for Phoenix menu "rangeSlider" config. */ | ||
export type ConfigRangeSlider = ConfigLabel & { | ||
value: number; | ||
highValue: number; | ||
min: number; | ||
max: number; | ||
step: number; | ||
onChange: (valueRange: { value: number; highValue: number }) => void; | ||
}; | ||
|
||
/** Type for Phoenix menu "select" config. */ | ||
export type ConfigSelect = ConfigLabel & { | ||
options: string[]; | ||
onChange: (selectedOption: string) => void; | ||
}; |