Skip to content

CodeMirrorModule.defineMode method

CodeMirrorModule › defineMode

Unofficial

Registers a new editor mode.

Signature:

defineMode(name: string, modeFactory: Cm5ModeFactory<T>, dependencies?: string[]): void

Parameters:

ParameterTypeDescription
namestringThe mode name.
modeFactoryCm5ModeFactory<T>The factory function that creates the mode.
dependencies?string[]The names of the modes this mode is built on top of.

Returns: void