API Reference API リファレンス
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). |
PluginRegistry | class | class | 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説明 |
|---|---|---|---|
createStore | function | () => Store | Construct an in-memory store. |
useShape | hook | (id) => ShapeData | React hook for subscribing to a shape. |