UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

20 lines (19 loc) 653 B
import type { Route } from 'alinea/backend/router/Router'; import type { ComponentType } from 'react'; import { Connection } from './Connection.js'; import { Session } from './Session.js'; export declare namespace Auth { type Server = { router?: Route<Request, Response | undefined>; contextFor(request: Request): Promise<Connection.AuthContext>; }; type ViewProps = { setSession: (session: Session | undefined) => void; }; type View = ComponentType<ViewProps>; function anonymous(): Auth.Server; } export interface Auth<Options> { configure: (options: Options) => Auth.Server; view: Auth.View; }