Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

PluginKey

A key is used to tag plugins in a way that makes it possible to find them, given an editor state. Assigning a key does mean only one plugin of that type can be active in a state.

class PluginKey<PluginState = any> {
constructor(name?: string);
get(state: EditorState): Plugin<PluginState> | undefined;
getState(state: EditorState): PluginState | undefined;
}

§Type Parameters

§
PluginState = any
[src]

§Constructors

§
new PluginKey(name?: string)
[src]

Create a plugin key.

§Methods

§
get(state: EditorState): Plugin<PluginState> | undefined
[src]

Get the active plugin with this key, if any, from an editor state.

§
getState(state: EditorState): PluginState | undefined
[src]

Get the plugin's state from an editor state.