/** * Domain types for @browsercore/profiles. * * Pure data: this package defines WHAT a browser fingerprint looks like, never * HOW to emit it on the wire. Protocol implementations (tls, http1, http2) read * these definitions and translate them into bytes / header order / settings frames. */ /** * Branded browser-profile identifier. * * Format: `"${name}-${version}"`, e.g. `"chrome-140"`, `"firefox-128"`. * Branding prevents passing an arbitrary string where a validated id is expected. * * @see createId for building a branded id from a name + version. */ export type ProfileId = string & { __brand: "ProfileId"; }; /** Known browser families. Discriminated-union literal set. */ export type ProfileName = "chrome" | "firefox" | "safari" | "edge"; /** * TLS-layer fingerprint: everything a ClientHello reveals about the client. * * Stored as human-readable strings (cipher names, group names) and integer * arrays (extension order). Translation to wire bytes happens in the protocol * layers via {@link cipherSuiteToWire} and the IANA code tables in {@link codes.ts}. */ export interface TlsProfile { /** Ordered list of offered cipher suites (IANA names). Order matters for fingerprinting. */ readonly cipherSuites: readonly string[]; /** Order of TLS extensions in the ClientHello. */ readonly extensionOrder: readonly number[]; /** Supported TLS versions, highest first. */ readonly supportedVersions: readonly string[]; /** Key-share groups offered (TLS 1.3). */ readonly keyShareGroups: readonly string[]; /** Signature algorithms offered. */ readonly signatureAlgorithms: readonly string[]; /** record_size_limit extension value, if advertised. Absent when not sent. */ readonly recordSizeLimit?: number; /** EC point formats offered. Chrome: [0x00 (uncompressed)]. */ readonly ecPointFormats?: readonly number[]; /** compress_certificate algorithms. Chrome: [0x02 (brotli)]. */ readonly compressCertificateAlgorithms?: readonly number[]; /** Record padding target in bytes. Chrome: 512. */ readonly recordPadding?: number; /** Whether this browser randomizes with GREASE values (RFC 8701). */ readonly grease: boolean; } /** * HTTP/2 SETTINGS + tuning parameters. * * Captures the values a client advertises in its initial SETTINGS frame and * the defaults it applies to stream priority / window sizing. */ export interface Http2Profile { /** HTTP/2 settings the client sends in its first SETTINGS frame. */ readonly settings: Partial; /** Initial TCP-level / stream window size in bytes. */ readonly initialWindowSize: number; /** SETTINGS_MAX_FRAME_SIZE advertised by the client. */ readonly maxFrameSize: number; /** SETTINGS_HEADER_TABLE_SIZE advertised by the client. */ readonly headerTableSize: number; /** Default stream weight (1-256). */ readonly weight: number; /** Default priority dependency / exclusive flag, if any. */ readonly priority?: Http2Priority; /** Wire order of SETTINGS ids (fingerprint signal). Chrome: [1, 2, 4, 6]. */ readonly settingsOrder?: readonly number[]; /** Whether to inject GREASE settings. Chrome: true. */ readonly grease?: boolean; /** Connection-level WINDOW_UPDATE value in preface. Chrome: 15663105. */ readonly connectionWindowUpdate?: number; /** Pseudo-header order. Chrome: ["method", "authority", "scheme", "path"]. */ readonly pseudoHeaderOrder?: readonly string[]; } /** * HTTP/2 numeric settings (RFC 9113 §6.5.1). * * These are the settings a client advertises in its SETTINGS frame; not every * browser sends all of them, so the type is used as `Partial` * in {@link Http2Profile}. */ export interface Http2Settings { readonly headerTableSize: number; readonly enablePush: boolean; readonly maxConcurrentStreams: number; readonly initialWindowSize: number; readonly maxFrameSize: number; readonly maxHeaderListSize: number; } /** HTTP/2 stream priority descriptor. */ export interface Http2Priority { readonly streamDependency: number; readonly exclusive: boolean; readonly weight: number; } /** * HTTP/1.1-layer fingerprint: header defaults and ordering. * * Models the headers a browser sends on every request and the order in which * it serializes them — both are fingerprint signals. */ export interface Http1Profile { /** Default headers sent on every request, in order. */ readonly defaultHeaders: Readonly>; /** Order in which headers are serialized (client-enforced). */ readonly headerOrder: readonly string[]; /** Connection header value. */ readonly connection: "keep-alive" | "close"; /** Accept-Encoding value sent by default. */ readonly acceptEncoding: string; } /** * A complete browser fingerprint across all layers. * * Pure data — no protocol logic, no Node imports. The `id` uniquely identifies * this profile in the registry. Higher layers read these definitions and * translate them into wire bytes / header order / settings frames. */ export interface BrowserProfile { readonly id: ProfileId; /** Human-readable browser name. */ readonly name: string; /** Browser version string (e.g. "140.0.7339.18"). */ readonly version: string; readonly tls: TlsProfile; readonly http2: Http2Profile; readonly http1: Http1Profile; } //# sourceMappingURL=types.d.ts.map