samcan 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{license → LICENSE} +3 -1
- package/README.md +3 -0
- package/dist/camera/index.cjs +370 -0
- package/dist/camera/index.d.cts +54 -0
- package/dist/camera/index.d.ts +54 -0
- package/dist/camera/index.js +70 -0
- package/dist/document/index.cjs +735 -0
- package/dist/document/index.d.cts +174 -0
- package/dist/document/index.d.ts +174 -0
- package/dist/document/index.js +161 -0
- package/dist/editor/index.cjs +5007 -0
- package/dist/editor/index.d.cts +374 -0
- package/dist/editor/index.d.ts +374 -0
- package/dist/editor/index.js +2401 -0
- package/dist/engine/index.cjs +3752 -0
- package/dist/engine/index.d.cts +183 -0
- package/dist/engine/index.d.ts +183 -0
- package/dist/engine/index.js +111 -0
- package/dist/index.cjs +8899 -0
- package/dist/index.d.cts +962 -0
- package/dist/index.d.ts +962 -46
- package/dist/index.js +1008 -49
- package/dist/math/index.cjs +2230 -0
- package/dist/math/index.d.cts +302 -0
- package/dist/math/index.d.ts +302 -0
- package/dist/math/index.js +1109 -0
- package/dist/renderer/index.cjs +1865 -0
- package/dist/renderer/index.d.cts +91 -0
- package/dist/renderer/index.d.ts +91 -0
- package/dist/renderer/index.js +89 -0
- package/dist/shared/chunk-35pkr0zs.js +110 -0
- package/dist/shared/chunk-7sr7q84y.js +80 -0
- package/dist/shared/chunk-87399bz7.js +89 -0
- package/dist/shared/chunk-8ynnz57m.js +129 -0
- package/dist/shared/chunk-d6gxvapt.js +500 -0
- package/dist/shared/chunk-hewznwbd.js +305 -0
- package/dist/shared/chunk-jdvrd5tv.js +623 -0
- package/dist/shared/chunk-rvag1j46.js +461 -0
- package/dist/shared/chunk-rzxyjwk8.js +397 -0
- package/dist/shared/chunk-s3qdcmcq.js +1392 -0
- package/dist/shared/chunk-v53jprrn.js +68 -0
- package/dist/shared/chunk-wa3772hp.js +117 -0
- package/dist/spatial/index.cjs +954 -0
- package/dist/spatial/index.d.cts +136 -0
- package/dist/spatial/index.d.ts +136 -0
- package/dist/spatial/index.js +301 -0
- package/dist/stroke/index.cjs +1010 -0
- package/dist/stroke/index.d.cts +143 -0
- package/dist/stroke/index.d.ts +143 -0
- package/dist/stroke/index.js +343 -0
- package/package.json +122 -58
- package/dist/bundle.js +0 -5888
- package/dist/core/animation/animationruntime.d.ts +0 -238
- package/dist/core/animation/animationruntime.d.ts.map +0 -1
- package/dist/core/animation/animationruntime.js +0 -530
- package/dist/core/animation/animationruntime.js.map +0 -1
- package/dist/core/animation/animationstate.d.ts +0 -85
- package/dist/core/animation/animationstate.d.ts.map +0 -1
- package/dist/core/animation/animationstate.js +0 -119
- package/dist/core/animation/animationstate.js.map +0 -1
- package/dist/core/animation/animationtrack.d.ts +0 -55
- package/dist/core/animation/animationtrack.d.ts.map +0 -1
- package/dist/core/animation/animationtrack.js +0 -185
- package/dist/core/animation/animationtrack.js.map +0 -1
- package/dist/core/animation/easing.d.ts +0 -80
- package/dist/core/animation/easing.d.ts.map +0 -1
- package/dist/core/animation/easing.js +0 -126
- package/dist/core/animation/easing.js.map +0 -1
- package/dist/core/animation/index.d.ts +0 -11
- package/dist/core/animation/index.d.ts.map +0 -1
- package/dist/core/animation/index.js +0 -10
- package/dist/core/animation/index.js.map +0 -1
- package/dist/core/animation/interpolator.d.ts +0 -82
- package/dist/core/animation/interpolator.d.ts.map +0 -1
- package/dist/core/animation/interpolator.js +0 -108
- package/dist/core/animation/interpolator.js.map +0 -1
- package/dist/core/animation/keyframe.d.ts +0 -52
- package/dist/core/animation/keyframe.d.ts.map +0 -1
- package/dist/core/animation/keyframe.js +0 -65
- package/dist/core/animation/keyframe.js.map +0 -1
- package/dist/core/animation/logger.d.ts +0 -8
- package/dist/core/animation/logger.d.ts.map +0 -1
- package/dist/core/animation/logger.js +0 -20
- package/dist/core/animation/logger.js.map +0 -1
- package/dist/core/animation/statemachine.d.ts +0 -178
- package/dist/core/animation/statemachine.d.ts.map +0 -1
- package/dist/core/animation/statemachine.js +0 -378
- package/dist/core/animation/statemachine.js.map +0 -1
- package/dist/core/animation/statetransition.d.ts +0 -142
- package/dist/core/animation/statetransition.d.ts.map +0 -1
- package/dist/core/animation/statetransition.js +0 -189
- package/dist/core/animation/statetransition.js.map +0 -1
- package/dist/core/animation/timeline.d.ts +0 -62
- package/dist/core/animation/timeline.d.ts.map +0 -1
- package/dist/core/animation/timeline.js +0 -102
- package/dist/core/animation/timeline.js.map +0 -1
- package/dist/core/api.d.ts +0 -245
- package/dist/core/api.d.ts.map +0 -1
- package/dist/core/api.js +0 -369
- package/dist/core/api.js.map +0 -1
- package/dist/core/asset/assetmanager.d.ts +0 -196
- package/dist/core/asset/assetmanager.d.ts.map +0 -1
- package/dist/core/asset/assetmanager.js +0 -502
- package/dist/core/asset/assetmanager.js.map +0 -1
- package/dist/core/asset/index.d.ts +0 -3
- package/dist/core/asset/index.d.ts.map +0 -1
- package/dist/core/asset/index.js +0 -3
- package/dist/core/asset/index.js.map +0 -1
- package/dist/core/asset/types.d.ts +0 -36
- package/dist/core/asset/types.d.ts.map +0 -1
- package/dist/core/asset/types.js +0 -1
- package/dist/core/asset/types.js.map +0 -1
- package/dist/core/command/basecommand.d.ts +0 -29
- package/dist/core/command/basecommand.d.ts.map +0 -1
- package/dist/core/command/basecommand.js +0 -36
- package/dist/core/command/basecommand.js.map +0 -1
- package/dist/core/command/command.d.ts +0 -55
- package/dist/core/command/command.d.ts.map +0 -1
- package/dist/core/command/command.js +0 -1
- package/dist/core/command/command.js.map +0 -1
- package/dist/core/command/commandhistory.d.ts +0 -76
- package/dist/core/command/commandhistory.d.ts.map +0 -1
- package/dist/core/command/commandhistory.js +0 -122
- package/dist/core/command/commandhistory.js.map +0 -1
- package/dist/core/command/editorcommands.d.ts +0 -108
- package/dist/core/command/editorcommands.d.ts.map +0 -1
- package/dist/core/command/editorcommands.js +0 -274
- package/dist/core/command/editorcommands.js.map +0 -1
- package/dist/core/command/index.d.ts +0 -5
- package/dist/core/command/index.d.ts.map +0 -1
- package/dist/core/command/index.js +0 -5
- package/dist/core/command/index.js.map +0 -1
- package/dist/core/editor/events/emitter.d.ts +0 -45
- package/dist/core/editor/events/emitter.d.ts.map +0 -1
- package/dist/core/editor/events/emitter.js +0 -88
- package/dist/core/editor/events/emitter.js.map +0 -1
- package/dist/core/error/animationerror.d.ts +0 -27
- package/dist/core/error/animationerror.d.ts.map +0 -1
- package/dist/core/error/animationerror.js +0 -41
- package/dist/core/error/animationerror.js.map +0 -1
- package/dist/core/error/asseterror.d.ts +0 -32
- package/dist/core/error/asseterror.d.ts.map +0 -1
- package/dist/core/error/asseterror.js +0 -48
- package/dist/core/error/asseterror.js.map +0 -1
- package/dist/core/error/index.d.ts +0 -7
- package/dist/core/error/index.d.ts.map +0 -1
- package/dist/core/error/index.js +0 -7
- package/dist/core/error/index.js.map +0 -1
- package/dist/core/error/pluginerror.d.ts +0 -22
- package/dist/core/error/pluginerror.d.ts.map +0 -1
- package/dist/core/error/pluginerror.js +0 -33
- package/dist/core/error/pluginerror.js.map +0 -1
- package/dist/core/error/renderererror.d.ts +0 -26
- package/dist/core/error/renderererror.d.ts.map +0 -1
- package/dist/core/error/renderererror.js +0 -40
- package/dist/core/error/renderererror.js.map +0 -1
- package/dist/core/error/samcanerror.d.ts +0 -72
- package/dist/core/error/samcanerror.d.ts.map +0 -1
- package/dist/core/error/samcanerror.js +0 -108
- package/dist/core/error/samcanerror.js.map +0 -1
- package/dist/core/error/serializationerror.d.ts +0 -31
- package/dist/core/error/serializationerror.d.ts.map +0 -1
- package/dist/core/error/serializationerror.js +0 -46
- package/dist/core/error/serializationerror.js.map +0 -1
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -12
- package/dist/core/index.js.map +0 -1
- package/dist/core/math/color.d.ts +0 -56
- package/dist/core/math/color.d.ts.map +0 -1
- package/dist/core/math/color.js +0 -125
- package/dist/core/math/color.js.map +0 -1
- package/dist/core/math/index.d.ts +0 -14
- package/dist/core/math/index.d.ts.map +0 -1
- package/dist/core/math/index.js +0 -14
- package/dist/core/math/index.js.map +0 -1
- package/dist/core/math/matrix.d.ts +0 -101
- package/dist/core/math/matrix.d.ts.map +0 -1
- package/dist/core/math/matrix.js +0 -177
- package/dist/core/math/matrix.js.map +0 -1
- package/dist/core/math/paint.d.ts +0 -104
- package/dist/core/math/paint.d.ts.map +0 -1
- package/dist/core/math/paint.js +0 -204
- package/dist/core/math/paint.js.map +0 -1
- package/dist/core/math/path/index.d.ts +0 -94
- package/dist/core/math/path/index.d.ts.map +0 -1
- package/dist/core/math/path/index.js +0 -180
- package/dist/core/math/path/index.js.map +0 -1
- package/dist/core/math/path/operations.d.ts +0 -38
- package/dist/core/math/path/operations.d.ts.map +0 -1
- package/dist/core/math/path/operations.js +0 -149
- package/dist/core/math/path/operations.js.map +0 -1
- package/dist/core/math/pool.d.ts +0 -54
- package/dist/core/math/pool.d.ts.map +0 -1
- package/dist/core/math/pool.js +0 -97
- package/dist/core/math/pool.js.map +0 -1
- package/dist/core/math/pools.d.ts +0 -29
- package/dist/core/math/pools.d.ts.map +0 -1
- package/dist/core/math/pools.js +0 -50
- package/dist/core/math/pools.js.map +0 -1
- package/dist/core/math/rectangle.d.ts +0 -68
- package/dist/core/math/rectangle.d.ts.map +0 -1
- package/dist/core/math/rectangle.js +0 -124
- package/dist/core/math/rectangle.js.map +0 -1
- package/dist/core/math/utils.d.ts +0 -68
- package/dist/core/math/utils.d.ts.map +0 -1
- package/dist/core/math/utils.js +0 -110
- package/dist/core/math/utils.js.map +0 -1
- package/dist/core/math/vector2.d.ts +0 -85
- package/dist/core/math/vector2.d.ts.map +0 -1
- package/dist/core/math/vector2.js +0 -134
- package/dist/core/math/vector2.js.map +0 -1
- package/dist/core/plugin/animationcontroller.d.ts +0 -43
- package/dist/core/plugin/animationcontroller.d.ts.map +0 -1
- package/dist/core/plugin/animationcontroller.js +0 -11
- package/dist/core/plugin/animationcontroller.js.map +0 -1
- package/dist/core/plugin/index.d.ts +0 -6
- package/dist/core/plugin/index.d.ts.map +0 -1
- package/dist/core/plugin/index.js +0 -4
- package/dist/core/plugin/index.js.map +0 -1
- package/dist/core/plugin/plugin.d.ts +0 -53
- package/dist/core/plugin/plugin.d.ts.map +0 -1
- package/dist/core/plugin/plugin.js +0 -29
- package/dist/core/plugin/plugin.js.map +0 -1
- package/dist/core/plugin/pluginregistry.d.ts +0 -71
- package/dist/core/plugin/pluginregistry.d.ts.map +0 -1
- package/dist/core/plugin/pluginregistry.js +0 -143
- package/dist/core/plugin/pluginregistry.js.map +0 -1
- package/dist/core/renderer/batchmanager.d.ts +0 -68
- package/dist/core/renderer/batchmanager.d.ts.map +0 -1
- package/dist/core/renderer/batchmanager.js +0 -82
- package/dist/core/renderer/batchmanager.js.map +0 -1
- package/dist/core/renderer/canvas2drenderer.d.ts +0 -139
- package/dist/core/renderer/canvas2drenderer.d.ts.map +0 -1
- package/dist/core/renderer/canvas2drenderer.js +0 -499
- package/dist/core/renderer/canvas2drenderer.js.map +0 -1
- package/dist/core/renderer/dirtyregionmanager.d.ts +0 -54
- package/dist/core/renderer/dirtyregionmanager.d.ts.map +0 -1
- package/dist/core/renderer/dirtyregionmanager.js +0 -129
- package/dist/core/renderer/dirtyregionmanager.js.map +0 -1
- package/dist/core/renderer/index.d.ts +0 -8
- package/dist/core/renderer/index.d.ts.map +0 -1
- package/dist/core/renderer/index.js +0 -6
- package/dist/core/renderer/index.js.map +0 -1
- package/dist/core/renderer/renderer.d.ts +0 -154
- package/dist/core/renderer/renderer.d.ts.map +0 -1
- package/dist/core/renderer/renderer.js +0 -1
- package/dist/core/renderer/renderer.js.map +0 -1
- package/dist/core/renderer/rendererfactory.d.ts +0 -66
- package/dist/core/renderer/rendererfactory.d.ts.map +0 -1
- package/dist/core/renderer/rendererfactory.js +0 -219
- package/dist/core/renderer/rendererfactory.js.map +0 -1
- package/dist/core/renderer/webglrenderer.d.ts +0 -185
- package/dist/core/renderer/webglrenderer.d.ts.map +0 -1
- package/dist/core/renderer/webglrenderer.js +0 -1007
- package/dist/core/renderer/webglrenderer.js.map +0 -1
- package/dist/core/scene/index.d.ts +0 -4
- package/dist/core/scene/index.d.ts.map +0 -1
- package/dist/core/scene/index.js +0 -4
- package/dist/core/scene/index.js.map +0 -1
- package/dist/core/scene/node.d.ts +0 -162
- package/dist/core/scene/node.d.ts.map +0 -1
- package/dist/core/scene/node.js +0 -402
- package/dist/core/scene/node.js.map +0 -1
- package/dist/core/scene/nodes/artboard.d.ts +0 -42
- package/dist/core/scene/nodes/artboard.d.ts.map +0 -1
- package/dist/core/scene/nodes/artboard.js +0 -64
- package/dist/core/scene/nodes/artboard.js.map +0 -1
- package/dist/core/scene/nodes/groupnode.d.ts +0 -10
- package/dist/core/scene/nodes/groupnode.d.ts.map +0 -1
- package/dist/core/scene/nodes/groupnode.js +0 -12
- package/dist/core/scene/nodes/groupnode.js.map +0 -1
- package/dist/core/scene/nodes/imagenode.d.ts +0 -38
- package/dist/core/scene/nodes/imagenode.d.ts.map +0 -1
- package/dist/core/scene/nodes/imagenode.js +0 -77
- package/dist/core/scene/nodes/imagenode.js.map +0 -1
- package/dist/core/scene/nodes/index.d.ts +0 -5
- package/dist/core/scene/nodes/index.d.ts.map +0 -1
- package/dist/core/scene/nodes/index.js +0 -5
- package/dist/core/scene/nodes/index.js.map +0 -1
- package/dist/core/scene/nodes/shapenode.d.ts +0 -76
- package/dist/core/scene/nodes/shapenode.d.ts.map +0 -1
- package/dist/core/scene/nodes/shapenode.js +0 -212
- package/dist/core/scene/nodes/shapenode.js.map +0 -1
- package/dist/core/scene/transform.d.ts +0 -27
- package/dist/core/scene/transform.d.ts.map +0 -1
- package/dist/core/scene/transform.js +0 -52
- package/dist/core/scene/transform.js.map +0 -1
- package/dist/core/serialization/index.d.ts +0 -3
- package/dist/core/serialization/index.d.ts.map +0 -1
- package/dist/core/serialization/index.js +0 -2
- package/dist/core/serialization/index.js.map +0 -1
- package/dist/core/serialization/serializer.d.ts +0 -323
- package/dist/core/serialization/serializer.d.ts.map +0 -1
- package/dist/core/serialization/serializer.js +0 -1173
- package/dist/core/serialization/serializer.js.map +0 -1
- package/dist/core/serialization/types.d.ts +0 -242
- package/dist/core/serialization/types.d.ts.map +0 -1
- package/dist/core/serialization/types.js +0 -1
- package/dist/core/serialization/types.js.map +0 -1
- package/dist/core/timing/clock.d.ts +0 -43
- package/dist/core/timing/clock.d.ts.map +0 -1
- package/dist/core/timing/clock.js +0 -78
- package/dist/core/timing/clock.js.map +0 -1
- package/dist/core/timing/index.d.ts +0 -3
- package/dist/core/timing/index.d.ts.map +0 -1
- package/dist/core/timing/index.js +0 -3
- package/dist/core/timing/index.js.map +0 -1
- package/dist/core/timing/scheduler.d.ts +0 -72
- package/dist/core/timing/scheduler.d.ts.map +0 -1
- package/dist/core/timing/scheduler.js +0 -163
- package/dist/core/timing/scheduler.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/wrapper/react/index.d.ts +0 -5
- package/dist/wrapper/react/index.d.ts.map +0 -1
- package/dist/wrapper/react/index.js +0 -3
- package/dist/wrapper/react/index.js.map +0 -1
- package/dist/wrapper/react/samcan-player.d.ts +0 -26
- package/dist/wrapper/react/samcan-player.d.ts.map +0 -1
- package/dist/wrapper/react/samcan-player.js +0 -19
- package/dist/wrapper/react/samcan-player.js.map +0 -1
- package/dist/wrapper/react/use-samcan-player.d.ts +0 -33
- package/dist/wrapper/react/use-samcan-player.d.ts.map +0 -1
- package/dist/wrapper/react/use-samcan-player.js +0 -65
- package/dist/wrapper/react/use-samcan-player.js.map +0 -1
- package/readme.md +0 -96
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error codes for different failure types in the samcan system
|
|
3
|
-
*/
|
|
4
|
-
export var ErrorCode;
|
|
5
|
-
(function (ErrorCode) {
|
|
6
|
-
// File format and serialization errors (7.3)
|
|
7
|
-
ErrorCode["INVALID_FILE_FORMAT"] = "INVALID_FILE_FORMAT";
|
|
8
|
-
ErrorCode["UNSUPPORTED_VERSION"] = "UNSUPPORTED_VERSION";
|
|
9
|
-
ErrorCode["SERIALIZATION_FAILED"] = "SERIALIZATION_FAILED";
|
|
10
|
-
ErrorCode["DESERIALIZATION_FAILED"] = "DESERIALIZATION_FAILED";
|
|
11
|
-
ErrorCode["FILE_PARSE_ERROR"] = "FILE_PARSE_ERROR";
|
|
12
|
-
// Renderer errors (2.2)
|
|
13
|
-
ErrorCode["RENDERER_INIT_FAILED"] = "RENDERER_INIT_FAILED";
|
|
14
|
-
ErrorCode["RENDERER_NOT_SUPPORTED"] = "RENDERER_NOT_SUPPORTED";
|
|
15
|
-
ErrorCode["WEBGL_CONTEXT_LOST"] = "WEBGL_CONTEXT_LOST";
|
|
16
|
-
ErrorCode["WEBGPU_NOT_AVAILABLE"] = "WEBGPU_NOT_AVAILABLE";
|
|
17
|
-
ErrorCode["CANVAS_NOT_FOUND"] = "CANVAS_NOT_FOUND";
|
|
18
|
-
// Asset loading errors (10.5)
|
|
19
|
-
ErrorCode["ASSET_LOAD_FAILED"] = "ASSET_LOAD_FAILED";
|
|
20
|
-
ErrorCode["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND";
|
|
21
|
-
ErrorCode["INVALID_ASSET_TYPE"] = "INVALID_ASSET_TYPE";
|
|
22
|
-
ErrorCode["ASSET_DECODE_FAILED"] = "ASSET_DECODE_FAILED";
|
|
23
|
-
ErrorCode["FONT_LOAD_FAILED"] = "FONT_LOAD_FAILED";
|
|
24
|
-
// Animation errors
|
|
25
|
-
ErrorCode["INVALID_ANIMATION_DATA"] = "INVALID_ANIMATION_DATA";
|
|
26
|
-
ErrorCode["TIMELINE_ERROR"] = "TIMELINE_ERROR";
|
|
27
|
-
ErrorCode["KEYFRAME_ERROR"] = "KEYFRAME_ERROR";
|
|
28
|
-
ErrorCode["STATE_MACHINE_ERROR"] = "STATE_MACHINE_ERROR";
|
|
29
|
-
// Plugin errors
|
|
30
|
-
ErrorCode["PLUGIN_ERROR"] = "PLUGIN_ERROR";
|
|
31
|
-
ErrorCode["PLUGIN_INIT_FAILED"] = "PLUGIN_INIT_FAILED";
|
|
32
|
-
ErrorCode["PLUGIN_NOT_FOUND"] = "PLUGIN_NOT_FOUND";
|
|
33
|
-
// General errors
|
|
34
|
-
ErrorCode["INVALID_OPERATION"] = "INVALID_OPERATION";
|
|
35
|
-
ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
|
|
36
|
-
ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
37
|
-
ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
38
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
39
|
-
/**
|
|
40
|
-
* Base error class for all samcan errors
|
|
41
|
-
* Provides error codes, context information, and serialization support
|
|
42
|
-
*/
|
|
43
|
-
export class SamcanError extends Error {
|
|
44
|
-
code;
|
|
45
|
-
context;
|
|
46
|
-
timestamp;
|
|
47
|
-
constructor(message, code, context) {
|
|
48
|
-
super(message);
|
|
49
|
-
this.name = "SamcanError";
|
|
50
|
-
this.code = code;
|
|
51
|
-
this.context = context;
|
|
52
|
-
this.timestamp = new Date();
|
|
53
|
-
// Maintains proper stack trace for where our error was thrown
|
|
54
|
-
if (Error.captureStackTrace) {
|
|
55
|
-
Error.captureStackTrace(this, this.constructor);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Serialize the error to a plain object for logging or transmission
|
|
60
|
-
*/
|
|
61
|
-
serialize() {
|
|
62
|
-
const serialized = {
|
|
63
|
-
name: this.name,
|
|
64
|
-
message: this.message,
|
|
65
|
-
code: this.code,
|
|
66
|
-
timestamp: this.timestamp.toISOString(),
|
|
67
|
-
};
|
|
68
|
-
if (this.context) {
|
|
69
|
-
serialized.context = this.context;
|
|
70
|
-
}
|
|
71
|
-
if (this.stack) {
|
|
72
|
-
serialized.stack = this.stack;
|
|
73
|
-
}
|
|
74
|
-
// Serialize the cause if it exists
|
|
75
|
-
if (this.cause) {
|
|
76
|
-
if (this.cause instanceof SamcanError) {
|
|
77
|
-
serialized.cause = this.cause.serialize();
|
|
78
|
-
}
|
|
79
|
-
else if (this.cause instanceof Error) {
|
|
80
|
-
serialized.cause = {
|
|
81
|
-
name: this.cause.name,
|
|
82
|
-
message: this.cause.message,
|
|
83
|
-
code: ErrorCode.UNKNOWN_ERROR,
|
|
84
|
-
timestamp: new Date().toISOString(),
|
|
85
|
-
stack: this.cause.stack,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return serialized;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Convert the error to a JSON string for logging
|
|
93
|
-
*/
|
|
94
|
-
toJSON() {
|
|
95
|
-
return JSON.stringify(this.serialize(), null, 2);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Create a formatted string representation of the error
|
|
99
|
-
*/
|
|
100
|
-
toString() {
|
|
101
|
-
let str = `${this.name} [${this.code}]: ${this.message}`;
|
|
102
|
-
if (this.context && Object.keys(this.context).length > 0) {
|
|
103
|
-
str += `\nContext: ${JSON.stringify(this.context)}`;
|
|
104
|
-
}
|
|
105
|
-
return str;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=samcanerror.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"samcanerror.js","sourceRoot":"","sources":["../../../core/error/samcanerror.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAsCX;AAtCD,WAAY,SAAS;IACjB,6CAA6C;IAC7C,wDAA2C,CAAA;IAC3C,wDAA2C,CAAA;IAC3C,0DAA6C,CAAA;IAC7C,8DAAiD,CAAA;IACjD,kDAAqC,CAAA;IAErC,wBAAwB;IACxB,0DAA6C,CAAA;IAC7C,8DAAiD,CAAA;IACjD,sDAAyC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,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACvD,CAAC;QAED,OAAO,GAAG,CAAA;IACd,CAAC;CACJ"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ErrorCode, type ErrorContext, SamcanError } from "./samcanerror";
|
|
2
|
-
/**
|
|
3
|
-
* Error thrown when serialization or deserialization fails
|
|
4
|
-
* Requirement 7.3: File format validation and error handling
|
|
5
|
-
*/
|
|
6
|
-
export declare class SerializationError extends SamcanError {
|
|
7
|
-
readonly fileVersion?: string;
|
|
8
|
-
readonly expectedVersion?: string;
|
|
9
|
-
constructor(message: string, code: ErrorCode, context?: ErrorContext);
|
|
10
|
-
/**
|
|
11
|
-
* Create an invalid file format error
|
|
12
|
-
*/
|
|
13
|
-
static invalidFormat(reason: string, context?: ErrorContext): SerializationError;
|
|
14
|
-
/**
|
|
15
|
-
* Create an unsupported version error
|
|
16
|
-
*/
|
|
17
|
-
static unsupportedVersion(fileVersion: string, expectedVersion: string): SerializationError;
|
|
18
|
-
/**
|
|
19
|
-
* Create a file parse error
|
|
20
|
-
*/
|
|
21
|
-
static parseError(reason: string, cause?: Error): SerializationError;
|
|
22
|
-
/**
|
|
23
|
-
* Create a serialization failed error
|
|
24
|
-
*/
|
|
25
|
-
static serializationFailed(reason: string, context?: ErrorContext): SerializationError;
|
|
26
|
-
/**
|
|
27
|
-
* Create a deserialization failed error
|
|
28
|
-
*/
|
|
29
|
-
static deserializationFailed(reason: string, context?: ErrorContext): SerializationError;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=serializationerror.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serializationerror.d.ts","sourceRoot":"","sources":["../../../core/error/serializationerror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEzE;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAC/C,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpC,SAAgB,eAAe,CAAC,EAAE,MAAM,CAAA;gBAE5B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY;IAOpE;;OAEG;IACH,MAAM,CAAC,aAAa,CAChB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY,GACvB,kBAAkB;IAQrB;;OAEG;IACH,MAAM,CAAC,kBAAkB,CACrB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACxB,kBAAkB;IAQrB;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,kBAAkB;IAQpE;;OAEG;IACH,MAAM,CAAC,mBAAmB,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY,GACvB,kBAAkB;IAQrB;;OAEG;IACH,MAAM,CAAC,qBAAqB,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY,GACvB,kBAAkB;CAOxB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ErrorCode, SamcanError } from "./samcanerror";
|
|
2
|
-
/**
|
|
3
|
-
* Error thrown when serialization or deserialization fails
|
|
4
|
-
* Requirement 7.3: File format validation and error handling
|
|
5
|
-
*/
|
|
6
|
-
export class SerializationError extends SamcanError {
|
|
7
|
-
fileVersion;
|
|
8
|
-
expectedVersion;
|
|
9
|
-
constructor(message, code, context) {
|
|
10
|
-
super(message, code, context);
|
|
11
|
-
this.name = "SerializationError";
|
|
12
|
-
this.fileVersion = context?.fileVersion;
|
|
13
|
-
this.expectedVersion = context?.expectedVersion;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Create an invalid file format error
|
|
17
|
-
*/
|
|
18
|
-
static invalidFormat(reason, context) {
|
|
19
|
-
return new SerializationError(`Invalid file format: ${reason}`, ErrorCode.INVALID_FILE_FORMAT, context);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Create an unsupported version error
|
|
23
|
-
*/
|
|
24
|
-
static unsupportedVersion(fileVersion, expectedVersion) {
|
|
25
|
-
return new SerializationError(`Unsupported file version: ${fileVersion} (expected ${expectedVersion})`, ErrorCode.UNSUPPORTED_VERSION, { fileVersion, expectedVersion });
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create a file parse error
|
|
29
|
-
*/
|
|
30
|
-
static parseError(reason, cause) {
|
|
31
|
-
return new SerializationError(`Failed to parse file: ${reason}`, ErrorCode.FILE_PARSE_ERROR, { reason, cause: cause?.message });
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Create a serialization failed error
|
|
35
|
-
*/
|
|
36
|
-
static serializationFailed(reason, context) {
|
|
37
|
-
return new SerializationError(`Serialization failed: ${reason}`, ErrorCode.SERIALIZATION_FAILED, context);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Create a deserialization failed error
|
|
41
|
-
*/
|
|
42
|
-
static deserializationFailed(reason, context) {
|
|
43
|
-
return new SerializationError(`Deserialization failed: ${reason}`, ErrorCode.DESERIALIZATION_FAILED, context);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=serializationerror.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serializationerror.js","sourceRoot":"","sources":["../../../core/error/serializationerror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,WAAW,EAAE,MAAM,eAAe,CAAA;AAEzE;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAC/B,WAAW,CAAS;IACpB,eAAe,CAAS;IAExC,YAAY,OAAe,EAAE,IAAe,EAAE,OAAsB;QAChE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAA;QAChC,IAAI,CAAC,WAAW,GAAG,OAAO,EAAE,WAAiC,CAAA;QAC7D,IAAI,CAAC,eAAe,GAAG,OAAO,EAAE,eAAqC,CAAA;IACzE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAChB,MAAc,EACd,OAAsB;QAEtB,OAAO,IAAI,kBAAkB,CACzB,wBAAwB,MAAM,EAAE,EAChC,SAAS,CAAC,mBAAmB,EAC7B,OAAO,CACV,CAAA;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,kBAAkB,CACrB,WAAmB,EACnB,eAAuB;QAEvB,OAAO,IAAI,kBAAkB,CACzB,6BAA6B,WAAW,cAAc,eAAe,GAAG,EACxE,SAAS,CAAC,mBAAmB,EAC7B,EAAE,WAAW,EAAE,eAAe,EAAE,CACnC,CAAA;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAc,EAAE,KAAa;QAC3C,OAAO,IAAI,kBAAkB,CACzB,yBAAyB,MAAM,EAAE,EACjC,SAAS,CAAC,gBAAgB,EAC1B,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CACpC,CAAA;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,mBAAmB,CACtB,MAAc,EACd,OAAsB;QAEtB,OAAO,IAAI,kBAAkB,CACzB,yBAAyB,MAAM,EAAE,EACjC,SAAS,CAAC,oBAAoB,EAC9B,OAAO,CACV,CAAA;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB,CACxB,MAAc,EACd,OAAsB;QAEtB,OAAO,IAAI,kBAAkB,CACzB,2BAA2B,MAAM,EAAE,EACnC,SAAS,CAAC,sBAAsB,EAChC,OAAO,CACV,CAAA;IACL,CAAC;CACJ"}
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./math";
|
|
2
|
-
export * from "./scene";
|
|
3
|
-
export * from "./command";
|
|
4
|
-
export * from "./renderer";
|
|
5
|
-
export * from "./timing";
|
|
6
|
-
export * from "./animation";
|
|
7
|
-
export * from "./serialization";
|
|
8
|
-
export * from "./asset";
|
|
9
|
-
export * from "./plugin";
|
|
10
|
-
export * from "./error";
|
|
11
|
-
export * from "./api";
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../core/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
package/dist/core/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./math";
|
|
2
|
-
export * from "./scene";
|
|
3
|
-
export * from "./command";
|
|
4
|
-
export * from "./renderer";
|
|
5
|
-
export * from "./timing";
|
|
6
|
-
export * from "./animation";
|
|
7
|
-
export * from "./serialization";
|
|
8
|
-
export * from "./asset";
|
|
9
|
-
export * from "./plugin";
|
|
10
|
-
export * from "./error";
|
|
11
|
-
export * from "./api";
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../core/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color class with RGBA components (0-1 range)
|
|
3
|
-
*/
|
|
4
|
-
export declare class Color {
|
|
5
|
-
r: number;
|
|
6
|
-
g: number;
|
|
7
|
-
b: number;
|
|
8
|
-
a: number;
|
|
9
|
-
constructor(r?: number, g?: number, b?: number, a?: number);
|
|
10
|
-
/**
|
|
11
|
-
* Convert to CSS rgba string
|
|
12
|
-
*/
|
|
13
|
-
toRGBA(): string;
|
|
14
|
-
/**
|
|
15
|
-
* Convert to CSS hex string
|
|
16
|
-
*/
|
|
17
|
-
toHex(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Linear interpolation between this color and another
|
|
20
|
-
*/
|
|
21
|
-
lerp(other: Color, t: number): Color;
|
|
22
|
-
/**
|
|
23
|
-
* Create a copy of this color
|
|
24
|
-
*/
|
|
25
|
-
clone(): Color;
|
|
26
|
-
/**
|
|
27
|
-
* Check if this color equals another color
|
|
28
|
-
*/
|
|
29
|
-
equals(other: Color, epsilon?: number): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Create a color from RGB values (0-255)
|
|
32
|
-
*/
|
|
33
|
-
static fromRGB(r: number, g: number, b: number, a?: number): Color;
|
|
34
|
-
/**
|
|
35
|
-
* Create a color from hex string
|
|
36
|
-
*/
|
|
37
|
-
static fromHex(hex: string): Color;
|
|
38
|
-
/**
|
|
39
|
-
* Predefined colors
|
|
40
|
-
*/
|
|
41
|
-
static white(): Color;
|
|
42
|
-
static black(): Color;
|
|
43
|
-
static red(): Color;
|
|
44
|
-
static green(): Color;
|
|
45
|
-
static blue(): Color;
|
|
46
|
-
static transparent(): Color;
|
|
47
|
-
/**
|
|
48
|
-
* Set this color from another color
|
|
49
|
-
*/
|
|
50
|
-
setFrom(other: Color): Color;
|
|
51
|
-
/**
|
|
52
|
-
* Set the components of this color
|
|
53
|
-
*/
|
|
54
|
-
set(r: number, g: number, b: number, a?: number): Color;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=color.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../core/math/color.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,KAAK;IAEH,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;gBAHT,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU;IAQxB;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB;;OAEG;IACH,KAAK,IAAI,MAAM;IAgBf;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IASpC;;OAEG;IACH,KAAK,IAAI,KAAK;IAId;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE,MAAe,GAAG,OAAO;IASvD;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAE,MAAY,GAAG,KAAK;IAIvE;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IAYlC;;OAEG;IACH,MAAM,CAAC,KAAK,IAAI,KAAK;IAIrB,MAAM,CAAC,KAAK,IAAI,KAAK;IAIrB,MAAM,CAAC,GAAG,IAAI,KAAK;IAInB,MAAM,CAAC,KAAK,IAAI,KAAK;IAIrB,MAAM,CAAC,IAAI,IAAI,KAAK;IAIpB,MAAM,CAAC,WAAW,IAAI,KAAK;IAI3B;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAQ5B;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAE,MAAU,GAAG,KAAK;CAO7D"}
|
package/dist/core/math/color.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color class with RGBA components (0-1 range)
|
|
3
|
-
*/
|
|
4
|
-
export class Color {
|
|
5
|
-
r;
|
|
6
|
-
g;
|
|
7
|
-
b;
|
|
8
|
-
a;
|
|
9
|
-
constructor(r = 0, g = 0, b = 0, a = 1) {
|
|
10
|
-
this.r = r;
|
|
11
|
-
this.g = g;
|
|
12
|
-
this.b = b;
|
|
13
|
-
this.a = a;
|
|
14
|
-
this.r = Math.max(0, Math.min(1, r));
|
|
15
|
-
this.g = Math.max(0, Math.min(1, g));
|
|
16
|
-
this.b = Math.max(0, Math.min(1, b));
|
|
17
|
-
this.a = Math.max(0, Math.min(1, a));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Convert to CSS rgba string
|
|
21
|
-
*/
|
|
22
|
-
toRGBA() {
|
|
23
|
-
return `rgba(${Math.round(this.r * 255)}, ${Math.round(this.g * 255)}, ${Math.round(this.b * 255)}, ${this.a})`;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Convert to CSS hex string
|
|
27
|
-
*/
|
|
28
|
-
toHex() {
|
|
29
|
-
const r = Math.round(this.r * 255)
|
|
30
|
-
.toString(16)
|
|
31
|
-
.padStart(2, "0");
|
|
32
|
-
const g = Math.round(this.g * 255)
|
|
33
|
-
.toString(16)
|
|
34
|
-
.padStart(2, "0");
|
|
35
|
-
const b = Math.round(this.b * 255)
|
|
36
|
-
.toString(16)
|
|
37
|
-
.padStart(2, "0");
|
|
38
|
-
const a = Math.round(this.a * 255)
|
|
39
|
-
.toString(16)
|
|
40
|
-
.padStart(2, "0");
|
|
41
|
-
return this.a === 1 ? `#${r}${g}${b}` : `#${r}${g}${b}${a}`;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Linear interpolation between this color and another
|
|
45
|
-
*/
|
|
46
|
-
lerp(other, t) {
|
|
47
|
-
return new Color(this.r + (other.r - this.r) * t, this.g + (other.g - this.g) * t, this.b + (other.b - this.b) * t, this.a + (other.a - this.a) * t);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Create a copy of this color
|
|
51
|
-
*/
|
|
52
|
-
clone() {
|
|
53
|
-
return new Color(this.r, this.g, this.b, this.a);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Check if this color equals another color
|
|
57
|
-
*/
|
|
58
|
-
equals(other, epsilon = 0.0001) {
|
|
59
|
-
return (Math.abs(this.r - other.r) < epsilon &&
|
|
60
|
-
Math.abs(this.g - other.g) < epsilon &&
|
|
61
|
-
Math.abs(this.b - other.b) < epsilon &&
|
|
62
|
-
Math.abs(this.a - other.a) < epsilon);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create a color from RGB values (0-255)
|
|
66
|
-
*/
|
|
67
|
-
static fromRGB(r, g, b, a = 255) {
|
|
68
|
-
return new Color(r / 255, g / 255, b / 255, a / 255);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Create a color from hex string
|
|
72
|
-
*/
|
|
73
|
-
static fromHex(hex) {
|
|
74
|
-
const cleaned = hex.replace("#", "");
|
|
75
|
-
const r = Number.parseInt(cleaned.substring(0, 2), 16) / 255;
|
|
76
|
-
const g = Number.parseInt(cleaned.substring(2, 4), 16) / 255;
|
|
77
|
-
const b = Number.parseInt(cleaned.substring(4, 6), 16) / 255;
|
|
78
|
-
const a = cleaned.length === 8
|
|
79
|
-
? Number.parseInt(cleaned.substring(6, 8), 16) / 255
|
|
80
|
-
: 1;
|
|
81
|
-
return new Color(r, g, b, a);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Predefined colors
|
|
85
|
-
*/
|
|
86
|
-
static white() {
|
|
87
|
-
return new Color(1, 1, 1, 1);
|
|
88
|
-
}
|
|
89
|
-
static black() {
|
|
90
|
-
return new Color(0, 0, 0, 1);
|
|
91
|
-
}
|
|
92
|
-
static red() {
|
|
93
|
-
return new Color(1, 0, 0, 1);
|
|
94
|
-
}
|
|
95
|
-
static green() {
|
|
96
|
-
return new Color(0, 1, 0, 1);
|
|
97
|
-
}
|
|
98
|
-
static blue() {
|
|
99
|
-
return new Color(0, 0, 1, 1);
|
|
100
|
-
}
|
|
101
|
-
static transparent() {
|
|
102
|
-
return new Color(0, 0, 0, 0);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Set this color from another color
|
|
106
|
-
*/
|
|
107
|
-
setFrom(other) {
|
|
108
|
-
this.r = other.r;
|
|
109
|
-
this.g = other.g;
|
|
110
|
-
this.b = other.b;
|
|
111
|
-
this.a = other.a;
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Set the components of this color
|
|
116
|
-
*/
|
|
117
|
-
set(r, g, b, a = 1) {
|
|
118
|
-
this.r = Math.max(0, Math.min(1, r));
|
|
119
|
-
this.g = Math.max(0, Math.min(1, g));
|
|
120
|
-
this.b = Math.max(0, Math.min(1, b));
|
|
121
|
-
this.a = Math.max(0, Math.min(1, a));
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=color.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../core/math/color.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,KAAK;IAEH;IACA;IACA;IACA;IAJX,YACW,IAAY,CAAC,EACb,IAAY,CAAC,EACb,IAAY,CAAC,EACb,IAAY,CAAC;QAHb,MAAC,GAAD,CAAC,CAAY;QACb,MAAC,GAAD,CAAC,CAAY;QACb,MAAC,GAAD,CAAC,CAAY;QACb,MAAC,GAAD,C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CAAC;QAC9C,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QACpC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QACpC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QACpC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QACpC,OAAO,IAAI,CAAA;IACf,CAAC;CACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core math and utility types for samcan animation runtime
|
|
3
|
-
*/
|
|
4
|
-
export { Vector2 } from "./vector2";
|
|
5
|
-
export { Rectangle } from "./rectangle";
|
|
6
|
-
export { Color } from "./color";
|
|
7
|
-
export { Matrix } from "./matrix";
|
|
8
|
-
export { Path, type PathCommand } from "./path/index";
|
|
9
|
-
export { Paint, type BlendMode, type GradientStop, type LinearGradient, type RadialGradient, type Gradient, } from "./paint";
|
|
10
|
-
export { PathOperations } from "./path/operations";
|
|
11
|
-
export * from "./utils";
|
|
12
|
-
export { ObjectPool, type PoolStats } from "./pool";
|
|
13
|
-
export { Vector2Pool, MatrixPool, ColorPool, getAllPoolStats, clearAllPools, } from "./pools";
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/math/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EACH,KAAK,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,QAAQ,GAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,EACH,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,GAChB,MAAM,SAAS,CAAA"}
|
package/dist/core/math/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core math and utility types for samcan animation runtime
|
|
3
|
-
*/
|
|
4
|
-
export { Vector2 } from "./vector2";
|
|
5
|
-
export { Rectangle } from "./rectangle";
|
|
6
|
-
export { Color } from "./color";
|
|
7
|
-
export { Matrix } from "./matrix";
|
|
8
|
-
export { Path } from "./path/index";
|
|
9
|
-
export { Paint, } from "./paint";
|
|
10
|
-
export { PathOperations } from "./path/operations";
|
|
11
|
-
export * from "./utils";
|
|
12
|
-
export { ObjectPool } from "./pool";
|
|
13
|
-
export { Vector2Pool, MatrixPool, ColorPool, getAllPoolStats, clearAllPools, } from "./pools";
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/math/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAoB,MAAM,cAAc,CAAA;AACrD,OAAO,EACH,KAAK,GAMR,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,UAAU,EAAkB,MAAM,QAAQ,CAAA;AACnD,OAAO,EACH,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,GAChB,MAAM,SAAS,CAAA"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Vector2 } from "./vector2";
|
|
2
|
-
/**
|
|
3
|
-
* 2D Affine Transformation Matrix (3x3 represented as 2x3)
|
|
4
|
-
* [a c tx]
|
|
5
|
-
* [b d ty]
|
|
6
|
-
* [0 0 1 ]
|
|
7
|
-
*/
|
|
8
|
-
export declare class Matrix {
|
|
9
|
-
a: number;
|
|
10
|
-
b: number;
|
|
11
|
-
c: number;
|
|
12
|
-
d: number;
|
|
13
|
-
tx: number;
|
|
14
|
-
ty: number;
|
|
15
|
-
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
|
|
16
|
-
/**
|
|
17
|
-
* Multiply this matrix by another matrix
|
|
18
|
-
*/
|
|
19
|
-
multiply(other: Matrix): Matrix;
|
|
20
|
-
/**
|
|
21
|
-
* Calculate the determinant of this matrix
|
|
22
|
-
*/
|
|
23
|
-
determinant(): number;
|
|
24
|
-
/**
|
|
25
|
-
* Invert this matrix
|
|
26
|
-
*/
|
|
27
|
-
invert(): Matrix;
|
|
28
|
-
/**
|
|
29
|
-
* Transform a point by this matrix
|
|
30
|
-
*/
|
|
31
|
-
transformPoint(point: Vector2): Vector2;
|
|
32
|
-
/**
|
|
33
|
-
* Transform a vector (ignoring translation)
|
|
34
|
-
*/
|
|
35
|
-
transformVector(vector: Vector2): Vector2;
|
|
36
|
-
/**
|
|
37
|
-
* Create a translation matrix
|
|
38
|
-
*/
|
|
39
|
-
static translate(x: number, y: number): Matrix;
|
|
40
|
-
/**
|
|
41
|
-
* Create a scale matrix
|
|
42
|
-
*/
|
|
43
|
-
static scale(sx: number, sy?: number): Matrix;
|
|
44
|
-
/**
|
|
45
|
-
* Create a rotation matrix (angle in radians)
|
|
46
|
-
*/
|
|
47
|
-
static rotate(angle: number): Matrix;
|
|
48
|
-
/**
|
|
49
|
-
* Create an identity matrix
|
|
50
|
-
*/
|
|
51
|
-
static identity(): Matrix;
|
|
52
|
-
/**
|
|
53
|
-
* Create a matrix from translation, rotation, and scale
|
|
54
|
-
*/
|
|
55
|
-
static fromTRS(translation: Vector2, rotation: number, scale: Vector2): Matrix;
|
|
56
|
-
/**
|
|
57
|
-
* Create a copy of this matrix
|
|
58
|
-
*/
|
|
59
|
-
clone(): Matrix;
|
|
60
|
-
/**
|
|
61
|
-
* Check if this matrix equals another matrix
|
|
62
|
-
*/
|
|
63
|
-
equals(other: Matrix, epsilon?: number): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Check if this is an identity matrix
|
|
66
|
-
*/
|
|
67
|
-
isIdentity(epsilon?: number): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Append a translation to this matrix
|
|
70
|
-
*/
|
|
71
|
-
appendTranslation(x: number, y: number): Matrix;
|
|
72
|
-
/**
|
|
73
|
-
* Append a rotation to this matrix
|
|
74
|
-
*/
|
|
75
|
-
appendRotation(angle: number): Matrix;
|
|
76
|
-
/**
|
|
77
|
-
* Append a scale to this matrix
|
|
78
|
-
*/
|
|
79
|
-
appendScale(sx: number, sy?: number): Matrix;
|
|
80
|
-
/**
|
|
81
|
-
* Prepend a translation to this matrix
|
|
82
|
-
*/
|
|
83
|
-
prependTranslation(x: number, y: number): Matrix;
|
|
84
|
-
/**
|
|
85
|
-
* Prepend a rotation to this matrix
|
|
86
|
-
*/
|
|
87
|
-
prependRotation(angle: number): Matrix;
|
|
88
|
-
/**
|
|
89
|
-
* Prepend a scale to this matrix
|
|
90
|
-
*/
|
|
91
|
-
prependScale(sx: number, sy?: number): Matrix;
|
|
92
|
-
/**
|
|
93
|
-
* Set this matrix from another matrix
|
|
94
|
-
*/
|
|
95
|
-
setFrom(other: Matrix): Matrix;
|
|
96
|
-
/**
|
|
97
|
-
* Set this matrix to identity
|
|
98
|
-
*/
|
|
99
|
-
setIdentity(): Matrix;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=matrix.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../core/math/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;GAKG;AACH,qBAAa,MAAM;IAEJ,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;gBALV,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU,EACb,CAAC,GAAE,MAAU,EACb,EAAE,GAAE,MAAU,EACd,EAAE,GAAE,MAAU;IAGzB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW/B;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,MAAM,IAAI,MAAM;IAoBhB;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAOvC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAOzC;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9C;;OAEG;IACH,M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