import type { TekirResponse } from './types'; /** Apply state staged on a Tekir response builder to an arbitrary result. */ export declare function finalizeResponse(builder: TekirResponse, outgoing: Response): Response; /** * Register the hostnames the app trusts for same-origin checks (notably * `redirect.back()`). Called by the server when `trustedHosts` is configured. * Entries are lowercased; a leading `*.` marks a wildcard subdomain rule. */ export declare function setTrustedHosts(hosts: string[] | undefined): void; /** * Encrypt a JSON-serializable value under `secret` and return a token * shaped `iv.ciphertext.authTag` (all base64url). Built on AES-256-GCM, * so callers get authenticated confidentiality (anyone tampering with * the cookie fails the auth-tag check on decrypt). Pair with * {@link decryptCookieValue} to read the value back on the request side. */ export declare function encryptCookieValue(value: unknown, secret: string): string; /** * Decrypt a value previously produced by {@link encryptCookieValue}. * Returns `null` when the cookie is malformed, the auth tag fails, or * the JSON payload cannot be parsed — callers should treat all three * the same way (the cookie is untrustworthy). */ export declare function decryptCookieValue(token: string, secret: string): T | null; /** * Verify a value produced by {@link TekirResponse.signedCookie}. Returns * the original (unsigned) value when the HMAC tag matches, or `null` * when the cookie was tampered with. Uses constant-time comparison. */ export declare function verifySignedCookieValue(token: string, secret: string): string | null; /** * Create a new response builder with fluent API for HTTP responses. * Supports JSON, HTML, text, redirects, streams, downloads, SSE, signed/encrypted cookies, * and all standard HTTP status codes (2xx–5xx). * * @returns A `TekirResponse` instance with chainable methods. * * @example * ```ts * // JSON response * return ctx.response.ok({ users: [...] }) * * // Redirect * return ctx.response.redirect('/dashboard') * * // Set cookie + return * ctx.response.cookie('token', 'abc', { httpOnly: true, secure: true }) * return ctx.response.ok() * * // Signed cookie * ctx.response.signedCookie('session', 'data', process.env.APP_KEY) * ``` */ export declare function createResponse(request?: Request, options?: { trustedHosts?: string[]; }): TekirResponse;