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,82 +0,0 @@
|
|
|
1
|
-
import type { EasingFunction } from "./easing";
|
|
2
|
-
import { Color } from "../math/color";
|
|
3
|
-
import { Vector2 } from "../math/vector2";
|
|
4
|
-
/**
|
|
5
|
-
* Generic interpolator interface for type-specific value interpolation
|
|
6
|
-
*/
|
|
7
|
-
export interface Interpolator<T> {
|
|
8
|
-
/**
|
|
9
|
-
* Interpolate between two values
|
|
10
|
-
* @param from Starting value
|
|
11
|
-
* @param to Ending value
|
|
12
|
-
* @param t Interpolation factor (0-1)
|
|
13
|
-
* @param easing Optional easing function to apply
|
|
14
|
-
* @returns Interpolated value
|
|
15
|
-
*/
|
|
16
|
-
interpolate(from: T, to: T, t: number, easing?: EasingFunction): T;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Interpolator for scalar number values
|
|
20
|
-
*/
|
|
21
|
-
export declare class NumberInterpolator implements Interpolator<number> {
|
|
22
|
-
interpolate(from: number, to: number, t: number, easing?: EasingFunction): number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Interpolator for Vector2 values (positions, scales, etc.)
|
|
26
|
-
*/
|
|
27
|
-
export declare class Vector2Interpolator implements Interpolator<Vector2> {
|
|
28
|
-
interpolate(from: Vector2, to: Vector2, t: number, easing?: EasingFunction): Vector2;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Interpolator for Color values with RGBA components
|
|
32
|
-
*/
|
|
33
|
-
export declare class ColorInterpolator implements Interpolator<Color> {
|
|
34
|
-
interpolate(from: Color, to: Color, t: number, easing?: EasingFunction): Color;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Registry for managing type-specific interpolators
|
|
38
|
-
* Allows registration of custom interpolators for extensibility
|
|
39
|
-
*/
|
|
40
|
-
export declare class InterpolatorRegistry {
|
|
41
|
-
private static _interpolators;
|
|
42
|
-
private static _initialized;
|
|
43
|
-
/**
|
|
44
|
-
* Initialize the registry with built-in interpolators
|
|
45
|
-
*/
|
|
46
|
-
private static initialize;
|
|
47
|
-
/**
|
|
48
|
-
* Register a custom interpolator for a specific type
|
|
49
|
-
* @param typeName Name of the type (e.g., 'number', 'Vector2', 'MyCustomType')
|
|
50
|
-
* @param interpolator Interpolator instance for the type
|
|
51
|
-
*/
|
|
52
|
-
static register<T>(typeName: string, interpolator: Interpolator<T>): void;
|
|
53
|
-
/**
|
|
54
|
-
* Get an interpolator for a specific type
|
|
55
|
-
* @param typeName Name of the type
|
|
56
|
-
* @returns Interpolator instance or undefined if not found
|
|
57
|
-
*/
|
|
58
|
-
static get<T>(typeName: string): Interpolator<T> | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Get an interpolator for a value based on its runtime type
|
|
61
|
-
* @param value Value to determine type from
|
|
62
|
-
* @returns Interpolator instance or undefined if no matching interpolator
|
|
63
|
-
*/
|
|
64
|
-
static getForValue<T>(value: T): Interpolator<T> | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Check if an interpolator exists for a type
|
|
67
|
-
* @param typeName Name of the type
|
|
68
|
-
* @returns True if interpolator exists
|
|
69
|
-
*/
|
|
70
|
-
static has(typeName: string): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Remove an interpolator from the registry
|
|
73
|
-
* @param typeName Name of the type
|
|
74
|
-
* @returns True if interpolator was removed
|
|
75
|
-
*/
|
|
76
|
-
static unregister(typeName: string): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Clear all registered interpolators (except built-ins)
|
|
79
|
-
*/
|
|
80
|
-
static clear(): void;
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=interpolator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolator.d.ts","sourceRoot":"","sources":["../../../core/animation/interpolator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC3B;;;;;;;OAOG;IACH,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,M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,OAAO;IAKrC;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5C;;OAEG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;CAIvB"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Color } from "../math/color";
|
|
2
|
-
import { Vector2 } from "../math/vector2";
|
|
3
|
-
/**
|
|
4
|
-
* Interpolator for scalar number values
|
|
5
|
-
*/
|
|
6
|
-
export class NumberInterpolator {
|
|
7
|
-
interpolate(from, to, t, easing) {
|
|
8
|
-
const easedT = easing ? easing(t) : t;
|
|
9
|
-
return from + (to - from) * easedT;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Interpolator for Vector2 values (positions, scales, etc.)
|
|
14
|
-
*/
|
|
15
|
-
export class Vector2Interpolator {
|
|
16
|
-
interpolate(from, to, t, easing) {
|
|
17
|
-
const easedT = easing ? easing(t) : t;
|
|
18
|
-
return new Vector2(from.x + (to.x - from.x) * easedT, from.y + (to.y - from.y) * easedT);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Interpolator for Color values with RGBA components
|
|
23
|
-
*/
|
|
24
|
-
export class ColorInterpolator {
|
|
25
|
-
interpolate(from, to, t, easing) {
|
|
26
|
-
const easedT = easing ? easing(t) : t;
|
|
27
|
-
return new Color(from.r + (to.r - from.r) * easedT, from.g + (to.g - from.g) * easedT, from.b + (to.b - from.b) * easedT, from.a + (to.a - from.a) * easedT);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Registry for managing type-specific interpolators
|
|
32
|
-
* Allows registration of custom interpolators for extensibility
|
|
33
|
-
*/
|
|
34
|
-
export class InterpolatorRegistry {
|
|
35
|
-
static _interpolators = new Map();
|
|
36
|
-
static _initialized = false;
|
|
37
|
-
/**
|
|
38
|
-
* Initialize the registry with built-in interpolators
|
|
39
|
-
*/
|
|
40
|
-
static initialize() {
|
|
41
|
-
if (this._initialized)
|
|
42
|
-
return;
|
|
43
|
-
this.register("number", new NumberInterpolator());
|
|
44
|
-
this.register("Vector2", new Vector2Interpolator());
|
|
45
|
-
this.register("Color", new ColorInterpolator());
|
|
46
|
-
this._initialized = true;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Register a custom interpolator for a specific type
|
|
50
|
-
* @param typeName Name of the type (e.g., 'number', 'Vector2', 'MyCustomType')
|
|
51
|
-
* @param interpolator Interpolator instance for the type
|
|
52
|
-
*/
|
|
53
|
-
static register(typeName, interpolator) {
|
|
54
|
-
this._interpolators.set(typeName, interpolator);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get an interpolator for a specific type
|
|
58
|
-
* @param typeName Name of the type
|
|
59
|
-
* @returns Interpolator instance or undefined if not found
|
|
60
|
-
*/
|
|
61
|
-
static get(typeName) {
|
|
62
|
-
this.initialize();
|
|
63
|
-
return this._interpolators.get(typeName);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get an interpolator for a value based on its runtime type
|
|
67
|
-
* @param value Value to determine type from
|
|
68
|
-
* @returns Interpolator instance or undefined if no matching interpolator
|
|
69
|
-
*/
|
|
70
|
-
static getForValue(value) {
|
|
71
|
-
this.initialize();
|
|
72
|
-
if (typeof value === "number") {
|
|
73
|
-
return this.get("number");
|
|
74
|
-
}
|
|
75
|
-
if (value instanceof Vector2) {
|
|
76
|
-
return this.get("Vector2");
|
|
77
|
-
}
|
|
78
|
-
if (value instanceof Color) {
|
|
79
|
-
return this.get("Color");
|
|
80
|
-
}
|
|
81
|
-
return undefined;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Check if an interpolator exists for a type
|
|
85
|
-
* @param typeName Name of the type
|
|
86
|
-
* @returns True if interpolator exists
|
|
87
|
-
*/
|
|
88
|
-
static has(typeName) {
|
|
89
|
-
this.initialize();
|
|
90
|
-
return this._interpolators.has(typeName);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Remove an interpolator from the registry
|
|
94
|
-
* @param typeName Name of the type
|
|
95
|
-
* @returns True if interpolator was removed
|
|
96
|
-
*/
|
|
97
|
-
static unregister(typeName) {
|
|
98
|
-
return this._interpolators.delete(typeName);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Clear all registered interpolators (except built-ins)
|
|
102
|
-
*/
|
|
103
|
-
static clear() {
|
|
104
|
-
this._interpolators.clear();
|
|
105
|
-
this._initialized = false;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=interpolator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolator.js","sourceRoot":"","sources":["../../../core/animation/interpolator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAiBzC;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC3B,WAAW,CACP,IAAY,EACZ,EAAU,EACV,CAAS,EACT,MAAuB;QAEvB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAA;IACtC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC5B,WAAW,CACP,IAAa,EACb,EAAW,EACX,CAAS,EACT,MAAuB;QAEvB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,OAAO,IAAI,OAAO,CACd,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,EACjC,IAAI,CAAC,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"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interpolation types for keyframe animation
|
|
3
|
-
*/
|
|
4
|
-
export type InterpolationType = "linear" | "step" | "cubic" | "bezier";
|
|
5
|
-
/**
|
|
6
|
-
* Easing function type for smooth interpolation
|
|
7
|
-
*/
|
|
8
|
-
export type EasingFunction = (t: number) => number;
|
|
9
|
-
/**
|
|
10
|
-
* Represents a single keyframe in an animation track
|
|
11
|
-
* Stores time, value, and interpolation settings
|
|
12
|
-
*/
|
|
13
|
-
export declare class Keyframe {
|
|
14
|
-
private _time;
|
|
15
|
-
private _value;
|
|
16
|
-
private _interpolation;
|
|
17
|
-
private _easing?;
|
|
18
|
-
constructor(time: number, value: unknown, interpolation?: InterpolationType, easing?: EasingFunction);
|
|
19
|
-
/**
|
|
20
|
-
* Get the time of this keyframe in seconds
|
|
21
|
-
*/
|
|
22
|
-
get time(): number;
|
|
23
|
-
/**
|
|
24
|
-
* Get the value at this keyframe
|
|
25
|
-
*/
|
|
26
|
-
get value(): unknown;
|
|
27
|
-
/**
|
|
28
|
-
* Get the interpolation type
|
|
29
|
-
*/
|
|
30
|
-
get interpolation(): InterpolationType;
|
|
31
|
-
/**
|
|
32
|
-
* Get the easing function (if any)
|
|
33
|
-
*/
|
|
34
|
-
get easing(): EasingFunction | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Set the time of this keyframe
|
|
37
|
-
*/
|
|
38
|
-
set time(value: number);
|
|
39
|
-
/**
|
|
40
|
-
* Set the value at this keyframe
|
|
41
|
-
*/
|
|
42
|
-
set value(val: unknown);
|
|
43
|
-
/**
|
|
44
|
-
* Set the interpolation type
|
|
45
|
-
*/
|
|
46
|
-
set interpolation(value: InterpolationType);
|
|
47
|
-
/**
|
|
48
|
-
* Set the easing function
|
|
49
|
-
*/
|
|
50
|
-
set easing(value: EasingFunction | undefined);
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=keyframe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyframe.d.ts","sourceRoot":"","sources":["../../../core/animation/keyframe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;AAElD;;;GAGG;AACH,qBAAa,QAAQ;IACjB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,OAAO,CAAC,CAAgB;gBAG5B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,aAAa,GAAE,iBAA4B,EAC3C,MAAM,CAAC,EAAE,cAAc;IAQ3B;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,iBAAiB,CAErC;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,cAAc,GAAG,SAAS,CAEvC;IAED;;OAEG;IACH,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,GAAG,EAAE,OAAO,EAErB;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAEzC;IAED;;OAEG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,EAE3C;CACJ"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a single keyframe in an animation track
|
|
3
|
-
* Stores time, value, and interpolation settings
|
|
4
|
-
*/
|
|
5
|
-
export class Keyframe {
|
|
6
|
-
_time;
|
|
7
|
-
_value;
|
|
8
|
-
_interpolation;
|
|
9
|
-
_easing;
|
|
10
|
-
constructor(time, value, interpolation = "linear", easing) {
|
|
11
|
-
this._time = time;
|
|
12
|
-
this._value = value;
|
|
13
|
-
this._interpolation = interpolation;
|
|
14
|
-
this._easing = easing;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get the time of this keyframe in seconds
|
|
18
|
-
*/
|
|
19
|
-
get time() {
|
|
20
|
-
return this._time;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get the value at this keyframe
|
|
24
|
-
*/
|
|
25
|
-
get value() {
|
|
26
|
-
return this._value;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get the interpolation type
|
|
30
|
-
*/
|
|
31
|
-
get interpolation() {
|
|
32
|
-
return this._interpolation;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get the easing function (if any)
|
|
36
|
-
*/
|
|
37
|
-
get easing() {
|
|
38
|
-
return this._easing;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Set the time of this keyframe
|
|
42
|
-
*/
|
|
43
|
-
set time(value) {
|
|
44
|
-
this._time = value;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Set the value at this keyframe
|
|
48
|
-
*/
|
|
49
|
-
set value(val) {
|
|
50
|
-
this._value = val;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Set the interpolation type
|
|
54
|
-
*/
|
|
55
|
-
set interpolation(value) {
|
|
56
|
-
this._interpolation = value;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Set the easing function
|
|
60
|
-
*/
|
|
61
|
-
set easing(value) {
|
|
62
|
-
this._easing = value;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=keyframe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyframe.js","sourceRoot":"","sources":["../../../core/animation/keyframe.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACT,KAAK,CAAQ;IACb,MAAM,CAAS;IACf,cAAc,CAAmB;IACjC,OAAO,CAAiB;IAEhC,YACI,IAAY,EACZ,KAAc,EACd,gBAAmC,QAAQ,EAC3C,MAAuB;QAEvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI,CAAC,KAAa;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,GAAY;QAClB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,KAAwB;QACtC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAA;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM,CAAC,KAAiC;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACxB,CAAC;CACJ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface Logger {
|
|
2
|
-
error(...args: any[]): void;
|
|
3
|
-
warn(...args: any[]): void;
|
|
4
|
-
info(...args: any[]): void;
|
|
5
|
-
}
|
|
6
|
-
export declare function setLogger(logger: Logger | null): void;
|
|
7
|
-
export declare function getLogger(): Logger;
|
|
8
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../core/animation/logger.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACnB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAC1B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;CAC7B;AAiBD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,QAE9C;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
class ConsoleLogger {
|
|
2
|
-
error(...args) {
|
|
3
|
-
console.error(...args);
|
|
4
|
-
}
|
|
5
|
-
warn(...args) {
|
|
6
|
-
console.warn(...args);
|
|
7
|
-
}
|
|
8
|
-
info(...args) {
|
|
9
|
-
console.log(...args);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
// Default shared logger instance
|
|
13
|
-
let currentLogger = new ConsoleLogger();
|
|
14
|
-
export function setLogger(logger) {
|
|
15
|
-
currentLogger = logger || new ConsoleLogger();
|
|
16
|
-
}
|
|
17
|
-
export function getLogger() {
|
|
18
|
-
return currentLogger;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../core/animation/logger.ts"],"names":[],"mappings":"AAMA,MAAM,aAAa;IACf,KAAK,CAAC,GAAG,IAAW;QAChB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;IAC1B,CAAC;IACD,IAAI,CAAC,GAAG,IAAW;QACf,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACzB,CAAC;IACD,IAAI,CAAC,GAAG,IAAW;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;IACxB,CAAC;CACJ;AAED,iCAAiC;AACjC,IAAI,aAAa,GAAW,IAAI,aAAa,EAAE,CAAA;AAE/C,MAAM,UAAU,SAAS,CAAC,MAAqB;IAC3C,aAAa,GAAG,MAAM,IAAI,IAAI,aAAa,EAAE,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,SAAS;IACrB,OAAO,aAAa,CAAA;AACxB,CAAC"}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { AnimationState } from "./animationstate";
|
|
2
|
-
import { StateTransition } from "./statetransition";
|
|
3
|
-
import type { AnimationController } from "../plugin/animationcontroller";
|
|
4
|
-
/**
|
|
5
|
-
* StateMachine manages a collection of animation states and handles transitions between them
|
|
6
|
-
* Provides state switching logic and updates the active state's timeline
|
|
7
|
-
* Supports automatic transitions based on conditions and manual state changes
|
|
8
|
-
*/
|
|
9
|
-
export declare class StateMachine {
|
|
10
|
-
private _states;
|
|
11
|
-
private _currentState;
|
|
12
|
-
private _currentTime;
|
|
13
|
-
private _transitions;
|
|
14
|
-
private _context;
|
|
15
|
-
private _controllers;
|
|
16
|
-
/**
|
|
17
|
-
* Get the currently active animation state
|
|
18
|
-
*/
|
|
19
|
-
get currentState(): AnimationState | null;
|
|
20
|
-
/**
|
|
21
|
-
* Get all states in the state machine
|
|
22
|
-
*/
|
|
23
|
-
get states(): ReadonlyMap<string, AnimationState>;
|
|
24
|
-
/**
|
|
25
|
-
* Get all transitions in the state machine
|
|
26
|
-
*/
|
|
27
|
-
get transitions(): readonly StateTransition[];
|
|
28
|
-
/**
|
|
29
|
-
* Register an AnimationController to receive state change notifications
|
|
30
|
-
* @param controller The controller to register
|
|
31
|
-
*/
|
|
32
|
-
addController(controller: AnimationController): void;
|
|
33
|
-
/**
|
|
34
|
-
* Unregister an AnimationController
|
|
35
|
-
* @param controller The controller to unregister
|
|
36
|
-
* @returns true if the controller was removed, false if it wasn't registered
|
|
37
|
-
*/
|
|
38
|
-
removeController(controller: AnimationController): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Get all registered controllers
|
|
41
|
-
*/
|
|
42
|
-
get controllers(): readonly AnimationController[];
|
|
43
|
-
/**
|
|
44
|
-
* Add a state to the state machine
|
|
45
|
-
* @param state The animation state to add
|
|
46
|
-
* @throws Error if a state with the same ID already exists
|
|
47
|
-
*/
|
|
48
|
-
addState(state: AnimationState): void;
|
|
49
|
-
/**
|
|
50
|
-
* Remove a state from the state machine
|
|
51
|
-
* @param stateId The ID of the state to remove
|
|
52
|
-
* @returns true if the state was removed, false if it didn't exist
|
|
53
|
-
*/
|
|
54
|
-
removeState(stateId: string): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Get a state by its ID
|
|
57
|
-
* @param stateId The ID of the state to retrieve
|
|
58
|
-
* @returns The animation state, or undefined if not found
|
|
59
|
-
*/
|
|
60
|
-
getState(stateId: string): AnimationState | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* Check if a state exists in the state machine
|
|
63
|
-
* @param stateId The ID of the state to check
|
|
64
|
-
* @returns true if the state exists, false otherwise
|
|
65
|
-
*/
|
|
66
|
-
hasState(stateId: string): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Add a transition to the state machine
|
|
69
|
-
* @param transition The state transition to add
|
|
70
|
-
*/
|
|
71
|
-
addTransition(transition: StateTransition): void;
|
|
72
|
-
/**
|
|
73
|
-
* Remove a transition from the state machine
|
|
74
|
-
* @param transition The transition to remove
|
|
75
|
-
* @returns true if the transition was removed, false if it wasn't found
|
|
76
|
-
*/
|
|
77
|
-
removeTransition(transition: StateTransition): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Remove all transitions from a specific state
|
|
80
|
-
* @param stateId The ID of the state to remove transitions from
|
|
81
|
-
* @returns The number of transitions removed
|
|
82
|
-
*/
|
|
83
|
-
removeTransitionsFrom(stateId: string): number;
|
|
84
|
-
/**
|
|
85
|
-
* Trigger an event that can activate event-based transitions
|
|
86
|
-
* @param eventName The name of the event to trigger
|
|
87
|
-
*/
|
|
88
|
-
trigger(eventName: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* Set an input value for condition-based transitions
|
|
91
|
-
* Automatically determines the type based on the value
|
|
92
|
-
* @param name The name of the input
|
|
93
|
-
* @param value The value (boolean or number)
|
|
94
|
-
*/
|
|
95
|
-
setInput(name: string, value: boolean | number): void;
|
|
96
|
-
/**
|
|
97
|
-
* Set a boolean input value for boolean-based transitions
|
|
98
|
-
* @param name The name of the boolean input
|
|
99
|
-
* @param value The boolean value
|
|
100
|
-
*/
|
|
101
|
-
setBooleanInput(name: string, value: boolean): void;
|
|
102
|
-
/**
|
|
103
|
-
* Set a number input value for number-based transitions
|
|
104
|
-
* @param name The name of the number input
|
|
105
|
-
* @param value The number value
|
|
106
|
-
*/
|
|
107
|
-
setNumberInput(name: string, value: number): void;
|
|
108
|
-
/**
|
|
109
|
-
* Get a boolean input value
|
|
110
|
-
* @param name The name of the boolean input
|
|
111
|
-
* @returns The boolean value, or undefined if not set
|
|
112
|
-
*/
|
|
113
|
-
getBooleanInput(name: string): boolean | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* Get a number input value
|
|
116
|
-
* @param name The name of the number input
|
|
117
|
-
* @returns The number value, or undefined if not set
|
|
118
|
-
*/
|
|
119
|
-
getNumberInput(name: string): number | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* Switch to a different state
|
|
122
|
-
* @param stateId The ID of the state to switch to
|
|
123
|
-
* @throws Error if the state doesn't exist
|
|
124
|
-
*/
|
|
125
|
-
changeState(stateId: string): void;
|
|
126
|
-
/**
|
|
127
|
-
* Update the state machine
|
|
128
|
-
* Advances the current state's timeline based on delta time and speed
|
|
129
|
-
* Evaluates transitions and switches states if conditions are met
|
|
130
|
-
* @param deltaTime Time elapsed since last update in seconds
|
|
131
|
-
*/
|
|
132
|
-
update(deltaTime: number): void;
|
|
133
|
-
/**
|
|
134
|
-
* Evaluate all transitions from the current state
|
|
135
|
-
* If multiple transitions are valid, the one with highest priority is chosen
|
|
136
|
-
* @private
|
|
137
|
-
*/
|
|
138
|
-
private _evaluateTransitions;
|
|
139
|
-
/**
|
|
140
|
-
* Get the current playback time of the active state
|
|
141
|
-
* @returns The current time in seconds, or 0 if no state is active
|
|
142
|
-
*/
|
|
143
|
-
get currentTime(): number;
|
|
144
|
-
/**
|
|
145
|
-
* Set the current playback time of the active state
|
|
146
|
-
* @param time The time in seconds to seek to
|
|
147
|
-
*/
|
|
148
|
-
set currentTime(time: number);
|
|
149
|
-
/**
|
|
150
|
-
* Reset the state machine to its initial state
|
|
151
|
-
* Deactivates the current state and resets time
|
|
152
|
-
*/
|
|
153
|
-
reset(): void;
|
|
154
|
-
/**
|
|
155
|
-
* Get the number of states in the state machine
|
|
156
|
-
*/
|
|
157
|
-
get stateCount(): number;
|
|
158
|
-
/**
|
|
159
|
-
* Get all state IDs
|
|
160
|
-
*/
|
|
161
|
-
getStateIds(): string[];
|
|
162
|
-
/**
|
|
163
|
-
* Notify all controllers that a state is being entered
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
private _notifyStateEnter;
|
|
167
|
-
/**
|
|
168
|
-
* Notify all controllers that a state is being exited
|
|
169
|
-
* @private
|
|
170
|
-
*/
|
|
171
|
-
private _notifyStateExit;
|
|
172
|
-
/**
|
|
173
|
-
* Notify all controllers of a state transition
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
private _notifyTransition;
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=statemachine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"statemachine.d.ts","sourceRoot":"","sources":["../../../core/animation/statemachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAA4B,eAAe,EAAE,MAAM,mBAAmB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