parallel_hasher.d.ts 639 B

12345678910111213141516171819202122
  1. export interface WorkerOptions {
  2. credentials?: 'omit' | 'same-origin' | 'include';
  3. name?: string;
  4. type?: 'classic' | 'module';
  5. }
  6. export declare class ParallelHasher {
  7. private _queue;
  8. private _hashWorker;
  9. private _processing?;
  10. private _ready;
  11. constructor(workerUri: string, workerOptions?: WorkerOptions);
  12. /**
  13. * Hash a blob of data in the worker
  14. * @param blob Data to hash
  15. * @returns Promise of the Hashed result
  16. */
  17. hash(blob: any): Promise<unknown>;
  18. /** Terminate any existing hash requests */
  19. terminate(): void;
  20. private _processNext;
  21. private _recievedMessage;
  22. }