UNPKG

woolball-client

Version:

Client-side library for Woolball enabling secure browser resource sharing for distributed AI task processing

25 lines (24 loc) 939 B
import { TaskType } from '../utils/tasks'; type NodeWorker = any; /** * Creates a Node.js worker thread from the worker code * @param workerCode The worker code as a string * @returns A Promise that resolves with the worker thread */ export declare function createNodeWorker(workerCode: string): Promise<NodeWorker>; /** * Process a task using a Node.js worker thread * @param type The task type * @param workerCode The worker code as a string * @param data The task data * @returns A Promise that resolves with the task result */ export declare function processWithNodeWorker(type: TaskType, workerCode: string, data: any): Promise<any>; /** * Process a task directly without using a Node.js worker thread * @param type The task type * @param data The task data * @returns A Promise that resolves with the task result */ export declare function processWithoutNodeWorker(type: TaskType, data: any): Promise<any>; export {};