///
import { Buffer } from 'safer-buffer';
import { BinaryBuffer, BinaryBufferReadableStream, BinaryBufferReadable } from './buffer';
import { UTF8_with_bom, UTF16be, UTF16le } from './encodings';
import { ReadableStream, Readable } from './stream';
export interface ResourceEncoding {
encoding: string;
hasBOM: boolean;
}
export interface DetectedEncoding {
encoding?: string;
seemsBinary?: boolean;
}
export interface DecodeStreamOptions {
guessEncoding?: boolean;
minBytesRequiredForDetection?: number;
overwriteEncoding(detectedEncoding: string | undefined): Promise;
}
export interface DecodeStreamResult {
stream: ReadableStream;
detected: DetectedEncoding;
}
export declare class EncodingService {
encode(value: string, options?: ResourceEncoding): BinaryBuffer;
decode(value: BinaryBuffer, encoding?: string): string;
exists(encoding: string): boolean;
toIconvEncoding(encoding?: string): string;
toResourceEncoding(encoding: string, options: {
overwriteEncoding?: boolean;
read: (length: number) => Promise;
}): Promise;
detectEncoding(data: BinaryBuffer, autoGuessEncoding?: boolean): Promise;
protected detectEncodingByBOMFromBuffer(buffer: Buffer, bytesRead: number): typeof UTF8_with_bom | typeof UTF16le | typeof UTF16be | undefined;
protected guessEncodingByBuffer(buffer: Buffer): Promise;
decodeStream(source: BinaryBufferReadableStream, options: DecodeStreamOptions): Promise;
encodeStream(value: string | Readable, options?: ResourceEncoding): Promise;
encodeStream(value?: string | Readable, options?: ResourceEncoding): Promise;
}
//# sourceMappingURL=encoding-service.d.ts.map