From 0ea003de67dc1f94b42db5aa7f885a925f7af19f Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 3 Nov 2021 10:42:16 +0000 Subject: [PATCH 1/2] Add `fm` Fixes https://github.com/unsplash/ts-imgix/issues/16 --- src/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/index.ts b/src/index.ts index f7b218a..b63d649 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,6 +22,23 @@ export enum ImgixFit { scale = 'scale', } +export enum ImgixFormat { + avif = 'avif', + gif = 'gif', + jp2 = 'jp2', + jpg = 'jpg', + json = 'json', + jxr = 'jxr', + pjpg = 'pjpg', + mp4 = 'mp4', + png = 'png', + png8 = 'png8', + png32 = 'png32', + webm = 'webm', + webp = 'webp', + blurhash = 'blurhash', +} + // https://docs.imgix.com/apis/url/size/crop export type ImgixCrop = Partial< Record< @@ -76,6 +93,7 @@ export type ImgixUrlQueryParams = { faceindex?: number; facepad?: number; 'min-h'?: number; + fm?: ImgixFormat; }; export type QueryParamsInput = Omit & { minH?: number }; @@ -118,6 +136,7 @@ const serializeImgixUrlQueryParamValues = (query: QueryParamsInput): ParsedUrlQu faceindex: query.faceindex, facepad: query.facepad, 'min-h': query.minH, + fm: query.fm, }), catMaybesDictionary, )({}); From f4d122b84ac700f193570e7c3c054e15f725ba48 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 3 Nov 2021 10:43:19 +0000 Subject: [PATCH 2/2] v0.0.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2f547a..192c933 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "type": "git", "url": "https://github.com/unsplash/ts-imgix.git" }, - "version": "0.0.15", + "version": "0.0.16", "scripts": { "lint": "tslint --project ./tsconfig.json", "compile": "rm -rf ./target/ && rollup -c",