Command

Command class

Constructor

new Command(name, type, keyMapopt)

Parameters:
Name Type Attributes Description
name string

Command name

type number

Command type (Command.TYPE)

keyMap Array.<string> <optional>

keyMap

Members

static TYPE :object

Command Type Constant
markdown : 0
wysiwyg : 1
global : 2

Methods

static factory(typeStr, props) → {Command}

Command factory method

Parameters:
Name Type Description
typeStr string

Editor type name

props object

Property

Properties
Name Type Description
name string

Command name

type number

Command type number

Returns:
Command

getName() → {string}

getName
returns Name of command

Returns:
string -

Command Name

getType() → {number}

getType
returns Type of command

Returns:
number -

Command Command type number

isGlobalType() → {boolean}

isGlobalType
returns whether Command Type is Global or not

Returns:
boolean -

result

isMDType() → {boolean}

isMDType
returns whether Command Type is Markdown or not

Returns:
boolean -

result

isWWType() → {boolean}

isWWType
returns whether Command Type is Wysiwyg or not

Returns:
boolean -

result

setKeyMap(win, mac)

setKeyMap
Set keymap value for each os

Parameters:
Name Type Description
win string

Windows Key(and etc)

mac string

Mac osx key