Files
irontelemetry-js/dist/types/index.d.ts
logikonline 8c300c1f8d Include dist folder for git-based installs
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>
2026-01-07 15:12:47 -05:00

96 lines
3.5 KiB
TypeScript

import { TelemetryClient } from './client';
import type { TelemetryOptions, SeverityLevel, Breadcrumb, BreadcrumbCategory, SendResult } from './types';
import { JourneyScope, StepScope } from './journey';
export type { TelemetryOptions, TelemetryEvent, SeverityLevel, Breadcrumb, BreadcrumbCategory, User, SendResult, ExceptionInfo, StackFrame, PlatformInfo, JourneyContext, JourneyStep, ParsedDsn, } from './types';
export { TelemetryClient } from './client';
export { Journey, JourneyScope, Step, StepScope } from './journey';
/**
* Initialize the global IronTelemetry client
*/
export declare function init(optionsOrDsn: TelemetryOptions | string): TelemetryClient;
/**
* Get the global client instance
*/
export declare function getClient(): TelemetryClient | null;
/**
* Capture an exception using the global client
*/
export declare function captureException(error: Error | unknown, extra?: Record<string, unknown>): Promise<SendResult>;
/**
* Capture a message using the global client
*/
export declare function captureMessage(message: string, level?: SeverityLevel): Promise<SendResult>;
/**
* Add a breadcrumb using the global client
*/
export declare function addBreadcrumb(message: string, category?: BreadcrumbCategory, level?: SeverityLevel, data?: Record<string, unknown>): void;
export declare function addBreadcrumb(breadcrumb: Omit<Breadcrumb, 'timestamp'>): void;
/**
* Set user context using the global client
*/
export declare function setUser(id: string, email?: string, data?: Record<string, unknown>): void;
/**
* Clear user context using the global client
*/
export declare function clearUser(): void;
/**
* Set a tag using the global client
*/
export declare function setTag(key: string, value: string): void;
/**
* Set extra context using the global client
*/
export declare function setExtra(key: string, value: unknown): void;
/**
* Start a journey using the global client
*/
export declare function startJourney(name: string): JourneyScope;
/**
* Start a step in the current journey using the global client
*/
export declare function startStep(name: string, category?: string): StepScope;
/**
* Flush pending events using the global client
*/
export declare function flush(): Promise<void>;
/**
* Close the global client
*/
export declare function close(): void;
declare const IronTelemetry: {
init: typeof init;
getClient: typeof getClient;
captureException: typeof captureException;
captureMessage: typeof captureMessage;
addBreadcrumb: typeof addBreadcrumb;
setUser: typeof setUser;
clearUser: typeof clearUser;
setTag: typeof setTag;
setExtra: typeof setExtra;
startJourney: typeof startJourney;
startStep: typeof startStep;
flush: typeof flush;
close: typeof close;
};
export default IronTelemetry;
/**
* Enable the Error.prototype.capture() extension.
* This is opt-in to avoid TypeScript conflicts in projects that create
* Error-like objects without the capture method.
*
* After calling this, you can use: throw new Error('msg').capture()
*/
export declare function enableErrorCapture(): void;
/**
* Set up global unhandled exception handler
*/
export declare function useUnhandledExceptionHandler(): void;
/**
* Track a step with automatic error handling
*/
export declare function trackStep<T>(name: string, fn: () => T, category?: string): T;
/**
* Track an async step with automatic error handling
*/
export declare function trackStepAsync<T>(name: string, fn: () => Promise<T>, category?: string): Promise<T>;
//# sourceMappingURL=index.d.ts.map