@galacean/engine-spine 1.2.0 → 2.0.0-alpha.52

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.
Files changed (88) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +158 -44
  3. package/dist/browser.js +2139 -1
  4. package/dist/browser.js.map +1 -0
  5. package/dist/browser.min.js +2 -0
  6. package/dist/browser.min.js.map +1 -0
  7. package/dist/main.js +2134 -1
  8. package/dist/main.js.map +1 -1
  9. package/dist/module.js +2117 -1
  10. package/dist/module.js.map +1 -1
  11. package/package.json +30 -55
  12. package/types/SpineAnimation.d.ts +4 -44
  13. package/types/SpineAnimationState.d.ts +32 -0
  14. package/types/SpineAnimationStateData.d.ts +10 -0
  15. package/types/SpineAnimationStateListener.d.ts +20 -0
  16. package/types/SpineBone.d.ts +28 -0
  17. package/types/SpineConstant.d.ts +12 -0
  18. package/types/SpinePhysics.d.ts +17 -0
  19. package/types/SpinePhysicsConstraint.d.ts +22 -0
  20. package/types/SpineSkeleton.d.ts +31 -0
  21. package/types/SpineSkeletonData.d.ts +18 -0
  22. package/types/SpineSkin.d.ts +7 -0
  23. package/types/SpineSlot.d.ts +13 -0
  24. package/types/SpineTrackEntry.d.ts +44 -0
  25. package/types/enums/SpineBlendMode.d.ts +14 -0
  26. package/types/index.d.ts +15 -9
  27. package/types/loader/LoaderUtils.d.ts +1 -0
  28. package/types/loader/SpineLoader.d.ts +21 -0
  29. package/types/loader/SpineResource.d.ts +37 -0
  30. package/types/loader/SpineVersion.d.ts +2 -0
  31. package/types/loader/index.d.ts +2 -0
  32. package/types/renderer/SpineAnimationRenderer.d.ts +142 -0
  33. package/types/renderer/SpineGeometry.d.ts +1 -0
  34. package/types/renderer/SpineMaterial.d.ts +10 -0
  35. package/types/renderer/index.d.ts +2 -0
  36. package/types/runtime/ISpineRuntime.d.ts +4 -0
  37. package/types/AntGSpineLoader.d.ts +0 -22
  38. package/types/SpineLoader.d.ts +0 -32
  39. package/types/SpineMaterial.d.ts +0 -6
  40. package/types/SpineRenderer.d.ts +0 -38
  41. package/types/core/MeshGenerator.d.ts +0 -43
  42. package/types/core/SpineMesh.d.ts +0 -11
  43. package/types/spine-core/Animation.d.ts +0 -378
  44. package/types/spine-core/AnimationState.d.ts +0 -365
  45. package/types/spine-core/AnimationStateData.d.ts +0 -23
  46. package/types/spine-core/AssetManager.d.ts +0 -36
  47. package/types/spine-core/AtlasAttachmentLoader.d.ts +0 -23
  48. package/types/spine-core/BlendMode.d.ts +0 -7
  49. package/types/spine-core/Bone.d.ts +0 -110
  50. package/types/spine-core/BoneData.d.ts +0 -44
  51. package/types/spine-core/ConstraintData.d.ts +0 -7
  52. package/types/spine-core/Event.d.ts +0 -16
  53. package/types/spine-core/EventData.d.ts +0 -13
  54. package/types/spine-core/IkConstraint.d.ts +0 -38
  55. package/types/spine-core/IkConstraintData.d.ts +0 -26
  56. package/types/spine-core/PathConstraint.d.ts +0 -46
  57. package/types/spine-core/PathConstraintData.d.ts +0 -52
  58. package/types/spine-core/SharedAssetManager.d.ts +0 -19
  59. package/types/spine-core/Skeleton.d.ts +0 -134
  60. package/types/spine-core/SkeletonBinary.d.ts +0 -49
  61. package/types/spine-core/SkeletonBounds.d.ts +0 -48
  62. package/types/spine-core/SkeletonClipping.d.ts +0 -22
  63. package/types/spine-core/SkeletonData.d.ts +0 -89
  64. package/types/spine-core/SkeletonJson.d.ts +0 -34
  65. package/types/spine-core/Skin.d.ts +0 -43
  66. package/types/spine-core/Slot.d.ts +0 -42
  67. package/types/spine-core/SlotData.d.ts +0 -23
  68. package/types/spine-core/Texture.d.ts +0 -46
  69. package/types/spine-core/TextureAtlas.d.ts +0 -30
  70. package/types/spine-core/TransformConstraint.d.ts +0 -36
  71. package/types/spine-core/TransformConstraintData.d.ts +0 -34
  72. package/types/spine-core/Triangulator.d.ts +0 -14
  73. package/types/spine-core/Updatable.d.ts +0 -9
  74. package/types/spine-core/Utils.d.ts +0 -124
  75. package/types/spine-core/VertexEffect.d.ts +0 -7
  76. package/types/spine-core/attachments/Attachment.d.ts +0 -43
  77. package/types/spine-core/attachments/AttachmentLoader.d.ts +0 -25
  78. package/types/spine-core/attachments/AttachmentType.d.ts +0 -9
  79. package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +0 -12
  80. package/types/spine-core/attachments/ClippingAttachment.d.ts +0 -14
  81. package/types/spine-core/attachments/MeshAttachment.d.ts +0 -46
  82. package/types/spine-core/attachments/PathAttachment.d.ts +0 -19
  83. package/types/spine-core/attachments/PointAttachment.d.ts +0 -20
  84. package/types/spine-core/attachments/RegionAttachment.d.ts +0 -88
  85. package/types/spine-core/polyfills.d.ts +0 -3
  86. package/types/spine-core/vertexeffects/JitterEffect.d.ts +0 -11
  87. package/types/spine-core/vertexeffects/SwirlEffect.d.ts +0 -16
  88. package/types/types.d.ts +0 -4
package/package.json CHANGED
@@ -1,64 +1,39 @@
1
1
  {
2
- "version": "1.2.0",
3
- "description": "galacean spine runtime",
4
2
  "name": "@galacean/engine-spine",
3
+ "version": "2.0.0-alpha.52",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org"
7
+ },
8
+ "repository": {
9
+ "url": "https://github.com/galacean/engine.git"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/main.js",
6
- "browser": "dist/browser.js",
7
13
  "module": "dist/module.js",
8
- "dependencies": {},
9
- "peerDependencies": {
10
- "@galacean/engine": ">=1.1.0-beta.0"
14
+ "debug": "src/index.ts",
15
+ "browser": "dist/browser.js",
16
+ "types": "types/index.d.ts",
17
+ "umd": {
18
+ "name": "Galacean.Spine",
19
+ "globals": {
20
+ "@galacean/engine": "Galacean"
21
+ }
11
22
  },
23
+ "files": [
24
+ "dist/**/*",
25
+ "types/**/*"
26
+ ],
12
27
  "devDependencies": {
13
- "@babel/core": "^7.22.5",
14
- "@babel/plugin-proposal-class-properties": "^7.12.1",
15
- "@babel/plugin-proposal-decorators": "^7.12.1",
16
- "@babel/plugin-proposal-optional-chaining": "^7.12.1",
17
- "@babel/plugin-transform-object-assign": "^7.12.1",
18
- "@babel/preset-env": "^7.12.1",
19
- "@babel/preset-typescript": "^7.12.1",
20
- "@galacean/engine": "^1.1.0-beta.11",
21
- "@galacean/engine-toolkit": "^1.1.0-beta.0",
22
- "@rollup/plugin-babel": "^5.2.1",
23
- "@rollup/plugin-commonjs": "^16.0.0",
24
- "@rollup/plugin-inject": "^4.0.2",
25
- "@rollup/plugin-node-resolve": "^10.0.0",
26
- "@rollup/plugin-replace": "^2.3.4",
27
- "@rollup/plugin-terser": "^0.4.3",
28
- "@swc/core": "^1.3.32",
29
- "@swc/helpers": "^0.5",
30
- "cross-env": "^5.2.0",
31
- "dat.gui": "^0.7.9",
32
- "react": "^16.14.0",
33
- "react-dom": "^16.14.0",
34
- "rollup": "^2.32.0",
35
- "rollup-plugin-glslify": "^1.2.0",
36
- "rollup-plugin-modify": "^3.0.0",
37
- "rollup-plugin-serve": "^1.1.0",
38
- "rollup-plugin-swc3": "^0.8.0",
39
- "rollup-plugin-terser": "^7.0.2",
40
- "rollup-plugin-version-injector": "^1.3.3",
41
- "typescript": "^4.8.4",
42
- "vite": "^4.3.9"
28
+ "@galacean/engine": "2.0.0-alpha.52"
43
29
  },
44
- "ci": {
45
- "type": "aci",
46
- "versions": "12"
30
+ "peerDependencies": {
31
+ "@galacean/engine": "2.0.0-alpha.52"
47
32
  },
48
- "files": [
49
- "types",
50
- "dist"
51
- ],
52
- "scripts": {
53
- "example": "vite",
54
- "test": "jest",
55
- "test-cov": "jest --coverage",
56
- "dev": "rollup -cw",
57
- "build": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c",
58
- "ci": "npm run lint && npm run test-cov",
59
- "lint": "eslint src --fix --ext .ts,.tsx",
60
- "b:types": "tsc --emitDeclarationOnly"
33
+ "dependencies": {
34
+ "@galacean/engine-design": "2.0.0-alpha.52"
61
35
  },
62
- "types": "types/index.d.ts",
63
- "repository": "https://github.com/johanzhu/engine-spine.git"
64
- }
36
+ "scripts": {
37
+ "b:types": "tsc"
38
+ }
39
+ }
@@ -1,45 +1,5 @@
1
- import { Skeleton } from "./spine-core/Skeleton";
2
- import { SkeletonData } from "./spine-core/SkeletonData";
3
- import { AnimationState } from "./spine-core/AnimationState";
4
- import { MeshGenerator } from "./core/MeshGenerator";
5
- import { SpineRenderSetting } from "./types";
6
- import { Script, Entity, Texture2D, Material, Engine } from "@galacean/engine";
7
- export declare class SpineAnimation extends Script {
8
- /** Spine 材质 */
9
- private static _defaultMaterial;
10
- static getDefaultMaterial(engine: Engine): Material;
11
- private _skeletonData;
12
- private _skeleton;
13
- private _state;
14
- private _tempOffset;
15
- private _tempSize;
16
- private _tempArray;
17
- protected _meshGenerator: MeshGenerator;
18
- setting: SpineRenderSetting;
19
- autoUpdateBounds: boolean;
20
- noPause: boolean;
21
- get skeletonData(): SkeletonData;
22
- get skeleton(): Skeleton;
23
- get state(): AnimationState;
24
- get mesh(): import("@galacean/engine").BufferMesh;
25
- set scale(v: number);
26
- constructor(entity: Entity);
27
- setSkeletonData(skeletonData: SkeletonData, setting?: SpineRenderSetting): void;
28
- /**
29
- * Separate slot by slot name. This will add a new sub mesh, and new materials.
30
- */
31
- addSeparateSlot(slotName: string): void;
32
- /**
33
- * Change texture of a separated slot by name.
34
- */
35
- hackSeparateSlotTexture(slotName: string, texture: Texture2D): void;
36
- onUpdate(delta: number): void;
37
- updateGeometry(): void;
38
- updateBounds(): void;
39
- /**
40
- * Spine animation custom clone.
41
- */
42
- _cloneTo(target: SpineAnimation): void;
43
- private _disposeCurrentSkeleton;
44
- onDestroy(): void;
1
+ /** Read-only animation metadata shared by instances of a resource. */
2
+ export interface SpineAnimation {
3
+ readonly name: string;
4
+ readonly duration: number;
45
5
  }
@@ -0,0 +1,32 @@
1
+ import type { SpineAnimationStateData } from "./SpineAnimationStateData";
2
+ import type { SpineAnimationStateListener } from "./SpineAnimationStateListener";
3
+ import { SpineTrackEntry } from "./SpineTrackEntry";
4
+ /** Playback controls for one renderer. Entries and callback arguments have stable public identities. */
5
+ export declare class SpineAnimationState {
6
+ private _native;
7
+ private _runtime;
8
+ readonly data: SpineAnimationStateData;
9
+ private _entries;
10
+ private _listeners;
11
+ private _operationDepth;
12
+ private _disposed;
13
+ private constructor();
14
+ get timeScale(): number;
15
+ set timeScale(value: number);
16
+ setAnimation(track: number, name: string, loop: boolean): SpineTrackEntry;
17
+ addAnimation(track: number, name: string, loop: boolean, delay: number): SpineTrackEntry;
18
+ setEmptyAnimation(track: number, mixDuration: number): SpineTrackEntry;
19
+ addEmptyAnimation(track: number, mixDuration: number, delay: number): SpineTrackEntry;
20
+ setEmptyAnimations(mixDuration: number): void;
21
+ getCurrent(track: number): SpineTrackEntry | null;
22
+ clearTrack(track: number): void;
23
+ clearTracks(): void;
24
+ addListener(listener: SpineAnimationStateListener): void;
25
+ removeListener(listener: SpineAnimationStateListener): void;
26
+ clearListeners(): void;
27
+ private _validateTrack;
28
+ private _command;
29
+ private _endOperation;
30
+ private _dispatch;
31
+ private _event;
32
+ }
@@ -0,0 +1,10 @@
1
+ import type { SpineSkeletonData } from "./SpineSkeletonData";
2
+ /** Mixing configuration shared by all instances of a resource. */
3
+ export declare class SpineAnimationStateData {
4
+ readonly skeletonData: SpineSkeletonData;
5
+ private constructor();
6
+ get defaultMix(): number;
7
+ set defaultMix(value: number);
8
+ /** Set the transition duration between two named animations. */
9
+ setMix(from: string, to: string, duration: number): void;
10
+ }
@@ -0,0 +1,20 @@
1
+ import type { SpineTrackEntry } from "./SpineTrackEntry";
2
+ /** A snapshot of an authored animation event. It can be retained after the callback returns. */
3
+ export interface SpineEvent {
4
+ readonly data: {
5
+ readonly name: string;
6
+ };
7
+ readonly time: number;
8
+ readonly intValue: number;
9
+ readonly floatValue: number;
10
+ readonly stringValue: string | null;
11
+ }
12
+ /** Playback callbacks receive Spine public objects, never backend handles. */
13
+ export interface SpineAnimationStateListener {
14
+ start?(entry: SpineTrackEntry): void;
15
+ interrupt?(entry: SpineTrackEntry): void;
16
+ end?(entry: SpineTrackEntry): void;
17
+ dispose?(entry: SpineTrackEntry): void;
18
+ complete?(entry: SpineTrackEntry): void;
19
+ event?(entry: SpineTrackEntry, event: SpineEvent): void;
20
+ }
@@ -0,0 +1,28 @@
1
+ /** A bone's local pose and evaluated world transform, owned by one skeleton instance. */
2
+ export declare class SpineBone {
3
+ private _native;
4
+ private constructor();
5
+ get name(): string;
6
+ get x(): number;
7
+ set x(value: number);
8
+ get y(): number;
9
+ set y(value: number);
10
+ get rotation(): number;
11
+ set rotation(value: number);
12
+ get scaleX(): number;
13
+ set scaleX(value: number);
14
+ get scaleY(): number;
15
+ set scaleY(value: number);
16
+ get shearX(): number;
17
+ set shearX(value: number);
18
+ get shearY(): number;
19
+ set shearY(value: number);
20
+ get a(): number;
21
+ get b(): number;
22
+ get c(): number;
23
+ get d(): number;
24
+ get worldX(): number;
25
+ get worldY(): number;
26
+ isActive(): boolean;
27
+ setToSetupPose(): void;
28
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Vertex stride (float count per vertex) of the spine vertex layout owned by `SpineAnimationRenderer`.
3
+ *
4
+ * - `withoutTint`: [x, y, z, r, g, b, a, u, v] = 9 floats
5
+ * - `withTint`: [x, y, z, r, g, b, a, u, v, dr, dg, db] = 12 floats
6
+ *
7
+ * The renderer supplies the matching stride to backend generators through the geometry contract.
8
+ */
9
+ export declare const SpineVertexStride: {
10
+ readonly withoutTint: 9;
11
+ readonly withTint: 12;
12
+ };
@@ -0,0 +1,17 @@
1
+ import { SpinePhysicsConstraint } from "./SpinePhysicsConstraint";
2
+ /** Physics availability for the bound asset. Narrow supported before accessing value. */
3
+ export type SpinePhysicsSupport = {
4
+ readonly supported: true;
5
+ readonly value: SpinePhysics;
6
+ } | {
7
+ readonly supported: false;
8
+ readonly reason: string;
9
+ };
10
+ /** Physics controls evaluated by the skeleton's backend. */
11
+ export declare class SpinePhysics {
12
+ private _native;
13
+ readonly physicsConstraints: readonly SpinePhysicsConstraint[];
14
+ private constructor();
15
+ physicsTranslate(x: number, y: number): void;
16
+ physicsRotate(x: number, y: number, degrees: number): void;
17
+ }
@@ -0,0 +1,22 @@
1
+ /** An instance's physics constraint. Changes affect only this skeleton. */
2
+ export declare class SpinePhysicsConstraint {
3
+ private _native;
4
+ private constructor();
5
+ get name(): string;
6
+ get inertia(): number;
7
+ set inertia(value: number);
8
+ get strength(): number;
9
+ set strength(value: number);
10
+ get damping(): number;
11
+ set damping(value: number);
12
+ get massInverse(): number;
13
+ set massInverse(value: number);
14
+ get wind(): number;
15
+ set wind(value: number);
16
+ get gravity(): number;
17
+ set gravity(value: number);
18
+ get mix(): number;
19
+ set mix(value: number);
20
+ isActive(): boolean;
21
+ reset(): void;
22
+ }
@@ -0,0 +1,31 @@
1
+ import { SpineBone } from "./SpineBone";
2
+ import { SpineSlot } from "./SpineSlot";
3
+ import type { SpineSkin } from "./SpineSkin";
4
+ import type { SpineSkeletonData } from "./SpineSkeletonData";
5
+ /** The editable pose of one renderer. Bone and slot wrappers are created once and reused. */
6
+ export declare class SpineSkeleton {
7
+ private _native;
8
+ readonly data: SpineSkeletonData;
9
+ readonly bones: readonly SpineBone[];
10
+ /** Slots in setup order, independent of the animated draw order. */
11
+ readonly slots: readonly SpineSlot[];
12
+ private constructor();
13
+ get x(): number;
14
+ set x(value: number);
15
+ get y(): number;
16
+ set y(value: number);
17
+ get scaleX(): number;
18
+ set scaleX(value: number);
19
+ get scaleY(): number;
20
+ set scaleY(value: number);
21
+ get skin(): SpineSkin | null;
22
+ findBone(name: string): SpineBone | null;
23
+ findSlot(name: string): SpineSlot | null;
24
+ setSkinByName(name: string): void;
25
+ /** Assign a skin from this resource, or clear the current skin. */
26
+ setSkin(skin: SpineSkin | null): void;
27
+ setAttachment(slotName: string, attachmentName: string | null): void;
28
+ setToSetupPose(): void;
29
+ setBonesToSetupPose(): void;
30
+ setSlotsToSetupPose(): void;
31
+ }
@@ -0,0 +1,18 @@
1
+ import type { SpineAnimation } from "./SpineAnimation";
2
+ import { SpineSkin } from "./SpineSkin";
3
+ /** Shared asset metadata, animations and skins. Instances retain the same data object. */
4
+ export declare class SpineSkeletonData {
5
+ private _skins;
6
+ readonly animations: readonly SpineAnimation[];
7
+ readonly skins: readonly SpineSkin[];
8
+ private constructor();
9
+ get name(): string | null;
10
+ get version(): string | null;
11
+ get x(): number;
12
+ get y(): number;
13
+ get width(): number;
14
+ get height(): number;
15
+ get defaultSkin(): SpineSkin | null;
16
+ findSkin(name: string): SpineSkin | null;
17
+ findAnimation(name: string): SpineAnimation | null;
18
+ }
@@ -0,0 +1,7 @@
1
+ /** A shared skin belonging to one Spine resource. Create composite skins with SpineResource.createSkin. */
2
+ export declare class SpineSkin {
3
+ private constructor();
4
+ get name(): string;
5
+ /** Add all attachments and required bones/constraints from another skin of this resource. */
6
+ addSkin(skin: SpineSkin): void;
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { SpineBone } from "./SpineBone";
2
+ /** An attachment slot owned by one skeleton instance. */
3
+ export declare class SpineSlot {
4
+ private _native;
5
+ private _skeleton;
6
+ readonly bone: SpineBone;
7
+ private constructor();
8
+ get name(): string;
9
+ /** Select an attachment by its skin entry name, or clear the slot with null. */
10
+ setAttachment(name: string | null): void;
11
+ /** Restore the setup color and attachment, using the current skin. */
12
+ setToSetupPose(): void;
13
+ }
@@ -0,0 +1,44 @@
1
+ import type { SpineAnimation } from "./SpineAnimation";
2
+ import type { SpineAnimationStateListener } from "./SpineAnimationStateListener";
3
+ /**
4
+ * One playback entry. Valid through its dispose callbacks.
5
+ * After disposal, accessing playback properties throws even if the backend reuses its pooled entry.
6
+ */
7
+ export declare class SpineTrackEntry {
8
+ private _native;
9
+ private _state;
10
+ private _listener;
11
+ private _animation;
12
+ private constructor();
13
+ get disposed(): boolean;
14
+ get animation(): SpineAnimation | null;
15
+ get trackIndex(): number;
16
+ get next(): SpineTrackEntry | null;
17
+ get mixingFrom(): SpineTrackEntry | null;
18
+ get mixingTo(): SpineTrackEntry | null;
19
+ get listener(): SpineAnimationStateListener | null;
20
+ set listener(value: SpineAnimationStateListener | null);
21
+ get loop(): boolean;
22
+ set loop(value: boolean);
23
+ get delay(): number;
24
+ set delay(value: number);
25
+ get trackTime(): number;
26
+ set trackTime(value: number);
27
+ get trackEnd(): number;
28
+ set trackEnd(value: number);
29
+ get timeScale(): number;
30
+ set timeScale(value: number);
31
+ get alpha(): number;
32
+ set alpha(value: number);
33
+ get animationStart(): number;
34
+ set animationStart(value: number);
35
+ get animationEnd(): number;
36
+ set animationEnd(value: number);
37
+ get mixTime(): number;
38
+ set mixTime(value: number);
39
+ get mixDuration(): number;
40
+ set mixDuration(value: number);
41
+ getAnimationTime(): number;
42
+ isComplete(): boolean;
43
+ private _requireNative;
44
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Blend mode of a spine slot.
3
+ *
4
+ * @remarks
5
+ * Version-neutral mirror of spine-core's `BlendMode` enum. The values match spine-core across all
6
+ * supported runtime versions (3.8 / 4.2), so a core package can pass its `BlendMode` straight through.
7
+ * Owning it here keeps the shared package free of any runtime spine-core dependency.
8
+ */
9
+ export declare enum SpineBlendMode {
10
+ Normal = 0,
11
+ Additive = 1,
12
+ Multiply = 2,
13
+ Screen = 3
14
+ }
package/types/index.d.ts CHANGED
@@ -1,10 +1,16 @@
1
- import "./SpineLoader";
2
- export { SpineRenderer } from "./SpineRenderer";
3
- export { SpineAnimation } from "./SpineAnimation";
4
- export { AssetManager } from "./spine-core/AssetManager";
5
- export { Texture } from "./spine-core/Texture";
6
- export { TextureAtlas } from "./spine-core/TextureAtlas";
7
- export { AtlasAttachmentLoader } from "./spine-core/AtlasAttachmentLoader";
8
- export { SkeletonJson } from "./spine-core/SkeletonJson";
9
- export { SkeletonBinary } from "./spine-core/SkeletonBinary";
1
+ export * from "./loader/index";
2
+ export * from "./renderer/index";
3
+ export { SpineSkeleton } from "./SpineSkeleton";
4
+ export { SpineBone } from "./SpineBone";
5
+ export { SpineSlot } from "./SpineSlot";
6
+ export { SpineSkin } from "./SpineSkin";
7
+ export { SpineSkeletonData } from "./SpineSkeletonData";
8
+ export { SpineAnimationStateData } from "./SpineAnimationStateData";
9
+ export { SpineAnimationState } from "./SpineAnimationState";
10
+ export { SpineTrackEntry } from "./SpineTrackEntry";
11
+ export { SpinePhysics } from "./SpinePhysics";
12
+ export { SpinePhysicsConstraint } from "./SpinePhysicsConstraint";
13
+ export type { SpineAnimation } from "./SpineAnimation";
14
+ export type { SpineAnimationStateListener, SpineEvent } from "./SpineAnimationStateListener";
15
+ export type { SpinePhysicsSupport } from "./SpinePhysics";
10
16
  export declare const version = "__buildVersion";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { ISpineRuntime } from "../runtime/ISpineRuntime";
2
+ import { AssetPromise, Engine, EngineConfiguration, Loader, LoadItem, ResourceManager } from "@galacean/engine";
3
+ import { SpineResource } from "./SpineResource";
4
+ export declare class SpineLoader extends Loader<SpineResource> {
5
+ private static _decoder;
6
+ private _runtimes;
7
+ static _getUrlExtension(url: string): string | null;
8
+ private static _groupAssetsByExtension;
9
+ private static _assignAssetPathsFromUrl;
10
+ private static _getUrlPath;
11
+ initialize(engine: Engine, configuration: EngineConfiguration): void;
12
+ load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<SpineResource>;
13
+ private _getRuntime;
14
+ private _loadAndCreateSpineResource;
15
+ }
16
+ declare module "@galacean/engine" {
17
+ interface EngineConfiguration {
18
+ /** Initial Spine backend. Import engine-spine before creating the engine. */
19
+ spine?: ISpineRuntime;
20
+ }
21
+ }
@@ -0,0 +1,37 @@
1
+ import { SpineSkeletonData } from "../SpineSkeletonData";
2
+ import { SpineAnimationStateData } from "../SpineAnimationStateData";
3
+ import type { SpineSkin } from "../SpineSkin";
4
+ import { Entity, ReferResource } from "@galacean/engine";
5
+ /**
6
+ * Represents a resource that manages Spine animation data, textures, and entity templates for the Galacean engine.
7
+ *
8
+ */
9
+ export declare class SpineResource extends ReferResource {
10
+ /** The url of spine resource. */
11
+ readonly url: string;
12
+ private _texturesInSpineAtlas;
13
+ private _skeletonData;
14
+ private _stateData;
15
+ private _template;
16
+ private constructor();
17
+ /**
18
+ * The skeleton data associated with this Spine resource.
19
+ */
20
+ get skeletonData(): SpineSkeletonData;
21
+ /**
22
+ * The animation state data associated with this Spine resource.
23
+ */
24
+ get stateData(): SpineAnimationStateData;
25
+ /**
26
+ * Create an empty skin for composing skins/attachments from this resource.
27
+ * The returned skin can be assigned to one or more instances of this resource.
28
+ */
29
+ createSkin(name: string): SpineSkin;
30
+ /** Creates an independent pose and playback state using this resource's shared data. */
31
+ instantiate(): Entity;
32
+ protected _onDestroy(): void;
33
+ private _createTemplate;
34
+ private _associationTextureInSkeletonData;
35
+ private _disassociateTextures;
36
+ private _extractFileName;
37
+ }
@@ -0,0 +1,2 @@
1
+ /** Read only the export header, before selecting or invoking a version-specific parser. */
2
+ export declare function readSpineVersion(data: string | ArrayBuffer): string;
@@ -0,0 +1,2 @@
1
+ import "./SpineLoader";
2
+ export { SpineResource } from "./SpineResource";