@andranik-arakelyan/js-utilities
Version:
Javascript utilities
25 lines (24 loc) • 969 B
TypeScript
/**
* Interface representing the result of the current code information.
*/
export interface ICurrentCodeInfoResult {
/** The name of the class containing the current code. */
className: string;
/** The name of the method containing the current code. */
methodName: string;
/** The full file path of the current code. */
filepath: string;
/** The file name of the current code. */
filename: string;
/** The line number of the current code. */
lineNumber: number;
/** The column number of the current code. */
columnNumber: number;
}
/**
* Retrieves information about the current code execution context.
*
* @param additionalDepth - The additional depth to consider in the stack trace.
* @returns An object containing the class name, method name, file path, file name, line number, and column number of the current code.
*/
export declare function currentCodeInfo(additionalDepth?: number): ICurrentCodeInfoResult;