import { System } from './system'; import { ChannelMethods, RequestChannel } from './task_channels'; /** Should the task be run in the same or a different process. */ export declare enum TaskProcess { /** Run the task consumer in the same process. */ IN_PROCESS = 0, /** Run the task consumer in another process. */ OUT_OF_PROCESS = 1 } export interface HandshakeRequest { readyAsync(): Promise; } export interface TeardownRequest { teardownAsync(): Promise; } /** Task creation options */ interface Options { /** Should the task be run in the same process or an external process. */ process: TaskProcess; /** * Absolute path without file extension to the a file that injects methods * into data sent by producer. */ bridgePath: string; /** Absolute path without file extension to the entry to the task consumer. */ entryPath: string; } export declare function resolveBuiltinModuleAsync(sys: System, workingdir: string, ...modulePath: string[]): Promise; /** * Create a task consumer for some work. * * @param sys Host system * @param producer Representation of the task producer to the task consumer * @param options Task options */ export declare function createTaskAsync & HandshakeRequest, Consumer extends ChannelMethods & TeardownRequest>(sys: System, producer: Producer, { process, bridgePath, entryPath }: Options): Promise>; export {};