File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 11/**
22 * @see {@link https://docs.imagekit.io/features/image-transformations }
33 */
4- const supportedTransforms : { [ key : string ] : string } = {
4+ const supportedTransforms = {
55 /**
66 * @see {@link https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#width-w }
77 */
@@ -286,4 +286,5 @@ const supportedTransforms: { [key: string]: string } = {
286286 original : "orig" ,
287287} ;
288288
289- export default supportedTransforms ;
289+ export default supportedTransforms as { [ key : string ] : string } ;
290+ export type SupportedTransformsType = keyof typeof supportedTransforms ;
Original file line number Diff line number Diff line change 1- import supportedTransforms from "../constants/supportedTransforms" ;
1+ import { SupportedTransformsType } from "../constants/supportedTransforms" ;
22
33export type TransformationPosition = "path" | "query" ;
44
55export type Transformation = Partial <
66 | {
7- [ key in keyof typeof supportedTransforms ] : string | boolean | number ;
7+ [ key in SupportedTransformsType ] : string | boolean | number ;
88 }
9- | { [ key : string ] : string | string | boolean | number }
9+ | { [ key : string ] : string | boolean | number }
1010> ;
Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ const buildURL = function (opts: FinalUrlOptions): string {
113113 return url . format ( urlObject ) ;
114114} ;
115115
116- function constructTransformationString ( transformation : Array < Transformation > | undefined ) {
116+ function constructTransformationString ( inputTransformation : Array < Transformation > | undefined ) {
117+
118+ const transformation = inputTransformation as Array < { [ key : string ] : string | boolean | number } > | undefined ;
117119 if ( ! Array . isArray ( transformation ) ) {
118120 return "" ;
119121 }
You can’t perform that action at this time.
0 commit comments