/****************************************************************************** * Spine Runtimes License Agreement * Last updated April 5, 2025. Replaces all prior versions. * * Copyright (c) 2013-2025, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ import { type Animation, AnimationState, Color, type Disposable, type Downloader, Skeleton, type StringMap, TimeKeeper, type TrackEntry } from "@esotericsoftware/spine-core"; import { AssetManager, LoadingScreen, ManagedWebGLRenderingContext, SceneRenderer } from "@esotericsoftware/spine-webgl"; export interface SpinePlayerConfig { skeleton?: string; jsonField?: string; scale?: number; atlasUrl?: string; atlas?: string; rawDataURIs?: StringMap; animation?: string; animations?: string[]; defaultMix?: number; skin?: string | string[]; skins?: string[]; showControls?: boolean; showLoading?: boolean; debug?: boolean | { [key: string]: boolean; bones: boolean; regions: boolean; meshes: boolean; bounds: boolean; paths: boolean; clipping: boolean; points: boolean; hulls: boolean; }; viewport?: { x?: number; y?: number; width?: number; height?: number; clip?: boolean; padLeft?: string | number; padRight?: string | number; padTop?: string | number; padBottom?: string | number; debugRender?: boolean; transitionTime?: number; animations?: StringMap; }; alpha?: boolean; preserveDrawingBuffer: boolean; backgroundColor?: string; fullScreenBackgroundColor?: string; backgroundImage?: { url: string; x?: number; y?: number; width?: number; height?: number; }; mipmaps?: boolean; interactive?: boolean; controlBones?: string[]; success?: (player: SpinePlayer) => void; error?: (player: SpinePlayer, msg: string) => void; frame?: (player: SpinePlayer, delta: number) => void; updateWorldTransform?: (player: SpinePlayer, delta: number) => void; update?: (player: SpinePlayer, delta: number) => void; draw?: (player: SpinePlayer, delta: number) => void; loading?: (player: SpinePlayer, delta: number) => void; downloader?: Downloader; } export interface Viewport { x: number; y: number; width: number; height: number; padLeft: string | number; padRight: string | number; padTop: string | number; padBottom: string | number; clip?: boolean; } export declare class SpinePlayer implements Disposable { private config; parent: HTMLElement; dom: HTMLElement; canvas: HTMLCanvasElement | null; context: ManagedWebGLRenderingContext | null; sceneRenderer: SceneRenderer | null; loadingScreen: LoadingScreen | null; assetManager: AssetManager | null; bg: Color; bgFullscreen: Color; private playerControls; private timelineSlider; private playButton; private skinButton; private pinnedSkins; private animationButton; private playTime; private selectedBones; private cancelId; popup: Popup | null; error: boolean; skeleton: Skeleton | null; animationState: AnimationState | null; paused: boolean; speed: number; time: TimeKeeper; private stopRequestAnimationFrame; private disposed; private viewport; private currentViewport; private previousViewport; private viewportTransitionStart; private eventListeners; private input?; constructor(parent: HTMLElement | string, config: SpinePlayerConfig); dispose(): void; addEventListener(target: any, event: any, func: any): void; private validateConfig; private initialize; private loadSkeleton; private setupInput; play(): void; pause(): void; setAnimation(animation: string | Animation, loop?: boolean): TrackEntry; addAnimation(animation: string | Animation, loop?: boolean, delay?: number): TrackEntry; setViewport(animation: string | Animation): Animation; private percentageToWorldUnit; private calculateAnimationViewport; private drawFrame; startRendering(): void; stopRendering(): void; private hidePopup; private showSpeedDialog; private showAnimationsDialog; private applyCombinedSkin; private showSkinsDialog; private showSettingsDialog; private showError; } declare class Popup { private id; private button; private player; private parent; dom: HTMLElement; private className; constructor(id: string, button: HTMLElement, player: SpinePlayer, parent: HTMLElement, htmlContent: string); dispose(): void; hide(id: string): boolean; show(): void; } export {};