UNPKG

1.41 kBTypeScriptView Raw
1/**
2 * Create a new event from a logger
3 *
4 * @since 0.1.0
5 *
6 * @param {Logger} logger Logger should have a context, like the default `ctx.log`
7 * @param {AbortSignal|undefined} [signal]
8 * @returns {InsightEvent}
9 */
10export function newEvent(logger: Logger, signal?: AbortSignal | undefined): InsightEvent;
11/**
12 * Create a 'child' event, reuses the logger, adds callstack to the passed event
13 *
14 * @since 0.1.0
15 *
16 * @param {InsightEvent} event
17 * @returns {InsightEvent}
18 */
19export function newEventFromEvent(event: InsightEvent): InsightEvent;
20/**
21 * Track event start times
22 *
23 * @since 0.1.0
24 *
25 * @param {InsightEvent} event
26 * @param {string} name
27 * @returns {void}
28 */
29export function eventStart(event: InsightEvent, name: string): void;
30/**
31 * Rename an event, and all callStack items
32 *
33 * @since 0.1.0
34 *
35 * @param {InsightEvent} event
36 * @param {string} name
37 * @returns {void}
38 */
39export function eventRename(event: InsightEvent, name: string): void;
40/**
41 * Track event end times and log if necessary
42 *
43 * @since 0.1.0
44 *
45 * @param {InsightEvent} event
46 * @returns {void}
47 */
48export function eventStop(event: InsightEvent): void;
49export type Logger = import("../types/advanced-types.js").Logger;
50export type InsightEventCall = import("../types/advanced-types").InsightEventCall;
51export type InsightEvent = import("../types/advanced-types").InsightEvent;
52//# sourceMappingURL=events.d.ts.map
\No newline at end of file