/** * 异步上下文存储的通用接口,对齐 TC39 proposal-async-context。 * 这层抽象允许我们在不同 JS 运行时之间切换实现。 */ export interface AsyncContextStorage { /** * 创建并进入一个新的异步上下文。 * @param store 上下文中要存储的数据 * @param callback 在此上下文中执行的函数 */ run(store: T, callback: () => R): R; /** * 获取当前异步上下文中的数据。 * @returns 如果在上下文中,则返回存储的数据;否则返回 undefined。 */ getStore(): T | undefined; } export declare const createAsyncContextStorage: () => AsyncContextStorage; //# sourceMappingURL=async-context.d.ts.map