Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CommandManager

new CommandManager(platform, commands)

param

Identifier for the platform; must be either "mac" or "win"

param

A list of commands

Hierarchy

Index

Properties

byName

byName: CommandMap

commands

commands: CommandMap

Methods

_emit

  • _emit(eventName: any, e: any): any

_signal

  • _signal(eventName: any, e: any): void

addCommand

  • addCommand(command: Command): void

addCommands

  • addCommands(command: Command[]): void

addEventListener

  • addEventListener(name: string, callback: Function, capturing?: boolean): void

bindKey

  • bindKey(key: string | { mac?: string; win?: string }, command: CommandLike, position?: number): void
  • Parameters

    • key: string | { mac?: string; win?: string }
    • command: CommandLike
    • Optional position: number

    Returns void

bindKeys

  • bindKeys(keys: {}): void
  • Parameters

    • keys: {}
      • [s: string]: Function

    Returns void

exec

  • exec(command: string, editor: Editor, args: any): boolean

findKeyCommand

  • findKeyCommand(hashId: number, keyString: string): string
  • Parameters

    • hashId: number
    • keyString: string

    Returns string

getStatusText

  • getStatusText(editor: Editor, data: {}): string

handleKeyboard

  • handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: string | number): void | { command: string }
  • Parameters

    • data: {}
    • hashId: number
    • keyString: string
    • keyCode: string | number

    Returns void | { command: string }

off

  • off(name: string, callback: Function): void

on

  • on(name: "exec", callback: execEventHandler): Function
  • on(name: "afterExec", callback: execEventHandler): Function
  • on(name: string, callback: Function, capturing?: boolean): void

once

  • once(name: string, callback: Function): void

parseKeys

  • parseKeys(keyPart: string): { hashId: number; key: string }
  • Parameters

    • keyPart: string

    Returns { hashId: number; key: string }

    • hashId: number
    • key: string

removeAllListeners

  • removeAllListeners(name?: string): void

removeCommand

  • removeCommand(command: string | Command, keepCommand?: boolean): void
  • Parameters

    • command: string | Command
    • Optional keepCommand: boolean

    Returns void

removeCommands

  • removeCommands(command: Command[]): void

removeDefaultHandler

  • removeDefaultHandler(name: string, callback: Function): void

removeEventListener

  • removeEventListener(name: string, callback: Function): void

removeListener

  • removeListener(name: string, callback: Function): void

replay

  • replay(editor: Editor): void

setDefaultHandler

  • setDefaultHandler(name: string, callback: Function): void

setupIncrementalSearch

  • setupIncrementalSearch(editor: any, val: any): void

toggleRecording

  • toggleRecording(editor: Editor): void

trimMacro

  • trimMacro(m: any): any

Generated using TypeDoc