/** * License key validation: pure, dependency-free, synchronous. * * This is a re-implementation of the issuer's scheme * (`dockview-licencing/src/lib/{checksum,licence}.ts`) so `dockview-enterprise` * can verify a key entirely offline. It must stay byte-compatible with the * issuer; the cross-repo golden fixture in the spec (a real minted key) is * the guard against drift. * * The checksum is an FNV-1a integrity guard, not a signature: the whole scheme * is public and forgeable by design. The watermark is the enforcement, not the * key. See `enterprise-modules/license.md`. */ export type LicenseState = 'valid' | 'expired' | 'invalid' | 'missing'; export interface ParsedLicense { keyId: string; company: string; plan: string; appName: string; email: string; validFrom: Date | null; validUntil: Date | null; /** Every `[Key:Value]` segment, verbatim (post-sanitisation). */ fields: Record; } /** * FNV-1a 64-bit, 16 lowercase hex chars. Byte-identical to the issuer's * `licenceChecksum` (which uses BigInt), but computed here with two 32-bit * halves because this package targets < ES2020, where BigInt literals are * unavailable. Empty input returns the offset basis ("cbf29ce484222325"). * * Prime 0x100000001b3 = (0x100 << 32) | 0x1b3. All intermediate products stay * below 2^53, so `Number` arithmetic is exact and the result matches BigInt. */ export declare function fnv1a(input: string): string; /** * Parse + integrity-check a key. Returns the parsed license, or `null` if the * key is malformed, truncated, or its checksum doesn't match the body. */ export declare function parseLicenseKey(key: string): ParsedLicense | null; /** * Validate a key against the running dockview build's `releaseDate` (injected, * so the result is deterministic and testable; the service passes the baked-in * `DOCKVIEW_RELEASE_DATE`). * * Enforcement is version-based, not wall-clock: a key covers every dockview * version released on or before its `ValidUntil` date. If this build was * released after `ValidUntil` the key is `expired` (watermarked); otherwise it * is `valid`, so a deployed app on a covered version keeps working forever, * and only upgrading to a build past the license window trips the watermark. A * build released before `ValidFrom` is treated leniently as `valid`. */ export declare function validateLicense(key: string | undefined, releaseDate: Date): LicenseState; /** Whether a state means "licensed" (no watermark). */ export declare function isValidLicense(state: LicenseState): boolean;