import { Parts } from './reading.js'; /** What the matcher needs from a reading. A stored reading has all of it. */ export interface Seen { /** Version of the id definition (`reading.v`). When both sides have one and they differ, the parts are not compared. */ v?: number | null; /** The stored id. It decides alone, with or without `c`, and counts only when it is a non-empty string on both sides. */ did: string | null; os: string; osVer: string | null; app: string; appVer: string | null; c: Parts; } export interface Match { /** * `same`: the stored id is equal. `likely`: the candidates that fit are one device, and it names the same model. * `unknown`: nothing decides. `different`: every candidate that could be compared contradicts the reading. */ result: 'same' | 'likely' | 'unknown' | 'different'; /** The rule that decided, for logs. */ rule: string; /** Index of the candidate that matched, or -1. */ index: number; } /** * Compares a reading with earlier ones. The stored id decides alone when it is equal, with or without parts and whatever the * id version; it counts only when it is a non-empty string on both sides. Without it, a candidate fits only when nothing * contradicts and both name the same model; candidates that fit but belong to several stored ids are a tie, and a tie is * `unknown`, never a guess. A candidate of another id version neither fits nor contradicts, and a candidate without parts is * not compared part by part; a `now` without parts gives `unknown`, `nothing to compare` unless its stored id decides. * A version that is not a string or a number counts as missing. It never throws on anything `JSON.parse` returns. * `likely` means "consistent and alone among these candidates": score with it, never ban on it. */ export declare function match(now: Seen, earlier: Seen[]): Match;