/**
 * Render-time consumer of the interpolation log. Runs in {@link update} (the
 * variable-rate, render-loop-driven cycle): for every {@link Interpolated}
 * entity it blends each interpoland between the last two completed fixed ticks
 * by the current fixed-step alpha and writes the result into the live target
 * component (e.g. {@link Transform}). Because it writes the live component, all
 * Transform-linked machinery (culling, particles, trails, attachments) renders
 * the smoothed pose.
 *
 * Producers (physics, network) record authoritative per-tick snapshots into
 * {@link log}; this system only consumes. Cost is O(entities × interpolands),
 * and producers record only for things that moved, so the log stays sparse.
 *
 * For a LOCAL entity (the default), tick + alpha come from the simulation hub:
 * `entityManager.fixedStepTick` is the latest completed fixed step and
 * `entityManager.getFixedStepAlpha()` is the sub-step fraction, blending
 * `(fixedStepTick - 1, fixedStepTick)` from this system's own log.
 *
 * An entity may instead carry a non-default {@link Interpolated#sourceId} naming
 * a timeline registered via {@link registerSource} (the log + window provider
 * live on the system, not the component) — e.g. a networked entity blended on
 * the network's render-delayed playout. The same render pass then drives both
 * local and remote entities, so a mixed scene is coherent; each source is
 * sampled once per frame.
 *
 * @author Alex Goldring
 * @copyright Company Named Limited (c) 2026
 */
export class InterpolationSystem extends System<any, any, any, any, any> {
    /**
     * @param {{ buffer_capacity_bytes?: number, records_capacity?: number }} [options]
     */
    constructor({ buffer_capacity_bytes, records_capacity }?: {
        buffer_capacity_bytes?: number;
        records_capacity?: number;
    });
    dependencies: (typeof Interpolated)[];
    components_used: ResourceAccessSpecification<typeof Interpolated>[];
    /**
     * Shared per-tick snapshot store. Producers record into it; this system
     * blends from it.
     * @type {InterpolationLog}
     */
    log: InterpolationLog;
    /**
     * Linked entities → their {@link Interpolated} component. Iterated each
     * update.
     * @private
     * @type {Map<number, Interpolated>}
     */
    private __entities;
    /**
     * Reusable decode buffer for blended snapshots.
     * @private
     * @type {BinaryBuffer}
     */
    private __scratch;
    /**
     * Non-local timeline registry, keyed by `sourceId`. Each entry is the
     * timeline's `{ log, sample() }` — its log to read and a per-frame window
     * provider. Owners (e.g. the network layer) register here; the
     * {@link Interpolated} component only carries the integer id.
     * @private
     * @type {Map<number, { log: InterpolationLog, sample: () => { tick_a: number, tick_b: number, t: number } }>}
     */
    private __sources;
    /**
     * Per-update cache of `sourceId → window`, so a source's playout is
     * sampled once per frame, not once per entity. Cleared each update.
     * @private
     * @type {Map<number, { tick_a: number, tick_b: number, t: number }>}
     */
    private __source_windows;
    /**
     * Register a non-local interpolation timeline under `sourceId`. Entities
     * carrying that id on their {@link Interpolated} component are blended from
     * `log` on the window `sample()` returns (sampled once per render frame).
     * Used by timeline owners — e.g. the network layer registers its
     * render-delayed playout. `sourceId` must not be
     * {@link INTERPOLATION_SOURCE_LOCAL} (reserved for the local clock).
     *
     * @param {number} sourceId
     * @param {InterpolationLog} log
     * @param {() => { tick_a: number, tick_b: number, t: number }} sample
     */
    registerSource(sourceId: number, log: InterpolationLog, sample: () => {
        tick_a: number;
        tick_b: number;
        t: number;
    }): void;
    /**
     * @param {EntityManager} entityManager
     */
    startup(entityManager: EntityManager): Promise<void>;
    /**
     * @param {Interpolated} interpolated
     * @param {number} entity
     */
    link(interpolated: Interpolated, entity: number): void;
    /**
     * @param {Interpolated} interpolated
     * @param {number} entity
     */
    unlink(interpolated: Interpolated, entity: number): void;
    update(dt: any): void;
    /**
     * @readonly
     * @type {boolean}
     */
    readonly isInterpolationSystem: boolean;
}
import { System } from "../ecs/System.js";
import { Interpolated } from "./Interpolated.js";
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
import { InterpolationLog } from "./InterpolationLog.js";
//# sourceMappingURL=InterpolationSystem.d.ts.map