/** The combination of location information about the line that was executing at the time */ export type Location = { /** the location of the line that was executing at the time */ line: number; /** the location of the character that was executing at the time */ char: number; /** the method name that was executing at the time */ method: string; /** the file path that was executing at the time */ file: string; }; /** * If provided, continue skipping until: * * 1. The file or method is found * 2. Once found, will continue until neither the file nor method are found anymore * 3. Once exited, the frame offset will then apply * * If you wish to capture the found method or the file, combine them with `frames: -1` or `immediate: true`. * * If you wish for more customisation than this, create an issue requesting passing a custom skip handler function, as more variance to this interface is too much customisation complexity. */ type Offset = { /** * if provided, continue until a method containing or matching this string is exited * if provided alongside a file, will continue until neither the file nor method are found * this allows file and method to act as fallbacks for each other, such that if one is not found, it doesn't skip everything */ method?: RegExp | string | null; /** * if provided, continue until a file containing or matching this string is exited * if provided alongside a method, will continue until neither the file nor method are found * this allows file and method to act as fallbacks for each other, such that if one is not found, it doesn't skip everything */ file?: RegExp | string | null; /** * once we have satisfied the found condition, if any, then apply this index offset to the frames * e.g. 1 would mean next frame, and -1 would mean the previous frame * Use -1 to go back to the found method or file */ frames?: number; /** * once we have satisfied the found condition, should we apply the frame offset immediately, or wait until the found condition has exited */ immediate?: boolean; }; /** * For an error instance, return its stack frames as an array. */ export declare const getFramesFromError: (error: Error) => string[]; /** * Get the location information about the line that called this method. * If no offset is provided, then continue until the caller of the `getCurrentLine` is found. * @example Input * ``` javascript * console.log(getCurrentLine()) * ``` * @example Result * ``` json * { * "line": "1", * "char": "12", * "method": "Object.", * "file": "/Users/balupton/some-project/calling-file.ts" * } * ``` */ export declare const getCurrentLine: (offset?: Offset) => Location; export {};