type OnGrowCallback = () => void; declare const alignToMask: (value: number, mask: number) => number; interface WasmWorkspaceOptions { alignMask: number; pageSize: number; } interface StagingBuffer { readonly pointer: number; write(data: Uint8Array): void; read(): Uint8Array; } interface WasmWorkspace { alloc(size: number, alignMask?: number): number; createStagingBuffer(size: number): StagingBuffer; } /** * Shared wasm workspace abstraction for encoder/decoder wrappers. * * Bundles the bump allocator with staging-buffer helpers so callers can allocate aligned regions and * maintain `Uint8Array` views that stay valid across `memory.grow()`. * * Should we introduce a different allocation strategy in the future, * we can swap it in here without touching consumers. */ declare function createWasmWorkspace(memory: WebAssembly.Memory, initialHeap: number, { alignMask, pageSize }: WasmWorkspaceOptions): WasmWorkspace; export { type OnGrowCallback, type StagingBuffer, type WasmWorkspace, type WasmWorkspaceOptions, alignToMask, createWasmWorkspace };