AsyncDisposable
Defined in: src/core/disposable.ts:191
Base class for async disposable PDFium resources.
Use this when disposal requires async operations, such as communicating with a worker thread.
Example
Section titled “Example”{ await using worker = await PDFiumWorker.create(); // Work with worker} // Automatically disposed hereExtends
Section titled “Extends”DisposableBase
Extended by
Section titled “Extended by”Implements
Section titled “Implements”AsyncDisposable
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AsyncDisposable(
resourceName,disposedErrorCode):AsyncDisposable
Defined in: src/core/disposable.ts:62
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
resourceName | string | undefined |
disposedErrorCode | PDFiumErrorCode | PDFiumErrorCode.RESOURCE_DISPOSED |
Returns
Section titled “Returns”AsyncDisposable
Inherited from
Section titled “Inherited from”DisposableBase.constructor
Accessors
Section titled “Accessors”disposed
Section titled “disposed”Get Signature
Section titled “Get Signature”get disposed():
boolean
Defined in: src/core/disposable.ts:73
Whether this resource has been disposed.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”DisposableBase.disposed
Methods
Section titled “Methods”[asyncDispose]()
Section titled “[asyncDispose]()”[asyncDispose]():
Promise<void>
Defined in: src/core/disposable.ts:195
Asynchronously dispose of this resource.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”globalThis.AsyncDisposable.[asyncDispose]
dispose()
Section titled “dispose()”dispose():
Promise<void>
Defined in: src/core/disposable.ts:206
Alias for Symbol.asyncDispose for explicit calls.
Returns
Section titled “Returns”Promise<void>