/// <reference types="node" />
import * as http from 'http';
import { NodeOptions } from '.';
import type { Attributes } from '@opentelemetry/api';
/** JSDoc */
interface MiddlewareError extends Error {
    status?: number | string;
    statusCode?: number | string;
    status_code?: number | string;
    output?: {
        statusCode?: number | string;
    };
}
/**
 * Express compatible error handler.
 * Exposed as `Handlers.errorHandler`.
 * `metadata` accepts structured tags that should be attached to every error.
 */
export declare function errorHandler(options: NodeOptions, metadata?: Attributes): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
/**
 * A TRPC compatible error handler for logging errors to Highlight.
 * `metadata` accepts structured tags that should be attached to every error.
 */
export declare function trpcOnError({ error, req, }: {
    error: Error;
    req: {
        headers?: http.IncomingHttpHeaders;
    };
}, options: NodeOptions, metadata?: Attributes): Promise<void>;
/**
 * A wrapper for logging errors to Highlight for Firebase HTTP functions.
 * `metadata` accepts structured tags that should be attached to every error.
 */
declare type FirebaseHttpFunctionHandler = (req: any, resp: any) => void | Promise<void>;
export declare function firebaseHttpFunctionHandler(origHandler: FirebaseHttpFunctionHandler, options: NodeOptions, metadata?: Attributes): FirebaseHttpFunctionHandler;
/**
 * A wrapper for logging errors to Highlight for Firebase callable functions.
 * `metadata` accepts structured tags that should be attached to every error.
 */
declare type FirebaseCallableFunctionHandler = (data: any, context: any) => any;
export declare function firebaseCallableFunctionHandler(origHandler: FirebaseCallableFunctionHandler, options: NodeOptions, metadata?: Attributes): FirebaseCallableFunctionHandler;
/**
 * A wrapper for logging errors to Highlight for AWS Lambda and other serverless functions.
 * `metadata` accepts structured tags that should be attached to every error.
 */
declare type ServerlessCallableFunctionHandler = (event?: any) => any;
export declare function serverlessFunction(origHandler: ServerlessCallableFunctionHandler, options: NodeOptions, metadata?: Attributes): ServerlessCallableFunctionHandler;
export {};
//# sourceMappingURL=handlers.d.ts.map