Skip to content

Commit

Permalink
feat(event-display): Use types for phoenix menu configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
9inpachi committed Feb 8, 2021
1 parent 2219a3e commit 79e6d7c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Configuration types for PhoenixMenuNode.
*/
export type PhoenixMenuConfig = 'checkbox' | 'slider' | 'button' | 'label' | 'color' | 'rangeSlider';

/**
* A single node of phoenix menu item.
*/
Expand Down Expand Up @@ -98,10 +103,11 @@ export class PhoenixMenuNode {

/**
* Add a config to the phoenix menu item.
* @param type Type of configuration.
* @param options Options for the config.
* @returns The current node.
*/
addConfig(type: string, options: any): PhoenixMenuNode {
addConfig(type: PhoenixMenuConfig, options: any): PhoenixMenuNode {
let configOptions = { type };
Object.assign(configOptions, options);
const configsLength = this.configs.push(configOptions);
Expand Down

0 comments on commit 79e6d7c

Please sign in to comment.