Skip to content

Commit

Permalink
fix: import Buffer type
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham committed Sep 8, 2024
1 parent ae29497 commit 8d53936
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions types/procreate-swatches.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { Buffer } from "node:buffer";

type ColorSpace = "rgb" | "hsl" | "hsv" | "hwb" | "xyz" | "lab" | "lch";
type Colors = [number[], ColorSpace][];

export function readSwatchesFile(
data: string | Uint8Array | ArrayBuffer | Blob,
colorSpace?: ColorSpace
colorSpace?: ColorSpace,
): Promise<{
name: string;
colors: Colors;
Expand All @@ -21,11 +23,11 @@ type SwatchReturnType = {
};

export function createSwatchesFile<
F extends keyof SwatchReturnType | undefined = undefined
F extends keyof SwatchReturnType | undefined = undefined,
>(
name: string,
colors: Colors,
format?: F
format?: F,
): Promise<F extends keyof SwatchReturnType ? SwatchReturnType[F] : Uint8Array>;

interface ProcreateSwatchesError extends Error {
Expand Down

0 comments on commit 8d53936

Please sign in to comment.