UNPKG

1.23 kBTypeScriptView Raw
1import type { Event, StackFrame } from '@sentry/core';
2export declare const MAX_CONTEXTLINES_COLNO: number;
3export declare const MAX_CONTEXTLINES_LINENO: number;
4interface ContextLinesOptions {
5 /**
6 * Sets the number of context lines for each frame when loading a file.
7 * Defaults to 7.
8 *
9 * Set to 0 to disable loading and inclusion of source files.
10 **/
11 frameContextLines?: number;
12}
13/**
14 * Exported for testing purposes.
15 */
16export declare function resetFileContentCache(): void;
17/**
18 * Resolves context lines before and after the given line number and appends them to the frame;
19 */
20export declare function addContextToFrame(lineno: number, frame: StackFrame, contextLines: number, contents: Record<number, string> | undefined): void;
21/** Exported only for tests, as a type-safe variant. */
22export declare const _contextLinesIntegration: (options?: ContextLinesOptions) => {
23 name: string;
24 processEvent(event: Event): Promise<Event>;
25};
26/**
27 * Capture the lines before and after the frame's context.
28 */
29export declare const contextLinesIntegration: (options?: ContextLinesOptions | undefined) => import("@sentry/core").Integration;
30export {};
31//# sourceMappingURL=contextlines.d.ts.map
\No newline at end of file