Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
/**
|
|
* A callback-mode method that this module can wrap.
|
|
*/
|
|
export type Traceable = (this: unknown, ...args: unknown[]) => unknown;
|
|
/**
|
|
* A callback-mode method that this module can wrap.
|
|
*
|
|
* @typedef {(this: unknown, ...args: unknown[]) => unknown} Traceable
|
|
*/
|
|
/**
|
|
* Wraps `object[property]` so that an error delivered to its callback
|
|
* carries the call site's stack, augmented with the wrapped call.
|
|
*
|
|
* The callback is found at `pos` (negative counts from the end, the
|
|
* default -1 meaning the last argument). Only callback-mode calls are
|
|
* affected: without a function in that position the wrapper is a
|
|
* pass-through, which is why verbose() traces the callback cores and
|
|
* then rebuilds the dual-mode wrappers around them.
|
|
*
|
|
* @param {Record<string, Traceable>} object the holder of the method.
|
|
* @param {string} property the method name on `object`.
|
|
* @param {number} [pos=-1] position of the callback argument.
|
|
* @returns {void}
|
|
*/
|
|
declare function extendTrace(object: Record<string, Traceable>, property: string, pos?: number): void;
|
|
/**
|
|
* Drops this file's own frames from a stack string.
|
|
*
|
|
* @param {string | undefined} stackStr the stack to filter.
|
|
* @returns {string[]} the surviving frames.
|
|
*/
|
|
declare function filter(stackStr: string | undefined): string[];
|
|
export { extendTrace, filter };
|