import { TwirpContext } from "./context"; import { TwirpError } from "./errors"; export interface ServerHooks { requestReceived?: (ctx: T) => void | Promise; requestRouted?: (ctx: T) => void | Promise; /**@deprecated Use responsePrepared instead*/ requestPrepared?: (ctx: T) => void | Promise; responsePrepared?: (ctx: T) => void | Promise; /**@deprecated Use responseSent instead*/ requestSent?: (ctx: T) => void | Promise; responseSent?: (ctx: T) => void | Promise; error?: (ctx: T, err: TwirpError) => void | Promise; } export declare function chainHooks(...hooks: ServerHooks[]): ServerHooks | null; export declare function isHook(object: any): object is ServerHooks;