From a139601365cd7eb383dac91b4712ae727bbc19e9 Mon Sep 17 00:00:00 2001 From: Liam Faulkner Date: Tue, 10 Aug 2021 19:15:08 +0100 Subject: [PATCH 1/2] fix: expanding types to closer match runtimes --- packages/base/src/core/ISkeleton.ts | 37 +++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/packages/base/src/core/ISkeleton.ts b/packages/base/src/core/ISkeleton.ts index 1063e75d..35b9821c 100644 --- a/packages/base/src/core/ISkeleton.ts +++ b/packages/base/src/core/ISkeleton.ts @@ -1,5 +1,5 @@ import {AttachmentType} from './AttachmentType'; -import type {Color, Vector2} from './Utils'; +import type {Color, Vector2, Map} from './Utils'; import type {TextureRegion} from './TextureRegion'; import type {Matrix} from '@pixi/math'; @@ -12,6 +12,18 @@ export interface IBone { matrix: Matrix; } +/** + * @public + */ +export interface ISkin { + name: string; + attachments: Array>; + + setAttachment(slotIndex: number, name: string, attachment: IAttachment): void; + getAttachment(slotIndex: number, name: string): IAttachment | null; + attachAll(skeleton: ISkeleton, oldSkin: ISkin): void; +} + /** * @public */ @@ -93,10 +105,12 @@ export interface ISlot { /** * @public */ -export interface ISkeleton { +export interface ISkeleton { bones: Bone[] slots: Slot[] drawOrder: Slot[] + skin: Skin; + data: ISkeletonData; updateWorldTransform (): void; setToSetupPose (): void; findSlotIndex (slotName: string): number; @@ -104,6 +118,8 @@ export interface ISkeleton Date: Tue, 10 Aug 2021 19:19:11 +0100 Subject: [PATCH 2/2] style: code formatting for consistency --- packages/base/src/core/ISkeleton.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/base/src/core/ISkeleton.ts b/packages/base/src/core/ISkeleton.ts index 35b9821c..b3afb47f 100644 --- a/packages/base/src/core/ISkeleton.ts +++ b/packages/base/src/core/ISkeleton.ts @@ -19,9 +19,9 @@ export interface ISkin { name: string; attachments: Array>; - setAttachment(slotIndex: number, name: string, attachment: IAttachment): void; - getAttachment(slotIndex: number, name: string): IAttachment | null; - attachAll(skeleton: ISkeleton, oldSkin: ISkin): void; + setAttachment (slotIndex: number, name: string, attachment: IAttachment): void; + getAttachment (slotIndex: number, name: string): IAttachment | null; + attachAll (skeleton: ISkeleton, oldSkin: ISkin): void; } /** @@ -144,7 +144,7 @@ export interface ISkeletonData { width: number; height: number; - findSkin(skinName: string): ISkin | null; + findSkin (skinName: string): ISkin | null; } /** @@ -179,8 +179,8 @@ export interface IAnimationState { addListener (listener: IAnimationStateListener): void; removeListener (listener: IAnimationStateListener): void; clearListeners (): void; - clearTracks(): void; - clearTrack(index: number): void; + clearTracks (): void; + clearTrack (index: number): void; } /**