import { IOResult, type ByteSource } from '../../../io/types.ts'; import type { PathSpec } from '../../../types.ts'; import type { CommandOpts } from '../../config.ts'; /** * One GNU `cmp` byte count read the way xstrtoumax reads it. * * Base 0, so `010` is 8 and `0x400` is 1024; one leading `+` and * leading whitespace are allowed; the remainder is a size suffix from * cmp's own letter set. Every rejection -- unparsable digits, unknown * suffix, or a product past INTMAX -- is the same usage error naming * the long option, not a crash and not od's "too large". * * `shown` overrides the spelling named in the diagnostic: GNU prints * the operand from the position it was reading, so a bad `SKIP1` names * the whole `SKIP1:SKIP2` pair while a bad `SKIP2` names only itself. * * The accept/reject boundary is computed in BigInt and so is exact, but * the returned count is a double like od's: above 2**53 it is the * nearest representable value, not python's exact integer. The count is * only ever a slice bound, and no file reaches an exabyte, so the two * runtimes still compare the same bytes. */ export declare function parseCount(raw: string, option: string, shown?: string): number; /** * The `-i` operand as one skip per file. * * GNU takes `SKIP` for both files or `SKIP1:SKIP2` for one each, so * `-i 0:3` compares all of the first file against the fourth byte * onward of the second. A colon is the only place the first count may * stop, which is why `1b:1` is rejected naming the whole pair while * `1:1b` is rejected naming just `1b`. */ export declare function parseSkip(raw: string): [number, number]; /** * One byte rendered the way GNU `cmp -b` renders it. * * The cat -v alphabet: a control byte becomes `^X` (so tab is `^I`, * unlike `cat -v` itself), DEL becomes `^?`, and a high byte becomes * `M-` followed by the same rules on its low seven bits. */ export declare function visible(byte: number): string; export declare function cmpGeneric(paths: PathSpec[], opts: CommandOpts, stream: (p: PathSpec) => AsyncIterable): Promise<[ByteSource | null, IOResult]>; //# sourceMappingURL=cmp.d.ts.map