API ReferenceAPI リファレンス
Public surface of the core packages. For full type signatures, see the package in the docs.コアパッケージの公開 API。完全な型シグネチャはドキュメントの該当ページを参照してください。
@edv4h/usketch-shared
Core types, schemas, and framework-agnostic helpers shared across all packages.
| Name名前 | Kind種別 | Signatureシグネチャ | Description説明 |
|---|---|---|---|
UsketchPlugin | type | interface | Plugin interface every plugin implements. |
PluginContext | type | interface | Registries + services exposed in setup(). |
ShapeData | type | type | Canonical shape record. |
withRotation | function | (fn) => fn | Hit-test helper that applies shape rotation. |
DEFAULT_STYLE | const | ShapeStyle | Default style tokens for new shapes. |
@edv4h/usketch-core
createApp factory and AppInstance implementation. Wires plugins together.
| Name名前 | Kind種別 | Signatureシグネチャ | Description説明 |
|---|---|---|---|
createApp | function | (opts) => AppInstance | Entry point — constructs an app from store + plugins. |
AppInstance | type | interface | Runtime handle to the app (dispose, plugins, ctx). |
createPluginRegistry | function | () => PluginRegistry | Registry for plugin lifecycle management. |
@edv4h/usketch-shape-utils
Pure helpers for shape bounds, hit testing, resize, and GPU primitives.
| Name名前 | Kind種別 | Signatureシグネチャ | Description説明 |
|---|---|---|---|
getBounds | function | (data) => BoundingBox | Axis-aligned bounding box. |
aabbHitTest | function | (data, point) => boolean | AABB hit test. |
createResize | function | (min) => Resizer | Factory returning an 8-handle resize function. |
pointInPolygon | function | (p, poly) => boolean | Ray-casting point-in-polygon check. |
@edv4h/usketch-store
Zustand + Yjs backed document store. Selectors, transactions, undo/redo.
| Name名前 | Kind種別 | Signatureシグネチャ | Description説明 |
|---|---|---|---|
createBoardStore | function | () => BoardStore | Construct a Zustand + Yjs backed board store. |
createAddShapeCommand | function | (shape) => Command | Command factory that adds a shape to the store. |