import type { SessionData, SessionStoreContract } from './types.ts'; /** * Session client exposes the API to set session data as a client. * Useful for testing or programmatic session manipulation. * * @example * const client = new SessionClient(store) * client.merge({ userId: 123 }) * client.flash({ success: 'Login successful' }) * await client.commit() */ export declare class SessionClient { #private; /** * Session key used for storing flash messages */ flashKey: string; /** * Session ID to use when no explicit session id is defined */ sessionId: `${string}-${string}-${string}-${string}-${string}`; /** * Creates a new session client * * @param store - Session store contract implementation */ constructor(store: SessionStoreContract); /** * Merges session data with existing values * * @param values - Session data to merge * * @example * client.merge({ userId: 123, theme: 'dark' }) */ merge(values: SessionData): this; /** * Merges flash messages with existing flash data * * @param values - Flash message data to merge * * @example * client.flash({ success: 'Operation completed', info: 'Check your email' }) */ flash(values: SessionData): this; /** * Commits data to the session store * * @example * await client.commit() // Saves all changes to the store */ commit(): Promise; /** * Destroys the session data from the store * * @param sessionId - Optional session ID to destroy (defaults to current session) * * @example * await client.destroy() // Destroy current session * await client.destroy('abc123') // Destroy specific session */ destroy(sessionId?: string): Promise; /** * Loads session data from the session store * * @param sessionId - Optional session ID to load (defaults to current session) * * @example * const { values, flashMessages } = await client.load() * const data = await client.load('abc123') // Load specific session */ load(sessionId?: string): Promise<{ values: any; flashMessages: any; }>; }