import type { ByteSource } from '../../io/types.ts'; import { IOResult } from '../../io/types.ts'; import type { LanguageRuntime } from '../../runtime/language.ts'; import type { DispatchFn } from '../../runtime/types.ts'; import { PathSpec } from '../../types.ts'; import { ExecutionNode } from '../types.ts'; type Result = [ByteSource | null, IOResult, ExecutionNode]; interface InterpreterDeps { runtime: LanguageRuntime; } interface InterpreterOpts { stdin: ByteSource | null; env: Record; code: string | null; prog?: string; flags?: Record; transformSource?: (code: string) => string; refuse?: (runtime: LanguageRuntime) => string | null; signal?: AbortSignal; timeoutSeconds?: number; } export interface InterpreterSpec { label: string; payloadFlag: string; isUnavailable: (err: unknown) => boolean; } export type InterpreterHandler = (dispatch: DispatchFn, pathScope: PathSpec | null, args: string[], opts: InterpreterOpts, deps: InterpreterDeps) => Promise; /** * Build an interpreter command handler. * * @param spec - the label, payload flag and unavailable-error test that * distinguish one interpreter from another. */ export declare function makeInterpreterHandler(spec: InterpreterSpec): InterpreterHandler; export {}; //# sourceMappingURL=interpreter.d.ts.map