Interface IEditorExtensionFactory<T>

Editor extension factory interface.

interface IEditorExtensionFactory<T> {
    default?: T;
    factory: ((options) => null | IConfigurableExtension<T>);
    name: string;
    schema?: ReadonlyJSONObject;
}

Type Parameters

  • T = undefined

    Extension parameter type.

Properties

default?: T

Extension default value

Notes

If undefined but has a schema, the default value will be null to be JSON serializable.

factory: ((options) => null | IConfigurableExtension<T>)

Extension factory.

Type declaration

Returns

The extension builder or null if the extension is not active for that document

name: string

Editor extension unique identifier.

JSON schema defining the configurable option through user settings.

If this is defined, every time the setting changes, IConfigurableExtension.reconfigure will be called with the new setting value.

Notes

If no default value is provided, IEditorExtensionFactory.default will be used. If the extension is to be handled by the code only, this should not be defined.