forked from zWingz/react-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
48 lines (46 loc) · 1.4 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ImgHTMLAttributes, CSSProperties, PureComponent } from 'react'
import { ObjectFitProperty } from 'csstype'
declare module '@zzwing/react-image' {
export type iImageProp = {
src: string
height?: string | number
width?: string | number
style?: CSSProperties
group?: string | number
objectFit?: ObjectFitProperty
preview?: boolean
imgProps?: ImgHTMLAttributes<any>
mask?: boolean
onClick?: (src: string) => void
onError?: (src: string) => void
onLoad?: (src: string) => void
onDelete?: (src: string) => void
className?: string
observer?: IntersectionObserver
showPreviewList?: boolean
}
export class Image extends PureComponent<iImageProp> {}
export interface PreviewInterface {
(current: number | string, list?: string[], showList?: boolean): void
}
export interface PreviewInstance {
preview: PreviewInterface
show: () => void
hide: () => void
component: ImgPpreview
destroy: () => void
}
export interface PreviewInstanceCallback {
(Instance: PreviewInstance): void
}
export default class ImgPpreview extends PureComponent {
static newInstance: (callback: PreviewInstanceCallback) => void
}
export const PreviewApi: {
destroy: () => void
preview: PreviewInterface
show: () => void
hide: () => void
}
export function createObserver(container?: HTMLElement): IntersectionObserver
}