Skip to content

Commit

Permalink
Merge pull request #444 from Keycher/release
Browse files Browse the repository at this point in the history
chg: d.ts build errors fixed

yes, i took too much from main spine-ts repo
  • Loading branch information
ivanpopelyshev authored Jun 3, 2022
2 parents 24e8d51 + 4c0a616 commit 9f824f0
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bundles/all-3.8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion bundles/all-4.0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion bundles/pixi-spine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
4 changes: 2 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"homepage": "https://github.com/pixijs/pixi-spine/#readme",
"devDependencies": {
"@microsoft/api-extractor": "7.13.5",
"@microsoft/api-extractor": "7.18.4",
"@pixi-spine/eslint-config": "~1.0.0",
"@pixi-spine/rollup-config": "~1.0.0",
"chai": "~4.2.0",
Expand All @@ -51,6 +51,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/loader-3.8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/loader-4.0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/loader-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/loader-uni/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/runtime-3.7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/runtime-3.8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/runtime-4.0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.2.3"
"typescript": "~4.3.0"
}
}
18 changes: 18 additions & 0 deletions packages/runtime-4.0/src/core/Skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,15 @@ export class Skeleton implements ISkeleton<SkeletonData, Bone, Slot, Skin> {
return null;
}

/** @returns -1 if the bone was not found. */
findBoneIndex (boneName: string) {
if (!boneName) throw new Error("boneName cannot be null.");
let bones = this.bones;
for (let i = 0, n = bones.length; i < n; i++)
if (bones[i].data.name == boneName) return i;
return -1;
}

/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it
* repeatedly.
* @returns May be null. */
Expand All @@ -432,6 +441,15 @@ export class Skeleton implements ISkeleton<SkeletonData, Bone, Slot, Skin> {
return null;
}

/** @returns -1 if the bone was not found. */
findSlotIndex (slotName: string) {
if (!slotName) throw new Error("slotName cannot be null.");
let slots = this.slots;
for (let i = 0, n = slots.length; i < n; i++)
if (slots[i].data.name == slotName) return i;
return -1;
}

/** Sets a skin by name.
*
* See {@link #setSkin()}. */
Expand Down
2 changes: 0 additions & 2 deletions packages/runtime-4.0/src/core/SkeletonBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,6 @@ class Vertices {
constructor (public bones: Array<number> = null, public vertices: Array<number> | Float32Array = null) { }
}

enum AttachmentType { Region, BoundingBox, Mesh, LinkedMesh, Path, Point, Clipping }

function readTimeline1 (input: BinaryInput, timeline: CurveTimeline1, scale: number): CurveTimeline1 {
let time = input.readFloat(), value = input.readFloat() * scale;
for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {
Expand Down

0 comments on commit 9f824f0

Please sign in to comment.