import { BasedServer } from './server.js'; import { HttpSession, Context, Session, WebSocketSession, BasedRoute, BasedFunctionConfig } from '@based/functions'; import { AttachedCtx } from './query/types.js'; export type ClientSession = HttpSession | WebSocketSession; export type FunctionHandler = (props: FunctionProps & { spec: BasedFunctionConfig; }) => any; export type FunctionErrorHandler = (props: FunctionProps, err?: Error) => true | void; export type FunctionProps = { route: R; server: BasedServer; ctx: Context; payload?: P; error?: FunctionErrorHandler; id?: number; checksum?: number; attachedCtx?: AttachedCtx; };