From 73fc2cf631c230478d4fd4b5a2c13229fb1cb86f Mon Sep 17 00:00:00 2001 From: Josip Igrec Date: Mon, 14 Aug 2023 02:55:43 +0200 Subject: [PATCH] Fix missing dependency --- src/utils/kset-image.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/kset-image.ts b/src/utils/kset-image.ts index 73c5d74..d100a6e 100644 --- a/src/utils/kset-image.ts +++ b/src/utils/kset-image.ts @@ -46,7 +46,7 @@ export const srcVariant = < export const urlVariant = < TSrc extends Src, - TVariant extends string | null, + TVariant extends DefaultUrlVariants | string | null, TRet extends CssUrl, >( thumbSrc: TSrc, @@ -59,9 +59,15 @@ export const urlVariant = < return `url(${srcVariant(thumbSrc, variant)})` as const; }; +export enum DefaultUrlVariants { + Thumb = "fb_thumb", + Medium = "medium", + Original = "", +} + export const urlVariants = < TSrc extends Src, - TVariant extends string | null, + TVariant extends DefaultUrlVariants | string | null, TRet extends TSrc extends string ? string : null, >( thumbSrc: TSrc,