/** The `(error?) => void` shape every stream hook completes through. */ export type Callback = (error?: Error | null) => void; export declare function nop(): void; export declare const kEmptyObject: object; export interface NextTick { (callback: (...args: A) => unknown, ...args: A): void; } /** * `process.nextTick` where a process exists, otherwise `queueMicrotask`. * * Node drains the next-tick queue ahead of the microtask queue; the fallback has no * equivalent, so callbacks scheduled here interleave with promise continuations instead * of preceding them. */ export declare const nextTick: NextTick; /** Wraps `callback` so that only its first invocation is forwarded. */ export declare function once(callback: (...args: A) => unknown): (this: unknown, ...args: A) => void; export declare function validateFunction(value: unknown, name: string): asserts value is (...args: any[]) => unknown; export declare function validateObject(value: unknown, name: string): void; export declare function validateBoolean(value: unknown, name: string): asserts value is boolean; export declare function validateAbortSignal(signal: unknown, name: string): void; export declare function validateInteger(value: unknown, name: string, min?: number, max?: number): void; /** * Runs `listener` the next time `signal` aborts, returning a disposable that detaches it. * An already-aborted signal never fires; callers check `signal.aborted` themselves. */ export declare function addAbortListener(signal: AbortSignal, listener: () => void): Disposable;