/**
 * Character set handling utilities
 * Provides functions for detecting, validating, and converting character sets
 */
import { EncodingError } from './text-encoder.js';
export { EncodingError };
export type CharsetName = 'utf-8' | 'utf-16' | 'utf-16le' | 'utf-16be' | 'ascii' | 'latin1' | 'iso-8859-1';
export interface CharsetInfo {
    name: CharsetName;
    confidence: number;
    hasBOM: boolean;
}
/**
 * Detect the character set of a byte array
 * @param bytes - The byte array to analyze
 * @returns Charset detection result
 */
export declare function detectCharset(bytes: Uint8Array): CharsetInfo;
/**
 * Validate if a string contains only ASCII characters
 * @param input - The string to validate
 * @returns true if ASCII-only, false otherwise
 */
export declare function isAscii(input: string): boolean;
/**
 * Validate if a string contains only printable ASCII characters
 * @param input - The string to validate
 * @returns true if printable ASCII-only, false otherwise
 */
export declare function isPrintableAscii(input: string): boolean;
/**
 * Validate if a byte array is valid UTF-8
 * @param bytes - The byte array to validate
 * @returns true if valid UTF-8, false otherwise
 */
export declare function isValidUtf8(bytes: Uint8Array): boolean;
/**
 * Remove BOM (Byte Order Mark) from a byte array
 * @param bytes - The byte array to process
 * @returns Byte array without BOM
 */
export declare function removeBOM(bytes: Uint8Array): Uint8Array;
/**
 * Add UTF-8 BOM to a byte array
 * @param bytes - The byte array to process
 * @returns Byte array with UTF-8 BOM prepended
 */
export declare function addUtf8BOM(bytes: Uint8Array): Uint8Array;
/**
 * Normalize line endings to a specified format
 * @param input - The string to normalize
 * @param format - The target line ending format ('lf', 'crlf', 'cr')
 * @returns String with normalized line endings
 */
export declare function normalizeLineEndings(input: string, format?: 'lf' | 'crlf' | 'cr'): string;
/**
 * Detect the line ending format used in a string
 * @param input - The string to analyze
 * @returns The detected line ending format
 */
export declare function detectLineEndings(input: string): 'lf' | 'crlf' | 'cr' | 'mixed' | 'none';
/**
 * Convert string from one charset to another
 * @param input - The string to convert
 * @param fromCharset - Source charset
 * @param toCharset - Target charset
 * @returns Converted string
 */
export declare function convertCharset(input: string | Uint8Array, fromCharset: CharsetName, toCharset: CharsetName): string;
/**
 * Get byte length of a string in a specific encoding
 * @param input - The string to measure
 * @param charset - The target charset
 * @returns Byte length
 */
export declare function getByteLength(input: string, charset?: CharsetName): number;
/**
 * Replace invalid characters in a string for a target charset
 * @param input - The string to sanitize
 * @param charset - The target charset
 * @param replacement - The replacement character (default: '?')
 * @returns Sanitized string
 */
export declare function sanitizeForCharset(input: string, charset: CharsetName, replacement?: string): string;
/**
 * Check if a string can be encoded in a specific charset without data loss
 * @param input - The string to check
 * @param charset - The target charset
 * @returns true if encodable without loss, false otherwise
 */
export declare function canEncodeAs(input: string, charset: CharsetName): boolean;
/**
 * Get unicode code points from a string
 * @param input - The string to analyze
 * @returns Array of code points
 */
export declare function getCodePoints(input: string): number[];
/**
 * Create a string from unicode code points
 * @param codePoints - Array of code points
 * @returns Resulting string
 */
export declare function fromCodePoints(codePoints: number[]): string;
