Unignored dist/ so yarn/npm can install from git URL without needing to build locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
116 lines
3.3 KiB
TypeScript
116 lines
3.3 KiB
TypeScript
import type { TelemetryOptions, SeverityLevel, Breadcrumb, BreadcrumbCategory, SendResult } from './types';
|
|
import { JourneyScope, StepScope } from './journey';
|
|
/**
|
|
* Global debug logging flag. When enabled, all IronTelemetry clients
|
|
* will output debug information to the console.
|
|
*/
|
|
export declare let enableDebugLogging: boolean;
|
|
/**
|
|
* Enable or disable global debug logging for all TelemetryClient instances.
|
|
* @param enabled Whether to enable debug logging
|
|
*/
|
|
export declare function setDebugLogging(enabled: boolean): void;
|
|
/**
|
|
* Main IronTelemetry client class
|
|
*/
|
|
export declare class TelemetryClient {
|
|
private readonly options;
|
|
private readonly transport;
|
|
private readonly queue;
|
|
private readonly breadcrumbs;
|
|
private tags;
|
|
private extra;
|
|
private user?;
|
|
private currentJourney?;
|
|
private flushInterval?;
|
|
private isInitialized;
|
|
constructor(options: TelemetryOptions);
|
|
/**
|
|
* Capture an exception
|
|
*/
|
|
captureException(error: Error | unknown, extra?: Record<string, unknown>): Promise<SendResult>;
|
|
/**
|
|
* Capture a message
|
|
*/
|
|
captureMessage(message: string, level?: SeverityLevel): Promise<SendResult>;
|
|
/**
|
|
* Log a structured message with title, message, and optional data.
|
|
* Useful for structured logging that differentiates the log title from its details.
|
|
* @param level The severity level of the log
|
|
* @param title A short, descriptive title for the log entry
|
|
* @param message Optional detailed message
|
|
* @param data Optional additional data to attach to the log
|
|
*/
|
|
logMessage(level: SeverityLevel, title: string, message?: string, data?: Record<string, unknown>): Promise<SendResult>;
|
|
/**
|
|
* Add a breadcrumb
|
|
*/
|
|
addBreadcrumb(message: string, category?: BreadcrumbCategory, level?: SeverityLevel, data?: Record<string, unknown>): void;
|
|
addBreadcrumb(breadcrumb: Omit<Breadcrumb, 'timestamp'>): void;
|
|
/**
|
|
* Get a copy of the current breadcrumbs list.
|
|
* @returns A read-only array of breadcrumbs
|
|
*/
|
|
getBreadcrumbs(): ReadonlyArray<Breadcrumb>;
|
|
/**
|
|
* Clear all breadcrumbs.
|
|
*/
|
|
clearBreadcrumbs(): void;
|
|
/**
|
|
* Set user context
|
|
*/
|
|
setUser(id: string, email?: string, data?: Record<string, unknown>): void;
|
|
/**
|
|
* Clear user context
|
|
*/
|
|
clearUser(): void;
|
|
/**
|
|
* Set a tag
|
|
*/
|
|
setTag(key: string, value: string): void;
|
|
/**
|
|
* Set extra context
|
|
*/
|
|
setExtra(key: string, value: unknown): void;
|
|
/**
|
|
* Start a new journey
|
|
*/
|
|
startJourney(name: string): JourneyScope;
|
|
/**
|
|
* Start a step in the current journey
|
|
*/
|
|
startStep(name: string, category?: string): StepScope;
|
|
/**
|
|
* Flush pending events
|
|
*/
|
|
flush(): Promise<void>;
|
|
/**
|
|
* Close the client
|
|
*/
|
|
close(): void;
|
|
/**
|
|
* Create a telemetry event
|
|
*/
|
|
private createEvent;
|
|
/**
|
|
* Send an event
|
|
*/
|
|
private sendEvent;
|
|
/**
|
|
* Process offline queue
|
|
*/
|
|
private processQueue;
|
|
/**
|
|
* Parse an error into exception info
|
|
*/
|
|
private parseException;
|
|
/**
|
|
* Parse a stack trace string into frames
|
|
*/
|
|
private parseStackTrace;
|
|
/**
|
|
* Get platform information
|
|
*/
|
|
private getPlatformInfo;
|
|
}
|
|
//# sourceMappingURL=client.d.ts.map
|