import type { IWasmTypedArray } from "./IWasmTypedArray";
import type { MmdWasmInstance } from "./mmdWasmInstance";
import type { TypedArray } from "./wasmTypedArray";
/**
 * Wasm two-buffered array for multi-threading
 */
export declare class WasmBufferedArray<T extends TypedArray> {
    private _frontBuffer;
    private _backBuffer;
    /**
     * Create a new wasm buffered array
     * @param frontBuffer Front buffer
     * @param backBuffer Back buffer
     */
    constructor(frontBuffer: IWasmTypedArray<T>, backBuffer?: IWasmTypedArray<T>);
    /**
     * Set back buffer
     *
     * This method should be called once before starting multi-threading
     * @param backBuffer Back buffer
     */
    setBackBuffer(backBuffer: IWasmTypedArray<T>): void;
    /**
     * Swap front and back buffers
     *
     * Span objects created from the front buffer will be automatically updated
     */
    swap(): void;
    /**
     * Get front buffer
     */
    get frontBuffer(): T;
    /**
     * Get back buffer
     */
    get backBuffer(): T;
}
/**
 * Wasm two-buffered array span for multi-threading
 */
export declare class WasmBufferedArraySpan<T extends TypedArray> {
    private readonly _data;
    private _frontBufferPtr;
    private _frontBufferSpan;
    private _backBufferSpan;
    /**
     * Create a new wasm buffered array span
     * @param wasmInstance MMD WASM instance
     * @param data Wasm buffered array
     * @param byteOffset Byte offset relative to the buffer
     * @param length Length of the span
     */
    constructor(wasmInstance: MmdWasmInstance, data: WasmBufferedArray<T>, byteOffset: number, length: number);
    /**
     * Update back buffer reference
     *
     * This method should be called once before starting multi-threading when the back buffer is not initialized
     * @param wasmInstance MMD WASM instance
     */
    updateBackBufferReference(wasmInstance: MmdWasmInstance): void;
    /**
     * Get front buffer span
     */
    get array(): T;
}
