import { Subject } from 'rxjs'; import { IImgstryThread, IThreadData, IThreadResult } from '../../../core/imgstry.thread'; import { IDisposable } from '../../../types'; /** * Browser thread option contract. * * @export * @interface ImgstryThreadOptions */ export interface ImgstryThreadOptions { isEnabled?: boolean; isDebugEnabled?: boolean; } /** * Thread communication layer for the browser. * * @export * @class ImgstryThread * @implements {IImgstryThread} * @implements {IDisposable} * @ignore */ export declare class ImgstryThread implements IImgstryThread, IDisposable { process$: Subject; private _disposed$; private _worker; private _logger; /** * Creates an instance of ImgstryThread. * @param {ImgstryThreadOptions} _options The thread options. * @memberof ImgstryThread {isEnabled, isDebugEnabled} * @constructor */ constructor(_options: ImgstryThreadOptions); /** * Queues a new set of operations, throttled @ 250ms. * * @param {IThreadData} data { * imageData, * operations, * } * @returns {Promise} A promise with the resulting image. * @memberof ImgstryThread */ run({ imageData, operations, }: IThreadData): Promise; /** * Terminates the current worker thread and completes active streams. * * @memberof ImgstryThread * @returns {void} */ dispose(): void; private _handleMessage; private _handleError; }