TypeScript API
Complete API reference for @quajs/qualix, @quajs/qualix/header, @quajs/qualix/web, @quajs/qualix/quack, and @quajs/qualix/cocos.
@quajs/qualix/header (Zero-WASM pure JS)
isQuaLix(input: ArrayBufferView | ArrayBuffer): boolean— Validates the 4-byte QLX signature (51 4C 58 07).inspectQuaLix(input: ArrayBufferView | ArrayBuffer): QuaLixHeaderInfo— Parses the 32-byte header without WASM; throws on an invalid signature or header field.colorCodeToProfile(code)/colorProfileToCode(color)— Converts wire byte codes1..3to'srgb8' | 'pq10' | 'hlg10'.- Constants:
QLX_MAGIC,QLX_FORMAT_VERSION,QLX_HEADER_SIZE = 32,QLX_MIME_TYPE = 'video/x-qualix',QLX_DEFAULT_BUDGET,QLX_ADAPTIVE_QUANTIZATION = 255.
@quajs/qualix (Inline WASM decoder)
loadQuaLixRuntime(): Promise<QuaLixRuntime>— Instantiates and caches the inlinequalix_decoder.wasmmodule (openand streamingopenReader).getQuaLixRuntimeSync(): QuaLixRuntime— Synchronous WASM instantiation for Node.js and Worker threads.openQuaLix(bytes: Uint8Array, budget?: number): Promise<QuaLixClipHandle>— Validates header and opens an in-memory QLX clip.decodeQuaLixFrame(bytes: Uint8Array, frameIndex?: number, budget?: number)— Decodes a single frame into an ownedUint8ClampedArrayand closes immediately.unpackRgb10A2ToRgba8(src, pixelCount, dst?)— Converts 10-bitR10G10B10A2pixels into 8-bitRGBA8for SDR canvas display.
TypeScriptexport interface QuaLixDecodedFrame { index: number width: number height: number color: 'srgb8' | 'pq10' | 'hlg10' pixels: Uint8Array // Borrowed view valid until next decode() or close() firstRow: number endRow: number toRgba8: (target?: Uint8ClampedArray) => Uint8ClampedArray}
@quajs/qualix/web (Browser playback & <video> adapter)
QuaLixCanvasPlayer.create(canvas, bytes, options?)— Binds WASM decoding to anHTMLCanvasElementwith dirty-row uploads, seek/loop/rate controls, and offscreen/hidden RAF pausing.attachQuaLixToVideoElement(video, bytes, options?)— Mounts.qlxplayback onto an existing<video>element (captureStream()+__quaQualixCanvascanvas snapshot support) with standard media properties and events.blitQuaLixFrameToCanvas(ctx, frame, scratch, fullBlit?)— Uploads[firstRow, endRow)incrementally withctx.putImageData.
@quajs/qualix/quack & @quajs/qualix/cocos
transcodeVideoBufferToQlx(input, ext?, options?),packVideoAssetsWithQuaLix(assets, options?),QuaLixPlugin— Node.js build-time transcoders and Quack plugin (preserves logical asset names and passes through muxed A/V containers unlessstripAudiois set).createQuaLixSpriteTexture(clip, createTexture, rgba8888FormatCode)— IncrementalTexture2Dframe uploader for Cocos Creator Web.