mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-07 09:49:07 +00:00
Merge pull request #18703 from dcherman/raven-shouldsend
Raven: add `shouldSendCallback`
This commit is contained in:
22
types/raven/index.d.ts
vendored
22
types/raven/index.d.ts
vendored
@@ -11,8 +11,8 @@ import { EventEmitter } from 'events';
|
||||
|
||||
export const version: string;
|
||||
export function config(dsn: string | false, options?: ConstructorOptions): Client;
|
||||
export function wrap(func: () => void, onErr?: () => void): () => void;
|
||||
export function wrap(options: any, func: () => void, onErr?: () => void): () => void;
|
||||
export function wrap<T>(func: () => T): () => T;
|
||||
export function wrap<T>(options: any, func: () => T): () => T;
|
||||
export function interceptErr(ctx: any): Client;
|
||||
export function setContext(ctx: any): Client;
|
||||
export function captureException(e: Error, cb?: CaptureCallback): string;
|
||||
@@ -23,8 +23,8 @@ export function mergeContext(ctx: any): Client;
|
||||
export function getContext(): any;
|
||||
export function requestHandler(): (req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
export function errorHandler(): (e: Error, req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
export function context(ctx: any, func: () => void, onErr?: () => void): Client;
|
||||
export function context(func: () => void, onErr?: () => void): Client;
|
||||
export function context<T>(ctx: any, func: () => T): T;
|
||||
export function context<T>(func: () => T): T;
|
||||
export function captureBreadcrumb(breadcrumb: any): void;
|
||||
export function disableConsoleAlerts(): void;
|
||||
export function consoleAlert(msg: string): void;
|
||||
@@ -33,9 +33,9 @@ export function parseDSN(dsn: string | false): parsedDSN;
|
||||
export class Client extends EventEmitter {
|
||||
constructor(options: ConstructorOptions);
|
||||
constructor(dsn: string, options?: ConstructorOptions);
|
||||
config(dsn: string, options?: ConstructorOptions): Client;
|
||||
install(options?: ConstructorOptions, cb?: () => void): Client;
|
||||
setContext(ctx: any): Client;
|
||||
config(dsn: string, options?: ConstructorOptions): this;
|
||||
install(options?: ConstructorOptions, cb?: () => void): this;
|
||||
setContext(ctx: any): this;
|
||||
requestHandler(): (req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
errorHandler(): (e: Error, req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
captureException(error: Error, cb?: CaptureCallback): string;
|
||||
@@ -45,8 +45,9 @@ export class Client extends EventEmitter {
|
||||
captureBreadcrumb(breadcrumb: any): void;
|
||||
setUserContext(data: UserData): void;
|
||||
setDataCallback(fn: DataCallback): void;
|
||||
context(ctx: any, func: () => void, onErr?: () => void): Client;
|
||||
context(func: () => void, onErr?: () => void): Client;
|
||||
setShouldSendCallback(fn: ShouldSendCallback): this;
|
||||
context<T>(ctx: any, func: () => T): T;
|
||||
context<T>(func: () => T): T;
|
||||
process(kwargs: any, cb?: () => void): void;
|
||||
process(eventId: string, kwargs: any, cb?: () => void): void;
|
||||
}
|
||||
@@ -59,6 +60,7 @@ export interface ConstructorOptions {
|
||||
tags?: { [key: string]: string };
|
||||
extra?: { [key: string]: any };
|
||||
dataCallback?: DataCallback;
|
||||
shouldSendCallback?: ShouldSendCallback;
|
||||
transport?(): void;
|
||||
captureUnhandledRejections?: boolean;
|
||||
autoBreadcrumbs?: boolean | any;
|
||||
@@ -86,6 +88,8 @@ export type CaptureCallback = (err: { [key: string]: any }, eventId: any) => voi
|
||||
|
||||
export type DataCallback = (data: { [key: string]: any }) => void;
|
||||
|
||||
export type ShouldSendCallback = (data: { [key: string]: any }) => boolean;
|
||||
|
||||
export type TransportCallback = (options: { [key: string]: any }) => void;
|
||||
|
||||
export interface CaptureOptions {
|
||||
|
||||
Reference in New Issue
Block a user