/** * Text the instance wrote, fit for a model. * * A pad, a user name and the editor language are typed by whoever has the * pad open, and the WebSocket frames that carry them are JSON from whatever * `RUSTPAD_URL` points at. Two things in such a string are not content: * * - C0 and C1 control characters and DEL. `ESC[1A` moves a terminal cursor, * a NUL splits a C string, and none of them is something a person typed * into a pad on purpose. Tab, LF and CR stay — a pad is lines of text. * Format characters (bidi marks, joiners) stay too: they are content in * text that is not English, and a model reads them as such. * - A lone surrogate. `"\ud800"` is legal JSON, `JSON.parse` turns it into a * string no UTF-8 encoder accepts, and a client written in Python raises * `UnicodeEncodeError` on the whole result. A `slice` can make one out of a * well-formed string by cutting a pair in half, which is why the * replacement runs after the cut. */ /** * Strips control characters, cuts at `max` UTF-16 units where given, and * replaces every lone surrogate with U+FFFD — in that order, so the cut cannot * reintroduce what the last step removes. */ export declare function cleanText(value: string, max?: number): string; /** * A configuration value described for a log line: quoted only when it is * short and printable ASCII, otherwise by its length. The variable next to a * secret is where a secret gets pasted, and "got ''" is how it reaches * the log. */ export declare function describeValue(raw: string | undefined): string;