export type OnerrorError = Error & {
    status: number;
    headers?: Record<string, string>;
    expose?: boolean;
};
export type OnerrorHandler = (err: OnerrorError, ctx: any) => void;
export type OnerrorOptions = {
    text?: OnerrorHandler;
    json?: OnerrorHandler;
    html?: OnerrorHandler;
    all?: OnerrorHandler;
    js?: OnerrorHandler;
    redirect?: string | null;
    accepts?: (...args: string[]) => string;
};
export declare function onerror(app: any, options?: OnerrorOptions): any;
