Options
All
  • Public
  • Public/Protected
  • All
Menu

An optional global hook for developer tools (such as the RoosterJS DevTools browser extension) to discover and inspect editor instances on a page.

A developer tool installs an object implementing this interface on window.__ROOSTERJS_DEVTOOLS_HOOK__. When present, each editor will call its callbacks on creation, disposal and for every plugin event. This mirrors the React DevTools global hook pattern: the editor only detects and calls the hook, while all developer-tools logic lives in the tool that installs it.

For tools that attach after editors are created (for example, a script pasted into the console), the library also maintains the array of live editors on window.__ROOSTERJS_DEVTOOLS_EDITORS__.

All members are optional so the contract can grow without breaking older tools. The editor calls each callback defensively and swallows any error, so a faulty tool can never break editing.

Hierarchy

  • RoosterJsDevToolsHook

Index

Properties

Optional onEditorCreated

onEditorCreated: (editor: IEditor) => void

Type declaration

    • Called right after an editor finishes initialization.

      Parameters

      • editor: IEditor

        The editor that was created

      Returns void

Optional onEditorDisposed

onEditorDisposed: (editor: IEditor) => void

Type declaration

    • Called right before an editor is disposed.

      Parameters

      • editor: IEditor

        The editor that is being disposed

      Returns void

Optional onPluginEvent

onPluginEvent: (editor: IEditor, event: PluginEvent) => void

Type declaration

    • Called for every plugin event dispatched by an editor, so a tool can react to content and selection changes. Tools are expected to filter and debounce as needed.

      Parameters

      • editor: IEditor

        The editor that dispatched the event

      • event: PluginEvent

        The plugin event being dispatched

      Returns void

Optional version

version: number

The contract version the editor was built against. The editor stamps this onto the hook when it detects it, so a tool can read it to stay compatible across editor versions. The current contract version is exported as RoosterJsDevToolsHookVersion from roosterjs-content-model-core.

Generated using TypeDoc