Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseMode<ModeOptions>

A mode for wed should be implemented as a module which exports a class derived from this class.

Type parameters

  • ModeOptions

Hierarchy

Implements

Index

Constructors

constructor

  • new BaseMode(editor: EditorAPI, options: ModeOptions): BaseMode
  • Parameters

    • editor: EditorAPI

      The editor for which this mode is created.

    • options: ModeOptions

      The options for the mode. Each mode defines what fields this object contains.

    Returns BaseMode

Properties

Protected editor

editor: EditorAPI

The editor for which this mode is created.

Protected options

options: ModeOptions

The options for the mode. Each mode defines what fields this object contains.

Methods

documentationLinkFor

  • documentationLinkFor(_name: string): string | null | undefined
  • While this API provides for the case such URL have not been loaded yet or cannot be loaded, this class does not allow such eventuality to occur. Derived classes could allow it.

    Parameters

    • _name: string

    Returns string | null | undefined

    The default implementation always returns undefined.

Abstract getAbsoluteNamespaceMappings

  • getAbsoluteNamespaceMappings(): Record<string, string>

Abstract getAbsoluteResolver

  • getAbsoluteResolver(): DefaultNameResolver

getAttributeCompletions

  • getAttributeCompletions(_attribute: Attr): string[]

Abstract getContextualActions

  • getContextualActions(transformationType: string | string[], tag: string, container: Node, offset: number): Action<__type>[]
  • Parameters

    • transformationType: string | string[]
    • tag: string
    • container: Node
    • offset: number

    Returns Action<__type>[]

getModeOptions

  • getModeOptions(): ModeOptions
  • Gets the mode options. The returned object should be considered frozen. You may inspect it, not modify it.

    Returns ModeOptions

getStylesheets

  • getStylesheets(): string[]

getToolbarButtons

  • getToolbarButtons(): Button[]

getValidator

getWedOptions

  • getWedOptions(): WedOptions
  • Gets the options that the mode wants wed to use with this mode.

    Returns WedOptions

    The options. Callers are not allowed to modify the value returned.

Abstract init

  • init(): Promise<void>

Abstract makeDecorator

makePlaceholderFor

  • makePlaceholderFor(_element: Element): Element

nodesAroundEditableContents

  • nodesAroundEditableContents(element: Element): [Node | null, Node | null]

shortDescriptionFor

  • shortDescriptionFor(_name: string): string | null | undefined
  • While this API provides for the case where descriptions have not been loaded yet or cannot be loaded, this class does not allow such eventuality to occur. Derived classes could allow it.

    Parameters

    • _name: string

    Returns string | null | undefined

    This default implementation always returns undefined.

Abstract unresolveName

  • unresolveName(name: EName): string | undefined

Object literals

Protected wedOptions

wedOptions: object

label_levels

label_levels: object

initial

initial: number = 1

max

max: number = 1

metadata

metadata: object

authors

authors: string[] = ["Louis-Dominique Dubeau"]

copyright

copyright: string = "Mangalam Research Center for Buddhist Languages"

description

description: string = "The base mode. You should not be using it directly."

license

license: string = "MPL 2.0"

name

name: string = "Base Mode (you should not be using this)"

Generated using TypeDoc