Interface IMenuItem<TEvent, TProps>

Since

0.1

MenuItem is used to add row and action to the UI.Menu

Type Parameters

Hierarchy

Methods

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    Returns (() => void)

      • (): void
      • Creates an event emitter instance to listen for the actions

        Returns

        Call the function to remove the event

        Returns void

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    Returns (() => void)

      • (): void
      • Creates an event emitter instance to listen for the actions

        Returns

        Call the function to remove the event

        Returns void

  • Removes the specified event and invokes the callback after it is removed

    Parameters

    Returns void

  • Triggers the event manually.

    Parameters

    • event: "selected" | TEvent
    • Rest ...args: any[]

      Arguments that needs to be passed down

    Returns void

  • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

    Parameters

    Returns void

  • Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

    Parameters

    Returns void

Properties

nativeObject: any
ios: TProps["ios"]
android: TProps["android"]
title: string

Gets/sets the title of a menu item.

Property

Android

Ios

Since

0.1

Events

onSelected: (() => void)

Type declaration

    • (): void
    • This event is called when user selects a menu item.

      Since

      0.1 onSelected

      Android

      Deprecated

      Ios

      Example

      import MenuItem from '@smartface/native/ui/menuitem';

      const menuItem = new MenuItem();
      menuItem.on(MenuItem.Events.Selected, () => {
      console.info('onSelected');
      });

      Returns void

Generated using TypeDoc