UNPKG

synckit

Version:

Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.

8 lines (7 loc) 424 B
import type { AnyFn, Syncify, SynckitOptions } from './types.js'; export * from './common.js'; export * from './constants.js'; export * from './helpers.js'; export * from './types.js'; export declare function createSyncFn<T extends AnyFn>(workerPath: URL | string, timeoutOrOptions?: SynckitOptions | number): Syncify<T>; export declare function runAsWorker<T extends AnyFn<Promise<R> | R>, R = ReturnType<T>>(fn: T): void;