Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Add fm
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
OliverJAsh committed Nov 3, 2021
1 parent f5b4856 commit 0ea003d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down Expand Up @@ -76,6 +93,7 @@ export type ImgixUrlQueryParams = {
faceindex?: number;
facepad?: number;
'min-h'?: number;
fm?: ImgixFormat;
};

export type QueryParamsInput = Omit<ImgixUrlQueryParams, 'min-h'> & { minH?: number };
Expand Down Expand Up @@ -118,6 +136,7 @@ const serializeImgixUrlQueryParamValues = (query: QueryParamsInput): ParsedUrlQu
faceindex: query.faceindex,
facepad: query.facepad,
'min-h': query.minH,
fm: query.fm,
}),
catMaybesDictionary,
)({});
Expand Down

0 comments on commit 0ea003d

Please sign in to comment.