UNPKG

subtexty

Version:

Extract clean plain-text from subtitle files

46 lines 1.81 kB
/** * Application constants and configuration values */ export declare const ENCODING: { /** Unicode replacement character used to detect encoding issues */ readonly REPLACEMENT_CHAR: "�"; /** Fallback encodings to try when auto-detection fails */ readonly FALLBACK_ENCODINGS: readonly ["utf8", "latin1", "ascii"]; /** Default encoding for file operations */ readonly DEFAULT: "utf8"; }; export declare const PARSING: { /** Minimum number of lines required for a valid SRT block */ readonly MIN_SRT_LINES: 3; /** WebVTT file header identifier */ readonly WEBVTT_HEADER: "WEBVTT"; /** SBV timing line pattern */ readonly SBV_TIMING_PATTERN: RegExp; }; export declare const EXIT_CODES: { /** Successful operation */ readonly SUCCESS: 0; /** File-related error (not found, permissions, etc.) */ readonly FILE_ERROR: 1; /** Parsing or format error */ readonly PARSING_ERROR: 2; }; export declare const ERROR_MESSAGES: { readonly FILE_NOT_FOUND: (path: string) => string; readonly CANNOT_READ_FILE: (path: string) => string; readonly UNSUPPORTED_FORMAT: (ext: string) => string; readonly INVALID_VTT_FORMAT: "Invalid VTT format: missing WEBVTT header"; readonly INVALID_JSON3_FORMAT: (details: string) => string; readonly OUTPUT_DIR_NOT_EXIST: (dir: string) => string; readonly FAILED_TO_WRITE: (path: string) => string; readonly INPUT_FILE_REQUIRED: "Input file is required"; }; export declare const REGEX_PATTERNS: { /** HTML/XML tag removal pattern */ readonly HTML_TAGS: RegExp; /** TTML paragraph tag extraction pattern */ readonly TTML_PARAGRAPH: RegExp; /** Multiple whitespace normalization pattern */ readonly WHITESPACE: RegExp; }; //# sourceMappingURL=constants.d.ts.map