import { ResponseCookie } from 'next/dist/compiled/@edge-runtime/cookies'; import { InsforgeUser } from '@insforge/shared'; /** * Cookie names used by Insforge authentication * These are fixed and should not be changed to ensure consistency */ declare const COOKIE_NAMES: { /** Session cookie storing the access token */ readonly SESSION: "insforge-session"; /** User info cookie storing basic user data for SSR */ readonly USER: "insforge-user"; }; /** * Default cookie configuration values */ declare const COOKIE_DEFAULTS: { /** Default max age: 7 days in seconds */ readonly MAX_AGE: number; /** Cookie path */ readonly PATH: "/"; /** SameSite policy */ readonly SAME_SITE: "lax"; }; /** * Options for cookie operations */ interface CookieOptions { /** Max age in seconds (default: 7 days) */ maxAge?: number; /** Whether to use secure cookies (HTTPS only). Auto-detected if not provided */ secure?: boolean; } /** * Determines if secure cookies should be used based on environment * @param explicitSecure - Explicit secure value if provided * @returns Whether to use secure cookies */ declare function isSecureCookie(explicitSecure?: boolean): boolean; /** * Get base cookie options for auth cookies * @param options - Optional cookie configuration * @returns Cookie options object compatible with Next.js cookies API */ declare function getBaseCookieOptions(options?: CookieOptions): Omit; /** * Get cookie options for clearing/deleting a cookie * @param options - Optional cookie configuration * @returns Cookie options for deletion (maxAge: 0) */ declare function getClearCookieOptions(options?: Pick): Omit; /** * Serialize user info for storage in cookie * @param user - User information to serialize * @returns JSON string of user info */ declare function serializeUserCookie(user: InsforgeUser): string; /** * Parse user info from cookie value * @param cookieValue - Raw cookie value * @returns Parsed user info or null if invalid */ declare function parseUserCookie(cookieValue: string | undefined): InsforgeUser | null; export { COOKIE_DEFAULTS, COOKIE_NAMES, type CookieOptions, getBaseCookieOptions, getClearCookieOptions, isSecureCookie, parseUserCookie, serializeUserCookie };