/** * How long a log message may be once it reaches a consumer. * * A log event is one line by contract, and almost every message in the sync * path interpolates something a peer or the server chose. Those are bounded * individually -- a deviceId, a deviceType and a deviceFriendlyName are 256 * characters each -- but several of them land in the same sentence, so the cap * is what keeps one hostile record from turning a single notice into a * screenful the real message scrolls off the top of. */ export declare const MAX_LOG_MESSAGE_LENGTH = 1024; /** * Whether a string holds anything that had to be removed before printing. * * Separate from `sanitiseForDisplay` rather than a second return value, * because the two answer different questions: one produces the string to show, * the other is evidence about whoever sent it. Truncation and whitespace * collapsing are deliberately not unsafe -- a long name is ordinary. * @param value - The string to examine. * @returns True when the string contains something that must not be printed. */ export declare const containsUnsafeText: (value: string) => boolean; /** * Reduces a string that may have come from a peer to something safe to print. * * Sanitising, not escaping: a consumer may write this straight to a terminal, * and there is no one escaping convention that is right for a terminal, a * devtools console and a JSON document at once. Nothing removed here can be * part of a name or a message a user meant to read. * @param value - The string to clean. * @param maxLength - The longest the result may be, ellipsis included. * @returns The cleaned string, no longer than `maxLength`. */ export declare const sanitiseForDisplay: (value: string, maxLength: number) => string;