/** * The options that can be provided to {@link native2ascii}. */ export interface Options { /** * Whether the reverse the conversion. * * If not specified, defaults to `false`. */ reverse?: boolean; } /** * Converts characters within `input` so that it can be encoded in ASCII by using Unicode escapes ("\uxxxx" notation) * for all characters that are not part of the ASCII character set. * * This can be useful when dealing with `.properties` files and characters that are not in the ISO-8859-1 character set. * * {@link Options#reverse} can be specified to reverse the conversion and instead convert Unicode escapes to their * corresponding Unicode characters. * * Characters within the Basic Multilingual Plane (BMP) as well as surrogate pairs for characters outside BMP are * supported. * * @example Escape only non-ASCII characters * native2ascii("I ♥ Unicode!"); * //=> "I \\u2665 Unicode!" * @example Escape characters outside BMP * native2ascii("𠮷𠮾"); * //=> "\\ud842\\udfb7\\ud842\\udfbe" * @example Unescape all Unicode escapes * native2ascii("I \\u2665 Unicode!", { reverse: true }); * //=> "I ♥ Unicode!" * @example Unescape all Unicode escapes for characters outside BMP * native2ascii("\\ud842\\udfb7\\ud842\\udfbe", { reverse: true }); * //=> "𠮷𠮾" * @param input The string to be converted. * @param options The options to be used. * @return A copy of `input` with the appropriate characters replaced with Unicode escapes (or vice versa if reversed). */ export declare const native2ascii: (input: string, options?: Options) => string; //# sourceMappingURL=native2ascii.d.ts.map