import type { DetectionRuntime, DetectionDevice } from '../types/config.js';
import type { EngineOutput } from '../types/engine-output.js';
import type { RawFrameFormat } from '../types/io.js';
/**
 * Discriminated input type for `IInferenceEngine.infer`. The engine
 * implementation picks the path based on `kind`:
 *
 * - `jpeg` — encoded JPEG bytes. Backwards-compatible path; the
 *           Python pool decodes via PIL before preprocess.
 * - `raw`  — packed pixel buffer (RGB / BGR / GRAY) with dimensions
 *           and format. Skips the JPEG decode entirely on the Python
 *           side; saves ~10–20ms/frame on the inference hot path.
 *
 * Engine implementations that cannot serve `raw` (e.g. legacy ONNX
 * runtimes that only accept JPEG) should fall back to encoding the
 * raw buffer to JPEG internally rather than throwing — `infer()` must
 * always succeed for either kind.
 */
export type InferenceInput = {
    readonly kind: 'jpeg';
    readonly data: Buffer;
} | {
    readonly kind: 'raw';
    readonly data: Buffer;
    readonly width: number;
    readonly height: number;
    readonly format: RawFrameFormat;
};
export interface IInferenceEngine {
    readonly runtime: DetectionRuntime;
    readonly device: DetectionDevice;
    infer(input: InferenceInput): Promise<EngineOutput>;
    /** Raw tensor run — optional, used by embeddings and other non-detection models */
    run?(input: Float32Array, inputShape: readonly number[]): Promise<Float32Array>;
    dispose(): Promise<void>;
}
//# sourceMappingURL=inference-engine.d.ts.map