import type { TokenTtlConfig } from '../types.js'; /** * Parse an `Ns | Nm | Nh | Nd` duration into seconds — the one grammar every * duration-shaped config field uses (`jwt.expiresIn`, `refreshTokenTtl`, * `twoFactor.pendingTokenTtl`, …). One copy on purpose: the JWT `exp` claim * and the session cookie `maxAge` are derived from the SAME `expiresIn` * value, so two drifting parsers would silently desynchronize token and * cookie lifetime. */ export declare function parseDurationSeconds(value: string): number; /** * Resolve one `config.tokenTtl` window to milliseconds — the unit the handlers * add to `Date.now()` for the expiry column. * * Throws on a malformed duration (via {@link parseDurationSeconds}) and on the * two values the grammar accepts but a token cannot survive: `'0h'`, whose link * is dead in the same millisecond it is mailed, and a window so large that * `Date.now() + ms` leaves the representable range, which stores an * `Invalid Date` — and an unparsable expiry is exactly the `null`-shaped hole * that makes a token immortal. Call it where the handler is created, not inside * the request: a typo in a config value must fail the wiring, not one password * reset at 3am. */ export declare function resolveTokenTtlMs(config: TokenTtlConfig | undefined, purpose: keyof TokenTtlConfig): number;