콘텐츠로 이동
한국어

defineOffloadTask

이 콘텐츠는 아직 번역되지 않았습니다.

defineOffloadTask<TArgs, TResult>(module, exportName): OffloadTask<TArgs, TResult>

Defined in: src/worker/OffloadTask.ts:29

Name a task. Resolve the module against the caller, as in defineOffloadTask(new URL('./hash.js', import.meta.url), 'hashPassword'); a bundler that inlines modules is the one environment this does not survive, and the docs say so. The type parameters are what pool.run checks the arguments and the result against.

TArgs extends readonly unknown[]

TResult

string | URL

string

OffloadTask<TArgs, TResult>