/** * @adonisjs/session * * (c) AdonisJS * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import type { FileStoreConfig, SessionData, SessionStoreContract } from '../types.ts'; /** * File store writes the session data on the file system. Each session * id gets its own file for storage. * * @example * const fileStore = new FileStore({ * location: './tmp/sessions' * }, '2 hours') */ export declare class FileStore implements SessionStoreContract { #private; /** * Creates a new file store instance * * @param config - File store configuration * @param age - Session age in seconds or time expression (e.g. '2 hours') */ constructor(config: FileStoreConfig, age: string | number); /** * Reads the session data from the disk * * @param sessionId - Session identifier * * @example * const data = await store.read('sess_abc123') */ read(sessionId: string): Promise; /** * Writes the session data to the disk as a string * * @param sessionId - Session identifier * @param values - Session data to store * * @example * await store.write('sess_abc123', { userId: 123 }) */ write(sessionId: string, values: SessionData): Promise; /** * Removes the session file from the disk * * @param sessionId - Session identifier * * @example * await store.destroy('sess_abc123') */ destroy(sessionId: string): Promise; /** * Updates the session expiry by updating the file's modification time * * @param sessionId - Session identifier * * @example * await store.touch('sess_abc123') */ touch(sessionId: string): Promise; }