Class ExtensionsHandler

Editor configuration handler

It stores the editor configuration and the editor extensions. It also allows to inject new extensions into an editor.

Hierarchy

  • ExtensionsHandler

Implements

Constructors

Properties

_baseConfig: any
_config: any
_configChanged: any
_configurableBuilderMap: any
_disposed: any
_getChangedOptions: any
_immutables: any
_isDisposed: any

Accessors

  • get configChanged(): ISignal<this, Record<string, any>>
  • Signal triggered when the editor configuration changes. It provides the mapping of the new configuration (only those that changed).

    It should result in a call to IExtensionsHandler.reconfigureExtensions.

    Returns ISignal<this, Record<string, any>>

  • get disposed(): ISignal<this, void>
  • A signal emitted when the object is disposed.

    Returns ISignal<this, void>

  • get isDisposed(): boolean
  • Tests whether the object is disposed.

    Returns boolean

Methods

  • Dispose of the resources held by the object.

    Returns void

  • Get a extension builder

    Parameters

    • key: string

      Extension unique identifier

    Returns IConfigurableExtension<any>

    The extension builder

  • Type Parameters

    • T

    Parameters

    • state: EditorState
    • key: string
    • value: T

    Returns StateEffect<unknown>

  • Get a config option for the editor.

    Parameters

    • option: string

    Returns unknown

  • Whether the editor has an extension for the identifier.

    Parameters

    • key: string

      Extension unique identifier

    Returns boolean

    Extension existence

  • Whether the option exists or not.

    Parameters

    • option: string

    Returns boolean

  • Alpha

    Appends extensions to the top-level configuration of the editor.

    Injected extension cannot be removed.

    Notes

    You should prefer registering a IEditorExtensionFactory instead of this feature.

    Parameters

    • view: EditorView

      Editor view

    • extension: Extension

      Editor extension to inject

    Returns void

  • Reconfigures the extension mapped with key with the provided value.

    Type Parameters

    • T

    Parameters

    • view: EditorView

      Editor view

    • key: string

      Parameter unique key

    • value: T

      Parameter value to be applied

    Returns void

  • Reconfigures all the extensions mapped with the options from the provided partial configuration.

    Parameters

    • view: EditorView

      Editor view

    • configuration: Record<string, any>

      Editor configuration

    Returns void

  • Set a base config option for the editor.

    You will need to reconfigure the editor extensions by listening to IExtensionsHandler.configChanged.

    Parameters

    Returns void

  • Set a config option for the editor.

    You will need to reconfigure the editor extensions by listening to IExtensionsHandler.configChanged.

    Parameters

    • option: string
    • value: unknown

    Returns void

  • Set config options for the editor.

    You will need to reconfigure the editor extensions by listening to EditorHandler.configChanged.

    This method is preferred when setting several options. The options are set within an operation, which only performs the costly update at the end, and not after every option is set.

    Parameters

    Returns void

Generated using TypeDoc