/** A maximal run of ASCII digits. */ export interface DigitRun { start: number; end: number; } export interface Anchors { /** Every '@' — the only place an e-mail can be. */ atSigns: number[]; /** Every maximal digit run, in order. */ digitRuns: DigitRun[]; /** Every ':' — IPv6 and nothing else here. */ colons: number[]; } export declare function scan(text: string): Anchors; /** * A run of digits written with the punctuation humans put in numbers. * * Phone numbers, card numbers and tax ids are the same object at this stage — * a group of digits with separators — and telling them apart is the * recognizers' job, not the scanner's. Building the cluster once is what lets * three recognizers disagree about the same span cheaply, which is exactly the * situation `resolve()` exists to settle. */ export interface DigitCluster { /** Span in the original text, punctuation included, edges trimmed. */ start: number; end: number; /** Just the digits, in order. */ digits: string; /** The length of each digit group — `[3, 2, 2, 2]` for `030 12 34 56`. */ groups: number[]; /** A leading `+`, which is the strongest single hint a number is a phone. */ plus: boolean; /** The raw slice, for date-shaped rejections and for reporting. */ raw: string; } /** Shared with the recognizers: one definition, so the edge rules agree. */ export declare const ALNUM: RegExp; /** * Merge digit runs that are separated by a little punctuation into clusters. * * The gap limit is what keeps `12 34` together and `1234, aber 5678` apart, and * the alphanumeric edge check is what keeps `abc123` from being read as a * number at all — it is an identifier, and treating its tail as a phone number * is the classic way these detectors embarrass themselves. */ export declare function clusters(text: string, runs: readonly DigitRun[]): DigitCluster[]; //# sourceMappingURL=scan.d.ts.map