| 1 |
|
| 2 | import { SessionData, SessionIdStorageStrategy, SessionStorage } from "../sessions.js";
|
| 3 |
|
| 4 | //#region lib/server-runtime/sessions/memoryStorage.d.ts
|
| 5 | interface MemorySessionStorageOptions {
|
| 6 | /**
|
| 7 | * The Cookie used to store the session id on the client, or options used
|
| 8 | * to automatically create one.
|
| 9 | */
|
| 10 | cookie?: SessionIdStorageStrategy["cookie"];
|
| 11 | }
|
| 12 | /**
|
| 13 | * Creates and returns a simple in-memory SessionStorage object.
|
| 14 | *
|
| 15 | * Intended for local development and testing. It does not scale beyond a single
|
| 16 | * process, and all session data is lost when the server process stops/restarts.
|
| 17 | *
|
| 18 | * @public
|
| 19 | * @category Utils
|
| 20 | * @mode framework
|
| 21 | * @mode data
|
| 22 | * @param options Options for creating the in-memory session storage.
|
| 23 | * @returns A {@link SessionStorage} object that stores session data in memory.
|
| 24 | */
|
| 25 | declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({
|
| 26 | cookie
|
| 27 | }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
| 28 | //#endregion
|
| 29 | export { createMemorySessionStorage }; |
| \ | No newline at end of file |