/** * The two values every layer here eventually has to spell out for a reader: how * big something is, and what went wrong. * * Both had copies. A size was formatted twice — the card dividing by 1024 and * labelling the result `KB`, the note beside it dividing by 1024 and labelling * it `KiB` — so one 25 MiB file read as two different sizes depending on which * surface you looked at. A failure was rendered in three byte-identical places. * A copy is exactly where a unit label drifts from the arithmetic under it, so * there is one of each here: binary steps with binary labels, in whichever voice * the reader is being addressed in. * @module dsh-lark-channel/format */ /** * A size at a glance: binary steps with the labels binary steps actually have, * one decimal once it leaves bytes, and no `.0` on a whole one. * * The unit for a raw count is the caller's, because that is the one word of this * that a reader reads in their own language — `字节` in the chat, `bytes` to the * model, `B` on a card. Everything above it needs no translation. * @param bytes - the count. * @param byteUnit - what a raw count is called. * @returns the short form, such as `1.2 MiB`, `840 KiB` or `12 B`. */ export declare function formatByteSize(bytes: number, byteUnit?: string): string; /** * A size for a human reading the chat. * @param bytes - the count. * @returns the Chinese-facing short form. */ export declare function formatBytesForChat(bytes: number): string; /** * A size for the model reading a tool error. * @param bytes - the count. * @returns the English short form. */ export declare function formatBytesForModel(bytes: number): string; /** * Render a handled failure as one readable detail. * @param error - the rejection value, which need not be an `Error`. * @returns the message, or the stringified value for a non-error rejection. */ export declare function failureDetail(error: unknown): string; //# sourceMappingURL=format.d.ts.map