KJDrawDocs

KJDRAW / INSTALLATION

Installation

Choose the npm channel, runtime and import path that match your application.

Requirements

  • Node.js 22 or newer for server-side and command-line applications.
  • A modern browser with ES modules, Canvas 2D, WebAssembly and Web Crypto for browser products.
  • npm, pnpm or another package manager that understands package exports.

KJDraw's core has no runtime npm dependencies. React and Vue are optional peer dependencies: install the framework your application uses when importing /react or /vue. Headless and plain TypeScript applications do not need either framework.

Release channels

IntentCommand
Try the published release-candidate channelnpm install @kanjieteam/kjdraw@next
Check available version tagsnpm view @kanjieteam/kjdraw dist-tags
Install a built local checkoutnpm install /path/to/kjdraw/packages/kjdraw-sdk

These source documents may describe APIs newer than the published next package. Check the resolved version with npm list @kanjieteam/kjdraw before using version-marked APIs. The npm latest tag is not a stable 1.0 release yet. For the documented candidate, clone the repository, run npm install && npm run build:runtime && npm run build:types there, then install its packages/kjdraw-sdk directory into your application. Pin an exact published version for reproducible builds.

Verify the installation

Run the packaged quickstart directly from a clean project:

node node_modules/@kanjieteam/kjdraw/examples/quickstart.mjs

A successful run prints JSON containing the installed SDK version, document ID and one created line. It needs no browser, model or API key.

Public imports

Use the root for the common SDK surface and subpaths when you want a smaller, explicit contract.

import { createKJDrawSDK } from '@kanjieteam/kjdraw'
import { createDXFFileAdapter } from '@kanjieteam/kjdraw/file/dxf'
import { KJDeploymentRegistry } from '@kanjieteam/kjdraw/deployment'

The API Reference lists every supported package entry and its public types.

KJDRAW / 安装

安装

根据应用形态选择 npm 渠道、运行环境和导入路径。

环境要求

  • 服务端与命令行应用使用 Node.js 22 或更高版本。
  • 浏览器产品需要支持 ES Modules、Canvas 2D、WebAssembly 与 Web Crypto 的现代浏览器。
  • npm、pnpm 或其他能够解析 package exports 的包管理器。

KJDraw 核心的 npm 运行时依赖为零。React、Vue 是可选 peer dependency:导入 /react 或 /vue 时,安装应用所用的框架即可。无界面程序和原生 TypeScript 应用无需安装这两个框架。

发布渠道

目标命令
试用已发布的候选版渠道npm install @kanjieteam/kjdraw@next
查询可用版本标签npm view @kanjieteam/kjdraw dist-tags
安装已构建的本地源码npm install /path/to/kjdraw/packages/kjdraw-sdk

本源码文档可能包含比 npm next 包更新的 API。使用标注版本的 API 前,先运行 npm list @kanjieteam/kjdraw 核对实际安装版本。npm latest 标签目前也不是稳定 1.0。若需使用本文档对应的候选版,请克隆仓库,在仓库中运行 npm install && npm run build:runtime && npm run build:types,然后在你的应用里安装其 packages/kjdraw-sdk 目录。需要可复现构建时,锁定已经公开发布的确切版本。

验证安装

在干净工程中直接运行安装包自带的快速示例:

node node_modules/@kanjieteam/kjdraw/examples/quickstart.mjs

运行成功后会输出 JSON,其中包含已安装的 SDK 版本、图档 ID 和一条创建完成的直线。该示例不需要浏览器、模型或 API Key。

公共导入路径

常用 SDK 能力从根入口导入;当你希望边界更小、更明确时使用子路径。

import { createKJDrawSDK } from '@kanjieteam/kjdraw'
import { createDXFFileAdapter } from '@kanjieteam/kjdraw/file/dxf'
import { KJDeploymentRegistry } from '@kanjieteam/kjdraw/deployment'

API Reference列出了全部受支持的包入口及其公开类型。

Guides, Editor API and complete type reference指南、Editor API 与完整类型参考