About
@nanoforge-dev/editor-lib is the bridge between a running NanoForge application and an external editor host. EditorLibrary turns the raw toEditor/fromEditor event-emitter pair supplied via RunOptions.editor into the Context.editor facade every other library sees, and handles the pause/resume/step/stop commands, run state reports, frame stats and log forwarding: see the editor protocol.
It also provides QueuedEventEmitter, the event emitter an editor host gives a game in RunOptions.editor.
Installation
Node.js 26 or newer is required.Example usage
RegisterEditorLibrary alongside your other libraries. It does nothing when no editor started the app:
QueuedEventEmitter per direction and hands both to RunOptions.editor:
Context.editor, undefined when no editor started the game:
__editorInit, which EditorLibrary calls once on every library that has it, when the editor’s welcome arrives:
Links
Contributing
Before creating an issue, please ensure that it hasn’t already been reported/suggested, and double-check the documentation.See the contribution guide if you’d like to submit a PR.
Help
If you don’t understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don’t hesitate to ask questions in discussions.Enumerations
Classes
Interfaces
- EditorAwareLibrary
- EditorChannels
- EditorCommandMap
- EditorContextApi
- EditorEventMap
- EditorFeatures
- EditorFrameStats
- EditorHello
- EditorLog
- EditorNetworkStats
- EditorNetworkTotals
- EditorNetworkTrace
- EditorTiming
- EditorWelcome
