import type { ModelAnimationConfig } from "./playableGame.js"; /** * Semantic animation roles a GLB clip name can map to. Rigged packs name the same motion * differently (`Idle` / `Walking_A` / `Armature|Run`); roles are the pack-agnostic vocabulary * the engine defaults from. */ export type ClipRole = "idle" | "walk" | "run" | "strafe" | "backward" | "attack" | "hit" | "death" | "jump" | "spawn" | "interact" | "cheer"; /** * Keyword table driving {@link classifyClip}: lowercase keywords matched against a clip name's * tokens (exact token match beats prefix match). Extend or replace per game/pack — the table is * plain data, no genre assumptions. */ export interface ClipRoleTable { readonly roles: Readonly>>; /** Tokens that disqualify a clip from classification entirely (e.g. `pose` for held-pose variants). */ readonly exclude?: readonly string[]; } /** Default vocabulary covering KayKit, Quaternius, and Mixamo-style clip naming. */ export declare const DEFAULT_CLIP_ROLE_TABLE: ClipRoleTable; /** * Classify a single GLB clip name into a {@link ClipRole}, or `null` when nothing matches (or an * exclusion token like `pose` disqualifies it). Deterministic: exact token matches beat prefix * matches; remaining ties resolve by fixed role priority (death > hit > attack > … > idle). * * @capability clip-roles map a rigged asset's pack-specific clip name to its semantic animation role */ export declare function classifyClip(name: string, table?: ClipRoleTable): ClipRole | null; /** * Group a GLB's clip names by role. Each role's variants are sorted simplest-first — fewest name * tokens, then lexicographic — so the canonical variant (`Idle` over `2H_Melee_Idle`, KayKit * `Walking_A` over `Walking_B`) is always first: stable output for the same clip set regardless * of source order. */ export declare function rolesFromClips(clips: readonly string[], table?: ClipRoleTable): Partial>; /** * Build the default `ModelConfig.animation` for a rigged asset from its catalog clip names: * speed-driven idle/walk/run states plus hit/death/attack one-shots where identifiable, and the * lateral/backward states when the pack names them (KayKit's `Running_Strafe_Left`, * `Walking_Backwards`). Returns `undefined` when no idle clip is identifiable - an ambiguous rig * renders its bind pose rather than guessing. Walk falls back to idle when the pack has no walk clip. * * @capability clip-roles derive a complete default animation config from a rigged asset's clip names */ export declare function defaultAnimationForClips(clips: readonly string[], table?: ClipRoleTable): ModelAnimationConfig | undefined; /** * Collapse `ModelConfig.animation`'s widened union to a concrete playback config: explicit * configs pass through, `"none"`/absent render the bind pose, and `"auto"` derives states and * one-shots from the model's clip names via {@link defaultAnimationForClips}. The shell calls * this with the loaded GLB's actual clip names, so `"auto"` works on any rigged model — * catalog-resolved ids are stamped `"auto"` automatically. An object with `auto: true` derives * the same defaults, then replaces each explicitly supplied field whole, including empty maps. */ export declare function resolveAnimationConfig(animation: ModelAnimationConfig | "auto" | "none" | undefined, clips: readonly string[] | undefined, table?: ClipRoleTable): ModelAnimationConfig | undefined;