import type { PlayerMovementConfig } from "../game/playableGame.js"; import type { PhysicsConfig } from "../game/defineGame.js"; import type { ParamSchema } from "../scene/sceneKinds.js"; import type { EditorCatalogData } from "./types.js"; /** Numeric character controls a game elects to author through its own named catalog rows. */ export interface AuthoredMovementValues { walkSpeed?: number; gravity?: number; jumpVelocity?: number; stepHeight?: number; /** Optional positive heightfield collision span from feet; independent of model and camera scale. */ collisionHeight?: number; /** Optional heightfield rise/run limit; omitted controls retain the game's movement policy. */ maxClimbGrade?: number; groundAcceleration?: number; airAcceleration?: number; groundFriction?: number; runMultiplier?: number; crouchMultiplier?: number; jumpBufferMs?: number; coyoteMs?: number; /** Rising speed retained on early jump release, from 0 to 1. */ jumpCutFactor?: number; apexGravityScale?: number; apexSpeed?: number; fallGravityScale?: number; landingRecoveryMs?: number; /** Initial landing speed multiplier; values above 1 retain the existing runtime contract. */ landingSpeedScale?: number; } /** Only authored values, ready to overlay on a game's existing movement and physics policy. */ export interface AuthoredMovementConfig { readonly walkSpeed?: number; readonly physics?: { readonly gravity?: number; readonly jumpVelocity?: number; }; readonly movement?: Pick; } /** A persisted movement value rejected before it can replace the game's current setting. */ export interface AuthoredMovementDiagnostic { readonly path: string; readonly message: string; readonly repair: string; } /** Valid partial tuning plus located rejected values; absent rows leave game defaults intact. */ export interface AuthoredMovementResult { readonly config: AuthoredMovementConfig; readonly diagnostics: readonly AuthoredMovementDiagnostic[]; } /** Structural authored catalog input; an immutable EditorDocument satisfies it. */ export interface MovementCatalogDocumentLike { readonly catalogs: readonly EditorCatalogData[]; } /** Game-owned callbacks, collision and physics settings retained beneath authored numeric controls. */ export interface AuthoredMovementDefaults { readonly movement?: PlayerMovementConfig; readonly physics?: PhysicsConfig; } /** Stable runtime objects whose numeric getters resolve the current authored document. */ export interface AuthoredMovementBinding { readonly movement: PlayerMovementConfig; readonly physics: PhysicsConfig; readonly diagnostics: readonly AuthoredMovementDiagnostic[]; } /** * Creates editor/RPC controls only for the values a game supplies, with those game's defaults. * Gravity retains the game's sign convention; collision height is positive, other controls nonnegative. * Jump release is bounded to 0..1; supplied deeper jump controls share a collapsed response group. * @capability editor-movement author game-chosen character movement controls through ordinary catalog rows */ export declare function createMovementSchema(defaults: AuthoredMovementValues): ParamSchema; /** * Reads one game-named row as partial runtime tuning, retaining game defaults for omitted or invalid * values. Rejected values include their document path and repair; no policy callbacks are replaced. * @capability editor-movement resolve saved movement controls without replacing a game's character rules */ export declare function readAuthoredMovement(document: MovementCatalogDocumentLike, catalogId: string, entryId: string): AuthoredMovementResult; /** * Memoizes movement resolution by immutable document identity; reads the latest document on every * call while catalog lookup and diagnostics run only after authoring changes. * @capability editor-movement consume live saved movement tuning with bounded per-frame work */ export declare function createAuthoredMovementReader(getDocument: () => MovementCatalogDocumentLike, catalogId: string, entryId: string): () => AuthoredMovementResult; /** * Binds live authored numeric controls onto stable runtime objects, preserving the game's callbacks, * collision, backend and other policy. The movement controller reads these getters each step. * @capability editor-movement bind live character tuning while preserving distinctive game policy */ export declare function bindAuthoredMovement(read: () => AuthoredMovementResult, defaults: AuthoredMovementDefaults): AuthoredMovementBinding;