From 1106cbbba7684bd82361cccfc65ce4820fa7cca4 Mon Sep 17 00:00:00 2001 From: Mikkel Schmidt Date: Tue, 17 Dec 2024 02:18:55 +0100 Subject: [PATCH] Move tailwind types to separate definition --- src/helpers.d.ts | 21 ++------------------- src/lib-tailwind.d.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 src/lib-tailwind.d.ts diff --git a/src/helpers.d.ts b/src/helpers.d.ts index 812a938ca..7f43e4965 100644 --- a/src/helpers.d.ts +++ b/src/helpers.d.ts @@ -1,7 +1,9 @@ type Unpacked = T extends Array ? U : T extends ReadonlyArray ? U : T; +// eslint-disable-next-line camelcase declare const __nominal__type: unique symbol; type Nominal = Type & { + // eslint-disable-next-line camelcase readonly [__nominal__type]: Identifier; }; @@ -63,22 +65,3 @@ type GitVersion = `${number}.${number}.${number}${`-${number}` | ``}${`-${string type GCode = Nominal; type ReactCallback = ReturnType>; - -declare module 'tailwindcss/lib/util/flattenColorPalette' { - export default function flattenColorPalette( - colors: Record>, - ): Record; -} - -declare module 'tailwindcss/lib/util/color' { - export const parseColor: (color: string) => { - mode: 'hsl' | 'rgb' | 'hsla' | 'rgba'; - color: [number, number, number]; - alpha?: string; - }; - export const formatColor: (color: { - mode: 'hsl' | 'rgb' | 'hsla' | 'rgba'; - color: [number, number, number]; - alpha?: string; - }) => string; -} diff --git a/src/lib-tailwind.d.ts b/src/lib-tailwind.d.ts new file mode 100644 index 000000000..f96d02611 --- /dev/null +++ b/src/lib-tailwind.d.ts @@ -0,0 +1,18 @@ +declare module 'tailwindcss/lib/util/flattenColorPalette' { + export default function flattenColorPalette( + colors: Record>, + ): Record; +} + +declare module 'tailwindcss/lib/util/color' { + export const parseColor: (color: string) => { + mode: 'hsl' | 'rgb' | 'hsla' | 'rgba'; + color: [number, number, number]; + alpha?: string; + }; + export const formatColor: (color: { + mode: 'hsl' | 'rgb' | 'hsla' | 'rgba'; + color: [number, number, number]; + alpha?: string; + }) => string; +}