Skip to content

EditorExtensions beta ​

Class of @v12-engine/editor

ts
export declare class EditorExtensions

The extensions of an editor (editor.extensions): add(extension) puts everything of it into the editor and gives back what takes all of it away again, remove(id) does that by its id; list(), get(id), has(id)

Members ​

constructor ​

ts
constructor(editor: EditorClient, 
    registry?: ExtensionRegistry);

Constructs a new instance of the EditorExtensions class

add ​

ts
add(extension: EditorExtension, options?: {
        version?: boolean;
    }): () => void;

Puts an extension into the editor: its panels, tools, actions, menus, search, Inspector sections, kinds, icons, themes and layouts, then its setup. One of the same id is taken away first, and the Console says so. Gives back what takes it away

get ​

ts
get(id: string): EditorExtension | undefined;

The extension that was added under that id, or undefined when there is none

has ​

ts
has(id: string): boolean;

Whether an extension of that id is added now

list ​

ts
list(): EditorExtension[];

The extensions in the editor, in the order they came

onChange ​

ts
onChange(listener: () => void): () => void;

Told as one comes or goes. Gives back what stops it

remove ​

ts
remove(id: string): void;

Takes an extension away, everything it brought, by its id