/// <reference types="node" />
import { AsyncLocalStorage } from "async_hooks";
export type ContextKey = string;
export declare class Context<T = unknown, Z = Record<ContextKey, T>> {
    storage: AsyncLocalStorage<Record<ContextKey, T>>;
    defaultValues?: Z;
    constructor(defaultValues?: Z);
    get value(): Z;
    get<K extends keyof Z>(key: K): Z[K];
    get<TT>(key: ContextKey): TT | undefined;
    get(key: ContextKey): T | undefined;
    set<K extends keyof Z>(key: K, value: Z[K]): void;
    set(key: ContextKey, value: T): void;
    set(key: ContextKey, value: unknown): void;
    run<R>(values: Z, fn: () => R): R;
    run<R>(values: Record<ContextKey, T>, fn: () => R): R;
}
export declare function createContext<Z>(defaultValues?: Z): Context<Z[keyof Z], Z>;
