mirror of
https://github.com/zoriya/libpgs-js.git
synced 2026-08-27 00:00:51 +00:00
Not for upstream: this branch only exists so a consumer can depend on the fork straight from git while the `ready` promise waits on a release.
33 lines
1004 B
TypeScript
33 lines
1004 B
TypeScript
import { PgsRendererImpl } from "./pgsRendererImpl";
|
|
import { PgsRendererOptions } from "./pgsRendererOptions";
|
|
/**
|
|
* The base implementation for a pgs renderer in side a worker.
|
|
*/
|
|
export declare abstract class PgsRendererInWorker extends PgsRendererImpl {
|
|
protected constructor(options: PgsRendererOptions);
|
|
loadFromUrl(url: string): Promise<void>;
|
|
loadFromBuffer(buffer: ArrayBuffer): Promise<void>;
|
|
/**
|
|
* The background worker.
|
|
*/
|
|
protected readonly worker: Worker;
|
|
/**
|
|
* The loads the worker still has to answer, in the order it answers them.
|
|
*/
|
|
private readonly pendingLoads;
|
|
/**
|
|
* Handles messages from the worker.
|
|
* @param e The event message.
|
|
*/
|
|
private readonly $onWorkerMessage;
|
|
/**
|
|
* Handles messages from the worker.
|
|
* @param e The event message.
|
|
*/
|
|
protected onWorkerMessage(e: MessageEvent): void;
|
|
/**
|
|
* Disposes the renderer and terminates the worker.
|
|
*/
|
|
dispose(): void;
|
|
}
|