import type { Replacer } from "./replacer.js"; /** * The options that can be provided to {@link unescapeUnicode}. */ export interface Options { /** * A function that returns a replacement string for an individual escape character (i.e. the character immediately * following a backslash character) represented by a specific Unicode code point, if any. * * If an empty string is returned, the escape sequence will be removed from the returned string. If either `null` or * `undefined` are returned, the escape sequence will be included in the returned string as-is. * * This function is only passed `u` if not part of a valid Unicode escape sequence. * * If not specified, all non-Unicode escapes will be included in the returned string as-is. * * @see composeReplacer * @see replaceConstant * @see replaceChar * @see replaceChars * @see replaceCode * @see replaceCodes * @see replaceUnescaped */ replacer?: Replacer; } /** * Converts Unicode escapes within `input` to their corresponding characters. * * Characters that are not part of Unicode escapes are included in the returned string as-is. This includes invalid or * incomplete Unicode escapes (e.g. `\uxxxx`) and any other unrelated escape sequences (e.g. `\t`). This can be * controlled by specifying {@link Options#replacer}. * * Characters within the Basic Multilingual Plane (BMP) as well as surrogate pairs for characters outside BMP are * supported. * * @example Unescape all Unicode escapes * unescapeUnicode("I \\u2665 Unicode!"); * //=> "I ♥ Unicode!" * @example Unescape all Unicode escapes and tab escapes * unescapeUnicode("I\\t\\u2665\\tUnicode!", { replacer: replaceChars({ f: "\f", n: "\n", r: "\r", t: "\t" }) }); * //=> "I ♥ Unicode!" * @example Unescape all Unicode escapes for characters outside BMP * unescapeUnicode("\\ud842\\udfb7\\ud842\\udfbe"); * //=> "𠮷𠮾" * @param input The string containing the Unicode escapes to be converted. * @param options The options to be used. * @return A copy of `input` with the Unicode escapes replaced with their corresponding characters. */ export declare const unescapeUnicode: (input: string, options?: Options) => string; //# sourceMappingURL=unescape-unicode.d.ts.map