alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
20 lines (19 loc) • 653 B
TypeScript
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;
}