interface MemorySessionStoreDeps
Since 0.2.0

Runtime capabilities the store needs.

Deliberately has no defaults. A defaulted clock would mean reaching for Date.now(), which is a runtime API and forbidden outside packages/runtime; requiring injection also keeps the sweep testable without waiting on real time. Same reasoning as the CLI's CliDependencies.

Properties

readonly
now: () => number

Wall-clock milliseconds, from IRuntimeServices.now.

readonly
setInterval: (
fn: () => void,
ms: number
) => TimerHandle

Interval scheduler, from IRuntimeServices.setInterval.

readonly
clearInterval: (handle: TimerHandle) => void

Interval canceller, from IRuntimeServices.clearInterval.

readonly
optional
sweepIntervalMs: number

Milliseconds between expiry sweeps. Default 60000.

Usage

import { type MemorySessionStoreDeps } from "session-plugin/src/index.ts";