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.

pnpm add @edv4h/usketch-sharedDocs →ドキュメント →
Name名前Kind種別SignatureシグネチャDescription説明
UsketchPlugintypeinterfacePlugin interface every plugin implements.
PluginContexttypeinterfaceRegistries + services exposed in setup().
ShapeDatatypetypeCanonical shape record.
withRotationfunction(fn) => fnHit-test helper that applies shape rotation.
DEFAULT_STYLEconstShapeStyleDefault style tokens for new shapes.

@edv4h/usketch-core

createApp factory and AppInstance implementation. Wires plugins together.

pnpm add @edv4h/usketch-coreDocs →ドキュメント →
Name名前Kind種別SignatureシグネチャDescription説明
createAppfunction(opts) => AppInstanceEntry point — constructs an app from store + plugins.
AppInstancetypeinterfaceRuntime handle to the app (dispose, plugins, ctx).
createPluginRegistryfunction() => PluginRegistryRegistry for plugin lifecycle management.

@edv4h/usketch-shape-utils

Pure helpers for shape bounds, hit testing, resize, and GPU primitives.

pnpm add @edv4h/usketch-shape-utilsDocs →ドキュメント →
Name名前Kind種別SignatureシグネチャDescription説明
getBoundsfunction(data) => BoundingBoxAxis-aligned bounding box.
aabbHitTestfunction(data, point) => booleanAABB hit test.
createResizefunction(min) => ResizerFactory returning an 8-handle resize function.
pointInPolygonfunction(p, poly) => booleanRay-casting point-in-polygon check.

@edv4h/usketch-store

Zustand + Yjs backed document store. Selectors, transactions, undo/redo.

pnpm add @edv4h/usketch-storeDocs →ドキュメント →
Name名前Kind種別SignatureシグネチャDescription説明
createBoardStorefunction() => BoardStoreConstruct a Zustand + Yjs backed board store.
createAddShapeCommandfunction(shape) => CommandCommand factory that adds a shape to the store.