Installation
npm install --save @types/honeybadger
Summary
This package contains type definitions for honeybadger (https://github.com/honeybadger-io/honeybadger-node).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/honeybadger.
index.d.ts
import { EventEmitter } from "events";
import { ErrorRequestHandler, RequestHandler } from "express";
declare namespace honeybadger {
interface ConfigureOptions {
apiKey: string;
endpoint?: string | undefined;
hostname?: string | undefined;
environment?: string | undefined;
projectRoot?: string | undefined;
logger?: Console | undefined;
developmentEnvironments?: readonly string[] | undefined;
filters?: readonly string[] | undefined;
}
interface metadata {
name?: string | undefined;
message?: string | undefined;
context?: object | undefined;
session?: object | undefined;
headers?: object | undefined;
params?: object | undefined;
cgiData?: object | undefined;
url?: string | undefined;
component?: string | undefined;
action?: string | undefined;
fingerprint?: string | undefined;
}
type CallbackFunction = (err: Error | null, notice: object | null) => void;
type LambdaHandler = (event: object, context: object) => void;
interface HoneyBadgerInstance extends EventEmitter {
context: any;
configure: (options: ConfigureOptions) => void;
notify: (err?: any, name?: any, extra?: CallbackFunction | metadata, callback?: CallbackFunction) => void;
setContext: (context: object) => void;
resetContext: (context?: object) => void;
factory: (options?: ConfigureOptions) => HoneyBadgerInstance;
errorHandler: ErrorRequestHandler;
requestHandler: RequestHandler;
lambdaHandler: (handler: LambdaHandler) => LambdaHandler;
onUncaughtException: (func: (error: Error) => void) => void;
}
}
declare const honeybadger: honeybadger.HoneyBadgerInstance;
export = honeybadger;
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: @types/express
Credits
These definitions were written by Ryan Skrzypek, and Levi Bostian.