import * as THREE from 'three'; import type { App, AppOptions } from '../core/app.js'; import type { StateSource } from '../state/controller.js'; import type { Vec3Tuple } from '../camera/targets.js'; import type { Disposable } from '../types.js'; /** Options for {@link createTppScaffold}: `AppOptions` minus orbit/state, plus the chase target and follow-camera tuning. */ export interface TppScaffoldOptions extends Omit, 'orbit' | 'state'> { state?: StateSource; /** Object to chase; can also be set later with setTarget. */ target?: THREE.Object3D; /** Camera offset in the target's local frame. Default [0, 3, -6]. */ offset?: Vec3Tuple; /** Look-at point offset ahead of the target. Default [0, 1, 4]. */ lookAhead?: Vec3Tuple; stiffness?: number; rotationStiffness?: number; } /** Handle returned by {@link createTppScaffold}. `setTarget(null)` stops following; `dispose()` detaches the state binding and disposes the app. */ export interface TppScaffold extends Disposable { app: App; setTarget(target: THREE.Object3D | null): void; } /** * Third-person scaffold: `createApp` with the built-in orbit disabled and a * framerate-independent follow camera chasing a target. Swap what is being * chased at runtime with `setTarget` — drive the target's transform from your * modules (state → target → camera, one direction). * * @param options - State source, chase `target`, local-frame `offset` and * `lookAhead`, damping stiffness, and the remaining `AppOptions`. * @returns A {@link TppScaffold} with the app and `setTarget`. * @remarks The follow update is three scratch vectors per frame, zero * allocation. * @example * const tpp = createTppScaffold({ canvas, target: hero, offset: [0, 4, -8] }) * tpp.app.start() */ export declare function createTppScaffold>({ state, target, offset, lookAhead, stiffness, rotationStiffness, ...appOptions }: TppScaffoldOptions): TppScaffold; //# sourceMappingURL=tpp.d.ts.map