fix(PendingRequestMap): resolve type name conflict between env.ts interface and call.ts class
- Remove PendingRequestMap interface from env.ts (had reduced signature missing deadline, identity typed as unknown) - Add CallMap interface in env.ts with full call() signature matching the class - Update EnvOptions.callMap to use CallMap type - Export PendingRequestMap class directly (remove PendingRequestMapClass alias) - Export CallMap type from index.ts instead of old PendingRequestMap interface
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { OperationType } from "./types.js";
|
||||
import type { OperationContext, OperationEnv } from "./types.js";
|
||||
import type { OperationContext, OperationEnv, Identity } from "./types.js";
|
||||
import type { OperationRegistry } from "./registry.js";
|
||||
import { getLogger } from "@logtape/logtape";
|
||||
|
||||
const logger = getLogger("operations:env");
|
||||
|
||||
export interface PendingRequestMap {
|
||||
call(operationId: string, input: unknown, options?: { parentRequestId?: string; identity?: unknown }): Promise<unknown>;
|
||||
export interface CallMap {
|
||||
call(operationId: string, input: unknown, options?: { parentRequestId?: string; deadline?: number; identity?: Identity }): Promise<unknown>;
|
||||
}
|
||||
|
||||
export interface EnvOptions {
|
||||
registry: OperationRegistry;
|
||||
context: OperationContext;
|
||||
allowedNamespaces?: string[];
|
||||
callMap?: PendingRequestMap;
|
||||
callMap?: CallMap;
|
||||
}
|
||||
|
||||
export function buildEnv(options: EnvOptions): OperationEnv {
|
||||
|
||||
Reference in New Issue
Block a user