import { Tt as User, wt as Session } from "./index-nluIr-xs.mjs"; import { BetterAuthCookies, BetterAuthOptions, GenericEndpointContext } from "@better-auth/core"; import "zod"; import { CookieOptions } from "better-call"; //#region src/cookies/cookie-utils.d.ts interface CookieAttributes { value: string; "max-age"?: number | undefined; expires?: Date | undefined; domain?: string | undefined; path?: string | undefined; secure?: boolean | undefined; httponly?: boolean | undefined; samesite?: ("strict" | "lax" | "none") | undefined; [key: string]: any; } declare function parseSetCookieHeader(setCookie: string): Map; declare function setCookieToHeader(headers: Headers): (context: { response: Response; }) => void; //#endregion //#region src/cookies/session-store.d.ts interface Cookie { name: string; value: string; options: CookieOptions; } declare const createSessionStore: (cookieName: string, cookieOptions: CookieOptions, ctx: GenericEndpointContext) => { /** * Get the full session data by joining all chunks */ getValue(): string; /** * Check if there are existing chunks */ hasChunks(): boolean; /** * Chunk a cookie value and return all cookies to set (including cleanup cookies) */ chunk(value: string, options?: Partial): Cookie[]; /** * Get cookies to clean up all chunks */ clean(): Cookie[]; /** * Set all cookies in the context */ setCookies(cookies: Cookie[]): void; }; declare function getChunkedCookie(ctx: GenericEndpointContext, cookieName: string): string | null; //#endregion //#region src/cookies/index.d.ts declare function createCookieGetter(options: BetterAuthOptions): (cookieName: string, overrideAttributes?: Partial) => { name: string; attributes: CookieOptions; }; declare function getCookies(options: BetterAuthOptions): { sessionToken: { name: string; options: CookieOptions; }; /** * This cookie is used to store the session data in the cookie * This is useful for when you want to cache the session in the cookie */ sessionData: { name: string; options: CookieOptions; }; dontRememberToken: { name: string; options: CookieOptions; }; accountData: { name: string; options: CookieOptions; }; }; declare function setCookieCache(ctx: GenericEndpointContext, session: { session: Session & Record; user: User; }, dontRememberMe: boolean): Promise; declare function setSessionCookie(ctx: GenericEndpointContext, session: { session: Session & Record; user: User; }, dontRememberMe?: boolean | undefined, overrides?: Partial | undefined): Promise; declare function deleteSessionCookie(ctx: GenericEndpointContext, skipDontRememberMe?: boolean | undefined): void; declare function parseCookies(cookieHeader: string): Map; type EligibleCookies = (string & {}) | (keyof BetterAuthCookies & {}); declare const getSessionCookie: (request: Request | Headers, config?: { cookiePrefix?: string; cookieName?: string; path?: string; } | undefined) => string | null; declare const getCookieCache: ; user: User & Record; updatedAt: number; version?: string; }>(request: Request | Headers, config?: { cookiePrefix?: string; cookieName?: string; isSecure?: boolean; secret?: string; strategy?: "compact" | "jwt" | "jwe"; version?: string | ((session: Session & Record, user: User & Record) => string) | ((session: Session & Record, user: User & Record) => Promise); } | undefined) => Promise; //#endregion export { getCookies as a, setCookieCache as c, getChunkedCookie as d, parseSetCookieHeader as f, getCookieCache as i, setSessionCookie as l, createCookieGetter as n, getSessionCookie as o, setCookieToHeader as p, deleteSessionCookie as r, parseCookies as s, EligibleCookies as t, createSessionStore as u };