raygun
Version:
Raygun package for Node.js, written in TypeScript
54 lines (53 loc) • 1.73 kB
TypeScript
import { MessageBuilderOptions, Message, MessageBuilding, RequestParams, Tag, CustomData, Breadcrumb, UserMessageData } from "./types";
export declare class RaygunMessageBuilder {
_filters: string[];
options: MessageBuilderOptions;
message: MessageBuilding;
constructor(options?: MessageBuilderOptions);
build(): Message;
/**
* Add error details to builder
* @param error - error to add
*/
setErrorDetails(error: Error | string | any): this;
/**
* Set environment details from OS to builder
*/
setEnvironmentDetails(): this;
/**
* Set machine name to builder
* @param machineName - the machine name, if not provided reads from OS
*/
setMachineName(machineName?: string): this;
/**
* Set custom data to builder
* @param customData - optional CustomData object
*/
setUserCustomData(customData?: CustomData): this;
/**
* Set tags to builder
* @param tags - List of Tags
*/
setTags(tags: Tag[]): this;
/**
* Set Request to builder
* @param request - optional request object
*/
setRequestDetails(request: RequestParams | undefined): this;
/**
* Set user info to builder
* @param user - either a function or a UserMessageData object
*/
setUser(user: (() => UserMessageData) | UserMessageData | undefined): this;
/**
* Set application version to builder
* @param version - version as String
*/
setVersion(version: string): this;
private extractUserProperties;
/**
* Set list of breadcrumbs to builder
* @param breadcrumbs - optional list of breadcrumbs
*/
setBreadcrumbs(breadcrumbs: Breadcrumb[] | null): this;
}