import type { BacktraceFrame } from '@hawk.so/types'; /** * Parsing and formatting error's backtrace */ export default class BacktraceHelper { /** * Error to be processed */ private error; /** * Initialize a class * @param error — event error to be processed */ constructor(error: Error); /** * Return backtrace matching types scheme */ getBacktrace(): BacktraceFrame[]; /** * Format frame data to BacktraceFrame scheme * @param frame — backtrace step */ private parseStackFrame; /** * Check if frame is an internal node call * You should not reach sources and show code pieces for internal calls * @param frame — backtrace step */ private isInternal; /** * Read a source file as an array of lines * @param filepath - path to file to be read */ private getSourceFileAsLines; /** * Return lines as file chuck with a target line * @param filename - path to file to be read * @param targetLine - number of line with an call * @param linesBuffer — number of lines before and after target line to be read */ private getFileChunk; }