/** * @file `process.emitWarning` suppression. Single shared wrapper installed on * first call, driven by a membership Set so repeated `suppressWarningType` * calls are cheap. */ /** * Restore the original getNodeProcess().emitWarning function. Call this to * re-enable all warnings after suppressing them. * * @example * ;```typescript * suppressMaxListenersWarning() * // ... do work ... * restoreWarnings() // Re-enable all warnings * ``` */ export declare function restoreWarnings(): void; /** * Internal function to set up warning suppression. Only wraps * getNodeProcess().emitWarning once, regardless of how many times it's called. */ export declare function setupSuppression(): void; /** * Silence `MaxListenersExceededWarning` messages from `process.emitWarning`. * Installs a single shared wrapper around `process.emitWarning` on first call * so repeat invocations are cheap. * * @example * import { suppressMaxListenersWarning } from '@socketsecurity/lib/events/warning/suppress' * * suppressMaxListenersWarning() */ export declare function suppressMaxListenersWarning(): void; /** * Suppress all process warnings of a specific type. * * @example * import { suppressWarningType } from '@socketsecurity/lib/events/warning/suppress' * * suppressWarningType('ExperimentalWarning') * * @param warningType - The warning type to suppress (e.g., * 'DeprecationWarning', 'ExperimentalWarning') */ export declare function suppressWarningType(warningType: string): void; /** * Suppress warnings temporarily within a callback. * * @example * import { withSuppressedWarnings } from '@socketsecurity/lib/events/warning/suppress' * * const result = await withSuppressedWarnings( * 'ExperimentalWarning', * async () => { * // Code that triggers experimental warnings * return someValue * }, * ) * * @param warningType - The warning type to suppress. * @param callback - Function to execute with warnings suppressed. * * @returns The result of the callback */ export declare function withSuppressedWarnings(warningType: string, callback: () => T | Promise): Promise;