/** Fresh each time, because a `g` flag carries `lastIndex` between calls. */ export declare function unprintablePattern(flags?: string): RegExp; /** * Text with every byte a terminal would act on shown as its escape instead. * * Lived in `cli/report.ts` until 0.8.92, where only the command line could reach it — and the * messages the *library* builds interpolate the same untrusted text: a path out of the * filesystem, a `--channels` term, an output directory. Those reach the terminal through * `printableLines`, which splits a message on its own line breaks before escaping each line, * so every control byte was escaped except the one that makes a line break. A newline in a * path cut the refusal's first line in half: * * error: Cannot read "nl/no * such.edf": no such file. * * and that first line is the one this tool's own comments insist stays whole, because it is * the line a log gets grepped for. */ export declare function printable(text: string): string; /** * One character as its escape. * * `\x` is two digits and `\u` is four, so the wide ones take `\u`: a reader who counts the * digits of `\x202e` finds a different character. */ export declare function escapeCharacter(character: string): string; /** * A JSON document with the class escaped, so printing one cannot drive a terminal. * * `JSON.stringify` escapes U+0000 to U+001F because JSON requires it, and leaves everything * else as itself — so the two JSON surfaces carried what the text ones escape. `--info` prints * a path through `printable`, on the reasoning its own comment gives ("a path is untrusted * text: a folder may be named with an ESC byte"); `--info --json` and `metadata.json` printed * the same path raw, and a recording named `sleep-` with an override before `fdp.edf` reordered * the line under `jq`, under `cat metadata.json`, and in whatever log the document was piped to. * * Free, unlike the CSV case. A `\uXXXX` escape is the same string to `JSON.parse`, so no * consumer sees a different value — which is why this is not the trade `FORMULA_LABEL` and * `NONPRINTABLE_LABEL` describe, where rewriting the cell would mean the CSV no longer says * what the recording says. * * Not through `escapeCharacter`, whose `\xNN` form is what a person reads and is not JSON. */ export declare function escapeJsonText(json: string): string; /** Every distinct unprintable character in `text`, in the order they first appear. */ export declare function unprintableIn(text: string): string[];