File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { UrlOptionsPath , UrlOptionsSrc } from ' imagekit-javascript/dist/src/interfaces/UrlOptions' ;
2- import { InferProps } from ' prop-types' ;
1+ import { UrlOptionsPath , UrlOptionsSrc } from " imagekit-javascript/dist/src/interfaces/UrlOptions" ;
2+ import { InferProps } from " prop-types" ;
33import COMMON_PROPS from "../IKContext/props" ;
4- import Props from ' ./props' ;
4+ import Props from " ./props" ;
55
66const COMBINED_IMAGE_PROP_TYPES = {
7- ...COMMON_PROPS ,
8- ...Props
7+ ...COMMON_PROPS ,
8+ ...Props ,
9+ } ;
10+
11+ type Lqip = {
12+ active ?: boolean ;
13+ quality ?: number ;
14+ threshold ?: number ;
15+ blur ?: number ;
16+ raw ?: string ;
17+ } | null ;
18+
19+ export type IKImageProps = Omit < InferProps < typeof COMBINED_IMAGE_PROP_TYPES > , "src" | "path" | "lqip" > &
20+ ( UrlOptionsPath | UrlOptionsSrc ) &
21+ React . ImgHTMLAttributes < HTMLImageElement > & {
22+ lqip ?: Lqip ;
23+ loading ?: 'lazy' ;
924 } ;
10-
11- export type IKImageProps = Omit < InferProps < typeof COMBINED_IMAGE_PROP_TYPES > , 'src' | 'path' > & ( UrlOptionsPath | UrlOptionsSrc ) & React . ImgHTMLAttributes < HTMLImageElement > ;
1225
13- export type IKImageBaseProps = InferProps < typeof Props > ;
14-
15- export default COMBINED_IMAGE_PROP_TYPES ;
26+ export type IKImageBaseProps = Omit < InferProps < typeof Props > , "lqip" > & {
27+ lqip ?: Lqip ;
28+ loading ?: 'lazy' ;
29+ } ;
30+
31+ export default COMBINED_IMAGE_PROP_TYPES ;
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const Props = {
5757 overwriteAITags : PropTypes . bool ,
5858 overwriteTags : PropTypes . bool ,
5959 overwriteCustomMetadata : PropTypes . bool ,
60- customMetadata : PropTypes . any ,
60+ customMetadata : PropTypes . oneOf ( [ PropTypes . string , PropTypes . object ] ) ,
6161 onError : PropTypes . func ,
6262 onSuccess : PropTypes . func ,
6363 onUploadStart : PropTypes . func ,
@@ -67,7 +67,7 @@ const Props = {
6767 transformation : PropTypes . object ,
6868}
6969
70- export type IKUploadProps = InferProps < typeof Props > & {
70+ export type IKUploadProps = Omit < InferProps < typeof Props > , "customMetadata" | "transformation" > & {
7171 useUniqueFileName ?: boolean ;
7272 tags ?: Array < string > ;
7373 folder ?: string ;
You can’t perform that action at this time.
0 commit comments