/** * CTRF Runtime API for Mocha * * The reporter sets a global runtime interface that forwards metadata to the reporter. * * ## Usage * * ```ts * import { extra } from 'mocha-ctrf-json-reporter/runtime' * * it('should do something', () => { * extra({ priority: 'high', owner: 'team-a' }) * // test code... * }) * ``` */ export declare const CTRF_MOCHA_RUNTIME_KEY = "__ctrfMochaRuntime__"; export type MessageProcessor = (message: RuntimeMessage) => void; export interface RuntimeMessage { type: 'extra'; data: Record; } /** * MochaTestRuntime interface for type exports */ export interface MochaTestRuntime { extra(data: Record): void; } /** * Set the global runtime (called by reporter) */ export declare function setGlobalTestRuntime(runtime: MochaTestRuntime): void; /** * Create a runtime instance with a message processor */ export declare function createTestRuntime(messageProcessor: MessageProcessor): MochaTestRuntime; /** * Add extra data to the current test's CTRF output. * Call this from within test code to attach custom metadata. * * @example * ```ts * import { extra } from 'mocha-ctrf-json-reporter/runtime' * * it('should do something', () => { * extra({ priority: 'high', owner: 'team-a' }) * // test code... * }) * ``` * * Multiple calls are deep-merged: * - Arrays are concatenated * - Nested objects are recursively merged * - Primitives are overwritten by later calls */ export declare function extra(data: Record): void; /** CTRF runtime API namespace */ export declare const ctrf: { readonly extra: typeof extra; };