import { Transform, type TransformCallback } from 'node:stream';
import { type BufferSource } from './common.js';
/** Compressor class */
declare class _Compressor {
    /** constructor */
    constructor(level: number);
    /** compress */
    data(data: Uint8Array, callback: (data: Buffer<ArrayBuffer>) => void): void;
    /** end */
    end(callback: (data: Buffer<ArrayBuffer>) => void): void;
}
/** Decompressor class */
declare class _Decompressor {
    /** constructor */
    constructor();
    /** decompress */
    data(data: Uint8Array, callback: (data: Buffer<ArrayBuffer>) => void): void;
    /** end */
    end(callback: (data: Buffer<ArrayBuffer>) => void): void;
}
/** node bindings */
interface Binding {
    /** compress */
    compress(data: Uint8Array, level: number): Buffer<ArrayBuffer>;
    /** compress_async */
    compress_async(data: Uint8Array, level: number, callback: (error: string | null, data: Buffer<ArrayBuffer> | null) => void): void;
    /** decompress */
    decompress(data: Uint8Array, maxSize: number): Buffer<ArrayBuffer>;
    /** decompress_async */
    decompress_async(data: Uint8Array, maxSize: number, callback: (error: string | null, data: Buffer<ArrayBuffer> | null) => void): void;
    /** Get zstd version */
    version: number;
    /** min compress level */
    minLevel: number;
    /** max compress level */
    maxLevel: number;
    /** default compress level */
    defaultLevel: number;
    /** recommended size for input buffer */
    compressInputLength: number;
    /** recommended size for output buffer */
    compressOutputLength: number;
    /** recommended size for input buffer */
    decompressInputLength: number;
    /** recommended size for output buffer */
    decompressOutputLength: number;
    /** Compressor class */
    Compressor: typeof _Compressor;
    /** Decompressor class */
    Decompressor: typeof _Decompressor;
}
/** NodeJs Transform stream Compressor/Decompressor */
declare abstract class CompressTransform extends Transform {
    protected readonly _type: 'Compressor' | 'Decompressor';
    protected _binding: _Compressor | _Decompressor | null;
    constructor(_type: 'Compressor' | 'Decompressor');
    /** Create napi binding object */
    protected abstract binding(): _Compressor | _Decompressor;
    /** @inheritdoc */
    _construct(callback: (error?: Error | null) => void): void;
    /** @inheritdoc */
    _transform(chunk: Buffer, encoding: BufferEncoding, callback: TransformCallback): void;
    /** @inheritdoc */
    _flush(callback: TransformCallback): void;
    /** @inheritdoc */
    _destroy(error: Error | null, callback: (error: Error | null) => void): void;
}
/** NodeJs Transform stream Compressor */
export declare class Compressor extends CompressTransform {
    private readonly _level;
    constructor(level?: number);
    /** @inheritdoc */
    protected binding(): _Compressor;
}
/** NodeJs Transform stream Decompressor */
export declare class Decompressor extends CompressTransform {
    constructor();
    /** @inheritdoc */
    protected binding(): _Compressor;
}
/** Web Transform stream Compressor/Decompressor */
declare abstract class WebCompressTransformer implements Transformer<BufferSource, Uint8Array<ArrayBuffer>> {
    protected _binding: _Compressor | _Decompressor | null;
    /** @inheritdoc */
    abstract start(controller: TransformStreamDefaultController<Uint8Array<ArrayBuffer>>): void;
    /** @inheritdoc */
    transform(chunk: BufferSource, controller: TransformStreamDefaultController<Uint8Array<ArrayBuffer>>): void;
    /** @inheritdoc */
    flush(controller: TransformStreamDefaultController<Uint8Array>): void;
}
/** Stream compressor */
export declare class WebCompressor extends WebCompressTransformer {
    readonly level: number;
    constructor(level: number);
    /** @inheritdoc */
    start(controller: TransformStreamDefaultController<Uint8Array<ArrayBuffer>>): void;
}
/** Stream decompressor */
export declare class WebDecompressor extends WebCompressTransformer {
    /** @inheritdoc */
    start(controller: TransformStreamDefaultController<Uint8Array<ArrayBuffer>>): void;
}
export declare const compressSync: (data: BufferSource, level?: number) => Uint8Array<ArrayBuffer>, compress: (data: BufferSource | Blob, level?: number) => Promise<Uint8Array<ArrayBuffer>>, decompressSync: (data: BufferSource) => Uint8Array<ArrayBuffer>, decompress: (data: BufferSource | Blob) => Promise<Uint8Array<ArrayBuffer>>, compressor: (level?: number) => globalThis.TransformStream<BufferSource, Uint8Array<ArrayBuffer>>, decompressor: () => globalThis.TransformStream<BufferSource, Uint8Array<ArrayBuffer>>;
export declare const ZSTD_VERSION: () => string;
export declare const TYPE = "napi";
export declare const _NapiBindings: Binding;
declare const _default: null;
export default _default;
//# sourceMappingURL=napi.d.ts.map