KJDRAW / API REFERENCE
API reference
Choose the task-oriented Editor API or search the complete declaration-driven TypeScript reference.
Choose the right API layer
KJDraw publishes two reference layers:
- The Editor API is the recommended application entry. It documents every
createKJDrawEditor()option, property, method and event with JavaScript, React and Vue examples. - The complete TypeScript reference is generated from every public package export and type declaration. Use its search when building custom tools, headless workflows, plugins or file adapters.
Both references are generated during the documentation build. CI rejects stale Editor API names, missing package exports, broken deep links and search-index drift.
Find an API by task
| Task | Start here |
|---|---|
| Mount a ready editor | createKJDrawEditor() in the Editor API |
| Open KJD or DXF | KJDrawEditor.open() |
| Save KJD or DXF | KJDrawEditor.save() |
| Execute, undo or redo an edit | KJDrawEditor.execute(), undo(), redo() |
| Control selection and view | getSelection(), setSelection(), fit(), setTool() |
| Build without the ready editor | KJDrawSDK, KJDocument, commands and transactions in the complete reference |
| Read or propose agent changes | KJAgentToolSession in @kanjieteam/kjdraw/agent-tools and runKJAgentTask in /agent-runner |
| Import or export formats | File-adapter exports and the Files and projects guide |
| Compile domain knowledge | Knowledge-pack and compiler types plus the Knowledge packs guide |
Package entry points
Use the root package for the ready editor and common SDK surface. Import narrower entry points only when the integration needs them:
import { createKJDrawEditor } from '@kanjieteam/kjdraw'
import { KJDraw } from '@kanjieteam/kjdraw/react'
import { KJAgentToolSession } from '@kanjieteam/kjdraw/agent-tools'
import { createDXFFileAdapter } from '@kanjieteam/kjdraw/file/dxf'
The package exports map is authoritative. The complete reference lists only public symbols reachable through those entry points.