import { AnimationAction, AnimationClip, AnimationMixer, type AnimationEvent, type AnimationMixerOptions, type AnimationValue, type LoopMode, type TwoBoneIkResult } from "@aura3d/animation";
import { Scene } from "@aura3d/scene";
import type { GLTFAsset } from "./GLTFLoader";
export interface GLTFSceneAnimationRuntimeOptions {
    readonly scene: Scene;
    readonly clips: readonly AnimationClip[];
    readonly asset?: Pick<GLTFAsset, "meshes" | "skins">;
}
export interface GLTFSceneAnimationClipSample {
    readonly clipName: string;
    readonly time: number;
    readonly weight?: number;
    readonly additive?: boolean;
}
export interface GLTFSceneAnimationApplyResult {
    readonly clipName: string;
    readonly time: number;
    readonly blendedClipCount?: number;
    readonly tracksApplied: number;
    readonly transformTracksApplied: number;
    readonly morphWeightTracksApplied: number;
    readonly skinningPalettesUpdated: number;
    readonly missingTargets: readonly string[];
    readonly unsupportedTracks: readonly string[];
}
export interface GLTFSceneAnimationRuntimeSnapshot {
    readonly clipCount: number;
    readonly nodeTargetCount: number;
    readonly morphTargetNodeCount: number;
    readonly skinningBindingCount: number;
    readonly clips: readonly string[];
    readonly lastApply?: GLTFSceneAnimationApplyResult;
}
export interface GLTFSceneAnimationClipBindingDiagnostics {
    readonly clipName: string;
    readonly trackCount: number;
    readonly supportedTrackCount: number;
    readonly boundTrackCount: number;
    readonly transformTrackCount: number;
    readonly morphWeightTrackCount: number;
    readonly missingTargetCount: number;
    readonly unsupportedTrackCount: number;
    readonly skinningBindingCount: number;
    readonly boundNodeNames: readonly string[];
    readonly missingTargets: readonly string[];
    readonly unsupportedTracks: readonly string[];
    readonly animatesSkeleton: boolean;
}
export interface GLTFSceneAnimationMixerOptions extends GLTFSceneAnimationRuntimeOptions {
    readonly autoPlay?: string | false;
    readonly mixer?: AnimationMixerOptions;
}
export interface GLTFSceneAnimationMixerUpdateResult {
    readonly events: readonly AnimationEvent[];
    readonly applyResult: GLTFSceneAnimationApplyResult;
    readonly activeActions: readonly GLTFSceneAnimationActionSnapshot[];
}
export interface GLTFSceneAnimationMixerSnapshot extends GLTFSceneAnimationRuntimeSnapshot {
    readonly mixerActionCount: number;
    readonly pendingValueCount: number;
    readonly elapsedTime: number;
    readonly timeScale: number;
    readonly activeClipNames: readonly string[];
    readonly actions: readonly GLTFSceneAnimationActionSnapshot[];
}
export interface GLTFSceneAnimationPlayOptions {
    readonly weight?: number;
    readonly timeScale?: number;
    readonly loopMode?: LoopMode;
    readonly reset?: boolean;
    readonly fadeDuration?: number;
}
export interface GLTFSceneAnimationActionSnapshot {
    readonly clipName: string;
    readonly duration: number;
    readonly time: number;
    readonly weight: number;
    readonly timeScale: number;
    readonly playing: boolean;
    readonly paused: boolean;
    readonly loopMode: LoopMode;
    readonly active: boolean;
}
export interface GLTFImportedSkeletonIKOptions {
    readonly skinName?: string;
    readonly jointNames?: readonly [string, string, string];
    readonly target: readonly [number, number, number];
    readonly pole?: readonly [number, number, number];
    readonly weight?: number;
    readonly allowStretch?: boolean;
    readonly apply?: boolean;
}
export interface GLTFImportedSkeletonIKResult {
    readonly skinName: string;
    readonly jointNames: readonly [string, string, string];
    readonly solution: TwoBoneIkResult;
    readonly applied: boolean;
    readonly skinningPalettesUpdated: number;
    readonly missingTargets: readonly string[];
}
export interface GLTFImportedSkeletonIKControllerOptions extends Omit<GLTFImportedSkeletonIKOptions, "target"> {
    readonly target: readonly [number, number, number];
}
export interface GLTFImportedSkeletonIKControllerSnapshot {
    readonly target: readonly [number, number, number];
    readonly pole?: readonly [number, number, number];
    readonly weight?: number;
    readonly allowStretch?: boolean;
    readonly apply: boolean;
    readonly skinName?: string;
    readonly jointNames?: readonly [string, string, string];
    readonly lastResult?: GLTFImportedSkeletonIKResult;
}
export interface GLTFSceneAnimationCloneSample {
    readonly cloneId: string;
    readonly clipName: string;
    readonly time: number;
    readonly weight?: number;
    readonly additive?: boolean;
}
export interface GLTFSceneAnimationCloneSampleResult {
    readonly cloneId: string;
    readonly clipName: string;
    readonly time: number;
    readonly applyResult: GLTFSceneAnimationApplyResult;
}
export interface GLTFSceneAnimationCloneSamplerSnapshot {
    readonly cloneCount: number;
    readonly lastSampleCount: number;
    readonly lastSkinningPalettesUpdated: number;
    readonly lastResults: readonly GLTFSceneAnimationCloneSampleResult[];
}
export interface GLTFSceneMorphTargetControllerOptions {
    readonly target: string;
    readonly labels?: readonly string[];
    readonly initialWeights?: readonly number[];
    readonly clamp?: boolean;
}
export interface GLTFSceneMorphTargetControllerSnapshot {
    readonly target: string;
    readonly labels: readonly string[];
    readonly weights: readonly number[];
    readonly lastApply?: GLTFSceneAnimationApplyResult;
}
export declare class GLTFSceneMorphTargetController {
    private readonly runtime;
    private readonly options;
    private readonly labels;
    private readonly labelToIndex;
    private readonly clampWeights;
    private weights;
    private lastApply;
    constructor(runtime: GLTFSceneAnimationRuntime, options: GLTFSceneMorphTargetControllerOptions);
    setWeight(indexOrLabel: number | string, weight: number): this;
    setWeights(weights: readonly number[]): this;
    getWeights(): readonly number[];
    apply(time: number, label?: string): GLTFSceneAnimationApplyResult;
    snapshot(): GLTFSceneMorphTargetControllerSnapshot;
    private resolveIndex;
    private ensureWeightIndex;
    private normalizeWeight;
}
export declare class GLTFSceneAnimationCloneSampler {
    private readonly runtime;
    private lastResults;
    constructor(runtime: GLTFSceneAnimationRuntime);
    sampleClones(samples: readonly GLTFSceneAnimationCloneSample[], onSample?: (result: GLTFSceneAnimationCloneSampleResult) => void): readonly GLTFSceneAnimationCloneSampleResult[];
    snapshot(): GLTFSceneAnimationCloneSamplerSnapshot;
}
export declare class GLTFImportedSkeletonIKController {
    private readonly runtime;
    private readonly options;
    private target;
    private pole;
    private weight;
    private allowStretch;
    private apply;
    private lastResult;
    constructor(runtime: GLTFSceneAnimationRuntime, options: Omit<GLTFImportedSkeletonIKControllerOptions, "target" | "pole" | "weight" | "allowStretch" | "apply"> & Pick<GLTFImportedSkeletonIKControllerOptions, "skinName" | "jointNames">, initial: Pick<GLTFImportedSkeletonIKControllerOptions, "target" | "pole" | "weight" | "allowStretch" | "apply">);
    setTarget(target: readonly [number, number, number]): this;
    setPole(pole: readonly [number, number, number] | undefined): this;
    setWeight(weight: number | undefined): this;
    setAllowStretch(allowStretch: boolean | undefined): this;
    setApply(apply: boolean): this;
    solve(patch?: Partial<Pick<GLTFImportedSkeletonIKControllerOptions, "target" | "pole" | "weight" | "allowStretch" | "apply">>): GLTFImportedSkeletonIKResult;
    snapshot(): GLTFImportedSkeletonIKControllerSnapshot;
}
export declare class GLTFSceneAnimationRuntime {
    private readonly options;
    private readonly clipsByName;
    private readonly nodesByName;
    private readonly morphRenderablesByNodeName;
    private readonly skinningBindings;
    private lastApply?;
    constructor(options: GLTFSceneAnimationRuntimeOptions);
    applyClipByName(name: string, time: number): GLTFSceneAnimationApplyResult;
    applyClip(clip: AnimationClip, time: number): GLTFSceneAnimationApplyResult;
    applyClips(samples: readonly GLTFSceneAnimationClipSample[]): GLTFSceneAnimationApplyResult;
    applyAnimationValues(label: string, time: number, values: ReadonlyMap<string, AnimationValue>, unsupportedTracks?: readonly string[]): GLTFSceneAnimationApplyResult;
    solveImportedSkeletonTwoBoneIK(options: GLTFImportedSkeletonIKOptions): GLTFImportedSkeletonIKResult;
    createTwoBoneIKController(options: GLTFImportedSkeletonIKControllerOptions): GLTFImportedSkeletonIKController;
    createCloneSampler(): GLTFSceneAnimationCloneSampler;
    createMorphTargetController(options: GLTFSceneMorphTargetControllerOptions): GLTFSceneMorphTargetController;
    snapshot(): GLTFSceneAnimationRuntimeSnapshot;
    inspectClipBindings(name?: string): readonly GLTFSceneAnimationClipBindingDiagnostics[];
    reindexScene(): void;
    private refreshSkinningPalettes;
    private inspectClipBinding;
    private applySampledTargets;
}
export declare function createGLTFSceneAnimationRuntime(options: GLTFSceneAnimationRuntimeOptions): GLTFSceneAnimationRuntime;
export declare class GLTFSceneAnimationMixerBinding {
    readonly runtime: GLTFSceneAnimationRuntime;
    readonly mixer: AnimationMixer;
    readonly actions: ReadonlyMap<string, AnimationAction>;
    private readonly pendingValues;
    private elapsedTime;
    private lastApply?;
    constructor(options: GLTFSceneAnimationMixerOptions);
    listClips(): readonly string[];
    play(name: string, weight?: number): AnimationAction;
    playClip(name: string, options?: GLTFSceneAnimationPlayOptions): AnimationAction;
    playExclusive(name: string, options?: GLTFSceneAnimationPlayOptions): AnimationAction;
    pause(name?: string): void;
    resume(name?: string): void;
    stop(name?: string): void;
    seek(name: string, time: number): AnimationAction;
    setTimeScale(timeScale: number): void;
    setActionTimeScale(name: string, timeScale: number): AnimationAction;
    setActionWeight(name: string, weight: number): AnimationAction;
    setActionLoop(name: string, loopMode: LoopMode): AnimationAction;
    crossFade(fromName: string, toName: string, duration: number): void;
    applyClipSamples(samples: readonly GLTFSceneAnimationClipSample[]): GLTFSceneAnimationMixerUpdateResult;
    update(deltaSeconds: number): GLTFSceneAnimationMixerUpdateResult;
    getAction(name: string): AnimationAction | undefined;
    snapshot(): GLTFSceneAnimationMixerSnapshot;
    private configureAction;
    private resolveActions;
    private actionSnapshots;
    private requireAction;
}
export declare function createGLTFSceneAnimationMixer(options: GLTFSceneAnimationMixerOptions): GLTFSceneAnimationMixerBinding;
//# sourceMappingURL=GLTFAnimationRuntime.d.ts.map