export type TextureRole = 'color' | 'data' | 'normal'; /** ETC1S quality (1..255). 160 keeps flat albedo clean without the size of the top setting. */ export declare const ETC1S_QUALITY = 160; export declare function decodeToRgba(bytes: Uint8Array): Promise<{ data: Uint8Array; width: number; height: number; }>; export declare function encodeKtx2(rgba: Uint8Array, width: number, height: number, role: TextureRole): Promise; export interface Ktx2Header { codec: 'etc1s' | 'uastc' | 'other'; /** Colour space the file declares in its data format descriptor. */ srgb: boolean; width: number; height: number; levels: number; supercompression: number; } /** The fields of a Basis KTX2 file that decide how it may be re-encoded. Throws on anything that is not a KTX2 file. */ export declare function readKtx2Header(bytes: Uint8Array): Ktx2Header; /** Decode the top mip of a Basis KTX2 file to RGBA8 the way a GPU-less transcode sees it. */ export declare function decodeKtx2ToRgba(bytes: Uint8Array): Promise<{ data: Uint8Array; width: number; height: number; }>; export interface Ktx2EncodeOptions { codec: 'etc1s' | 'uastc'; srgb: boolean; /** ETC1S quality 1-255 (default ETC1S_QUALITY). */ quality?: number; /** UASTC RDO quality scalar (basis `-uastc_rdo_l`, higher = smaller and lossier); omitted or 0 = off. */ rdo?: number; } /** Encode RGBA8 to a mipmapped Basis KTX2 file with an explicit codec and colour space (the split itself uses encodeKtx2). */ export declare function encodeKtx2Rgba(rgba: Uint8Array, width: number, height: number, options: Ktx2EncodeOptions): Promise;