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.
Type Parameters
Section titled “Type Parameters”TArgs extends readonly unknown[]
TResult
Section titled “TResult”TResult
Parameters
Section titled “Parameters”module
Section titled “module”string | URL
exportName
Section titled “exportName”string
Returns
Section titled “Returns”OffloadTask<TArgs, TResult>
