Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace ui

Static convenience ui functions

const { alert } = require('./ui');
ui.alert('Hello world');

Index

Functions

alert

  • alert(optionsOrText: Object | string): XapiResult

alertHide

debug

  • debug(on?: boolean): void
  • Enable/disable debugging. This will print out any ui events in console.log

    Parameters

    • Optional on: boolean

    Returns void

onUsbKeyPressed

  • onUsbKeyPressed(callback: (key: string, code: number) => void): XapiResult
  • Parameters

    • callback: (key: string, code: number) => void
        • (key: string, code: number): void
        • Parameters

          • key: string
          • code: number

          Returns void

    Returns XapiResult

onUsbKeyReleased

  • onUsbKeyReleased(callback: (key: string, code: number) => void): XapiResult
  • Parameters

    • callback: (key: string, code: number) => void
        • (key: string, code: number): void
        • Parameters

          • key: string
          • code: number

          Returns void

    Returns XapiResult

panelClose

panelOpen

  • panelOpen(PanelId: string, PageId?: string): XapiResult

panelRemove

panelSave

prompt

  • prompt(props: Object, options: string[]): XapiResult
  • Promps users with a multiple choice dialog. When user selects an option, an event is generated.

    Note: You can use the options parameter to enter options more conveniently.

    Also, you can add an optional callback for when the user chooses an option. This is similar to using ui(...).onPromptResponse(...)

    Example:

    const options = ['Under 18', 'Over 18', 'Dinosaur'];
    ui.prompt({
     Title: 'Age Check',
     Text: 'How old are you?',
     FeedbackId: 'age-check',
    }, options, idx => console.log('You chose:' + options[idx]));
    

    See https://roomos.cisco.com/xapi/Command.UserInterface.Message.Prompt.Display for details.

    Parameters

    • props: Object
    • options: string[]

    Returns XapiResult

promptHide

scale

  • scale(from: Range, to: Range, value: number): number
  • Transforms (linearly) a value btw two range systems.

    Typically useful for sliders, eg you are converting values from a ui slider (0,255) to a volume setting (0-100)

    const v = scale(
      { min: 0, max: 255 },
      { min: 0, max: 100 },
      128
    ); // => 50
    

    Parameters

    • from: Range

      The range you are converting from

    • to: Range

      The range you are converting to

    • value: number

      The value you are converting

    Returns number

textInput

  • textInput(props: Object, callback: (text: string) => void): XapiResult

textInputHide

textLine

textLineHide

webViewClose

webViewOpen

  • webViewOpen(url: string, name?: string): XapiResult

Generated using TypeDoc