<commit_before>// Type definitions for iltorb 2.0
// Project: https://github.com/MayhemYDG/iltorb
// Definitions by: <NAME> <https://github.com/Alorel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node"/>

import { Transform } from 'stream';

export interface BrotliEncodeParams {
    disable_literal_context_modeling?: boolean;
    lgblock?: number;
    lgwin?: number;
    mode?: number;
    quality?: number;
    size_hint?: number;
}

export type IltorbCallback = (err: Error | null | undefined, output: Buffer) => any;

export function compress(buffer: Buffer, options: BrotliEncodeParams, callback: IltorbCallback): void;
export function compress(buffer: Buffer, callback: IltorbCallback): void;

export function decompress(buffer: Buffer, callback: IltorbCallback): void;

export function compressSync(buffer: Buffer, options?: BrotliEncodeParams): Buffer;
export function decompressSync(buffer: Buffer): Buffer;

export function compressStream(options?: BrotliEncodeParams): Transform;
export function decompressStream(): Transform;<commit_msg>iltorb callback return type set to void<commit_after>// Type definitions for iltorb 2.0
// Project: https://github.com/MayhemYDG/iltorb
// Definitions by: <NAME> <https://github.com/Alorel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node"/>

import { Transform } from 'stream';

export interface BrotliEncodeParams {
    disable_literal_context_modeling?: boolean;
    lgblock?: number;
    lgwin?: number;
    mode?: number;
    quality?: number;
    size_hint?: number;
}

export type IltorbCallback = (err: Error | null | undefined, output: Buffer) => void;

export function compress(buffer: Buffer, options: BrotliEncodeParams, callback: IltorbCallback): void;
export function compress(buffer: Buffer, callback: IltorbCallback): void;

export function decompress(buffer: Buffer, callback: IltorbCallback): void;

export function compressSync(buffer: Buffer, options?: BrotliEncodeParams): Buffer;
export function decompressSync(buffer: Buffer): Buffer;

export function compressStream(options?: BrotliEncodeParams): Transform;
export function decompressStream(): Transform;
{'fraction_non_alphanumeric': 0.11436289959477713, 'fraction_numerical': 0.0018009905447996398, 'mean_word_length': 5.836923076923077, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6309467', 'n_tokens_mistral': 624, 'n_tokens_neox': 610, 'n_words': 183}