UNPKG

@apiratorjs/async-context

Version:

A Node.js async context library leveraging the node:async_hooks module, supporting context merging and overriding.

14 lines 775 B
import { AsyncContextStore, TContexStoreName, TFullContextArgs, TNamedContextArgs } from "./types"; export declare class AsyncContext { static withContext<T>(...args: TNamedContextArgs<T>): Promise<T> | T; static withContext<T>(...args: TFullContextArgs<T>): Promise<T> | T; static withContextOverride<T>(...args: TNamedContextArgs<T>): Promise<T> | T; static withContextOverride<T>(...args: TFullContextArgs<T>): Promise<T> | T; static getMultiContext(names: TContexStoreName[]): AsyncContextStore; static getContext(): AsyncContextStore; static getContext<T = any>(name?: TContexStoreName): T; static isInContext(): boolean; private static buildNamedContext; private static buildContext; } //# sourceMappingURL=async-context.d.ts.map