astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
12 lines (11 loc) • 497 B
TypeScript
import type { FetchState } from '../fetch/fetch-state.js';
/**
* Registers a session provider on the given `FetchState`. When
* `state.resolve('session')` is first called, the `AstroSession` is
* created lazily. When `state.finalizeAll()` runs, any mutations are
* persisted.
*
* No-op (returns synchronously) if sessions are not configured on the
* pipeline, avoiding promise allocation on the hot path.
*/
export declare function provideSession(state: FetchState): Promise<void> | void;