import { i as UnicodeVersionMetadata, n as UNICODE_STABLE_VERSION, r as UNICODE_VERSION_METADATA, t as UNICODE_DRAFT_VERSION } from "./constants-BclbCHPC.js"; import { _ as isMissingAnnotation, a as getBoundaryLineStyle, b as parseMissingAnnotation, c as inferVersion, d as isDashBoundary, f as isEOFMarker, g as isLineWithData, h as isHashBoundary, i as SpecialTag, l as isBoundaryLine, m as isEqualsBoundary, n as MissingAnnotation, o as getPropertyValue, p as isEmptyLine, r as ParsedFileName, s as inferFileName, t as BoundaryStyle, u as isCommentLine, v as isPropertyLine, x as trimCommentLine, y as parseFileNameLine } from "./line-helpers-DGsVuiW2.js"; import { d as RawDataFile } from "./datafile-UqVC4xXw.js"; //#region src/draft.d.ts interface GetCurrentDraftVersionOptions { /** * Custom URL to fetch the Unicode draft ReadMe from * @default "https://unicode-proxy.ucdjs.dev/draft/ReadMe.txt" */ url?: string; /** * Custom fetch options to use when fetching the ReadMe */ fetchOptions?: RequestInit; /** * Custom regex patterns to use for extracting the version * Each pattern must include exactly one capturing group that matches the version */ patterns?: RegExp[]; } /** * Retrieves the current Unicode Standard draft version by fetching and parsing * the Unicode draft ReadMe file. * * The function tries to extract the version number using several regex patterns, * starting with the most explicit match and falling back to less specific patterns. * * @param {GetCurrentDraftVersionOptions} options - Configuration options for the function * @returns {Promise} A promise that resolves to: * - The Unicode draft version as a string (e.g., "15.1.0" or "15.1") * - `null` if the version couldn't be determined or if an error occurred during fetching * * @example * ```ts * // Using default options * const version = await getCurrentDraftVersion(); * ``` * * @example * ```ts * // Using custom options * const version = await getCurrentDraftVersion({ * url: "https://luxass.dev/readme", * patterns: [/MyCustomPattern-(\d+\.\d+)/], * fetchOptions: { headers: { "Authorization": "token" } } * }); * ``` */ declare function getCurrentDraftVersion(options?: GetCurrentDraftVersionOptions): Promise; //#endregion //#region src/hexcodes.d.ts /** * Converts a hex string to an array of unicode codepoints. * * @param {string} hex - The hexadecimal string to convert * @param {string} joiner - The string that separates the hex values * @param {boolean} strict - If true, throws errors for invalid input. If false, returns NaN for invalid parts. * @returns {number[]} An array of numbers representing unicode codepoints * * @example * ```ts * fromHexToCodepoint('1F600-1F64F', '-') // [128512, 128591] * fromHexToCodepoint('1F600,1F64F', ',') // [128512, 128591] * fromHexToCodepoint('1F600-', '-', true) // throws Error * fromHexToCodepoint('1F600-', '-', false) // [128512, NaN] * ``` */ declare function fromHexToCodepoint(hex: string, joiner: string, strict?: boolean): number[]; /** * Expands a hexadecimal range into an array of individual hexadecimal values. * If the input contains ".." it treats it as a range and expands it, * otherwise returns the input hex as a single-element array. * * @param {string} hex - The hexadecimal string, optionally containing ".." to denote a range * @returns {string[]} An array of hexadecimal strings. If given a range (e.g. "0000..0010"), * returns all values in that range. If given a single hex value, * returns an array containing just that value. * * @example * ```ts * expandHexRange("0000..0002") // Returns ["0000", "0001", "0002"] * expandHexRange("0000") // Returns ["0000"] * ``` */ declare function expandHexRange(hex: string): string[]; /** * Removes specific unicode variation selectors from a hex string. * Specifically removes: * - 200D (Zero Width Joiner) * - FE0E (Variation Selector-15, text style) * - FE0F (Variation Selector-16, emoji style) * * @param {string} hex - The hex string to strip variation selectors from * @returns {string} The hex string with variation selectors removed */ declare function stripHex(hex: string): string; //#endregion //#region src/mappings.d.ts /** * Maps Unicode standard version numbers to their corresponding UCD (Unicode Character Database) version identifiers. * * The Unicode Character Database (UCD) files are available at https://unicode.org/Public/{version} * where {version} is not always the same as the Unicode standard version. * * For example: * - Unicode 4.0.1 corresponds to UCD version "4.0-Update1" * - Unicode 2.1.9 corresponds to UCD version "2.1-Update4" * * Note: Only versions with special UCD paths are included here. * Versions 4.1.0 and later use their version number directly as the UCD path. */ declare const UNICODE_TO_UCD_VERSION_MAPPINGS: Record; /** * Resolves a Unicode version to its corresponding UCD (Unicode Character Database) version identifier. * * Some Unicode versions don't have directly corresponding UCD version identifiers. For example, * Unicode 4.0.1's files are found using UCD version '4.0-Update1' * rather than '4.0.1'. * * If the version is not found in the mappings, returns the original version. * This is useful for handling newer Unicode versions that use the version number directly. * * @param {string} unicodeVersion - The Unicode version to resolve to a UCD version identifier * @returns {string} The corresponding UCD version identifier or the original version if not mapped */ declare function resolveUCDVersion(unicodeVersion: string): string; //#endregion //#region src/path.d.ts /** * Builds file paths for Unicode Character Database (UCD) files * * @param {string} version - The Unicode version (e.g., "15.1.0") * @param {string} path - The filename to access (e.g., "PropList.txt", "DerivedLineBreak.txt") * @returns {string} The complete file path for the UCD file */ declare function buildUCDPath(version: string, path: string): string; /** * Determines whether a Unicode version has the UCD folder structure. * * Newer Unicode versions typically use a UCD subfolder structure, while older versions * use special version formats (like '4.0-Update1' instead of '4.0.1') without UCD folders. * This function checks if a version: * 1. Contains "Update" in its name (indicating no UCD folder structure) * 2. Exists in our UNICODE_TO_UCD_VERSION_MAPPINGS (meaning it doesn't use UCD folders) * * @param {string} version - The Unicode version string to check * @returns {boolean} - Returns true if the version uses UCD folder structure (e.g., '15.0.0'), * false if it doesn't use UCD folders (e.g., '4.0.1' uses '4.0-Update1') */ declare function hasUCDFolderPath(version: string): boolean; //#endregion export { BoundaryStyle, type GetCurrentDraftVersionOptions, MissingAnnotation, ParsedFileName, RawDataFile, SpecialTag, UNICODE_DRAFT_VERSION, UNICODE_STABLE_VERSION, UNICODE_TO_UCD_VERSION_MAPPINGS, UNICODE_VERSION_METADATA, type UnicodeVersionMetadata, buildUCDPath, expandHexRange, fromHexToCodepoint, getBoundaryLineStyle, getCurrentDraftVersion, getPropertyValue, hasUCDFolderPath, inferFileName, inferVersion, isBoundaryLine, isCommentLine, isDashBoundary, isEOFMarker, isEmptyLine, isEqualsBoundary, isHashBoundary, isLineWithData, isMissingAnnotation, isPropertyLine, parseFileNameLine, parseMissingAnnotation, resolveUCDVersion, stripHex, trimCommentLine };