/** * Profile diff utility. * * Walks two {@link BrowserProfile} objects field-by-field and reports every * differing path. This is how we detect fingerprint drift between two profile * versions, or between a profile and a real capture. * * Array comparison is order-sensitive by default — cipher suite order is itself * a fingerprint signal, so reordering must surface as a diff. */ import type { BrowserProfile } from "./types.js"; /** Options controlling how profiles are compared. */ export interface DiffOptions { /** * When true (the default), arrays are compared element-by-element in order. * When false, arrays are compared as multisets (order is ignored). * * @defaultValue true */ readonly compareArrayOrder?: boolean; } /** * A single difference between two profiles, located by its dotted path. * * Produced by {@link diffProfiles}. `a` and `b` hold the differing values from * the left- and right-hand profiles; one may be `undefined` when the path exists * in only one profile. */ export interface ProfileDiff { /** Dotted path to the differing field, e.g. "tls.cipherSuites[3]". */ readonly path: string; /** Value in the left-hand profile. */ readonly a: unknown; /** Value in the right-hand profile. */ readonly b: unknown; } /** * Deep, field-by-field diff of two browser profiles. * * Returns a {@link ProfileDiff} for every differing path. The result is empty * when the profiles are structurally equal. Array comparison is order-sensitive * by default; pass `{ compareArrayOrder: false }` to ignore element order. * * @param a - The left-hand (expected/older) profile. * @param b - The right-hand (actual/newer) profile. * @param options - Controls array comparison behavior. Defaults to `{ compareArrayOrder: true }`. * @returns An array of {@link ProfileDiff} entries, one per differing path. * * @example * ```ts * const diffs = diffProfiles(chrome140, chrome141); * for (const d of diffs) { * console.log(`${d.path}: ${d.a} -> ${d.b}`); * } * // => "tls.cipherSuites[5]: TLS_OLD -> TLS_NEW" * ``` * * @since 0.1.0 */ export declare function diffProfiles(a: BrowserProfile, b: BrowserProfile, options?: DiffOptions): ProfileDiff[]; //# sourceMappingURL=diff.d.ts.map