ExtractJob
Defined in: packages/sdk/src/extract-job.ts:117
An extraction in progress, from Document.extractJob. It holds WebAssembly memory and is
freed with its document, or earlier with free() or using.
0.2.0
Extends
Section titled “Extends”Handle<BaseGlue>
Type Parameters
Section titled “Type Parameters”F extends ExtractFormat = ExtractFormat
Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose](): void;Defined in: packages/sdk/src/internal/handle.ts:124
Frees the handle at the end of a using block (an alias of free()).
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Handle.[dispose]
cancel()
Section titled “cancel()”cancel(): void;Defined in: packages/sdk/src/extract-job.ts:162
Stops the job: its next step fails with cancelled.
Returns
Section titled “Returns”void
0.2.0
free()
Section titled “free()”free(): void;Defined in: packages/sdk/src/internal/handle.ts:115
Frees the handle’s memory now; without it, the garbage collector frees it later. A second
call does nothing, and any other call afterwards throws disposed. Prefer using, which
calls this at the end of the block.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Handle.free
provide()
Section titled “provide()”provide(result): void;Defined in: packages/sdk/src/extract-job.ts:153
Hands the job the result of its open request.
Parameters
Section titled “Parameters”result
Section titled “result”Returns
Section titled “Returns”void
Throws
Section titled “Throws”LaminaPdfError model-result-unexpected when nothing was asked for or result
is the other model’s; invalid-argument / unknown-option for a malformed result.
0.2.0
step()
Section titled “step()”step(budget?): ExtractStep<F>;Defined in: packages/sdk/src/extract-job.ts:138
Extracts up to budget pages. While a model’s result is awaited, the step returns
{ state: "progress", phase: "model", request } and does nothing more until
provide answers it.
Parameters
Section titled “Parameters”budget?
Section titled “budget?”number = 1
Returns
Section titled “Returns”ExtractStep<F>
progress, or { state: "done", output } with the output in the job’s format.
Throws
Section titled “Throws”LaminaPdfError cancelled, document-changed, job-finished, the reading errors.
0.2.0