Skip to content

Commit

Permalink
Fix worker return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Namide committed Dec 6, 2024
1 parent 6bf3e5f commit 678ef03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/workerWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import WorkerWrapper from "./worker?worker&inline";
import cleanInputs, { testInputs } from "./extract/cleanInputs";
import { BrowserOptions, ImageDataAlt } from "./types/Options";
import type { BrowserOptions, ImageDataAlt } from "./types/Options";
import type { FinalColor } from "./types/Color";

/**
* Extract colors from a picture with Web Worker support.
Expand Down Expand Up @@ -40,7 +41,7 @@ export const extractColors = (
cleanInputs(options);

// Wrap worker inside Promise
return new Promise((resolve, reject) => {
return new Promise<FinalColor[]>((resolve, reject) => {
try {
const worker: Worker = new WorkerWrapper();
worker.postMessage([
Expand Down

0 comments on commit 678ef03

Please sign in to comment.