-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
76 lines (60 loc) · 1.97 KB
/
index.d.ts
File metadata and controls
76 lines (60 loc) · 1.97 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import React from "react"
import { NativeMethods } from "react-native"
import { Constructor } from "react-native"
import { ViewProps } from "react-native"
type CompressFormat = "jpeg" | "png"
type Priority = "low" | "normal" | "high"
type ResizeMode = "contain" | "cover"
type DiskCacheStrategy = "automatic" | "all" | "none" | "data" | "resource"
type ScaleType = "contain" | "cover"
type ImageError = {
error?:string | null
}
type ImageSuccess = {
width?:number,
height?:number
}
type ImageResult = {
image?:string
}
type EventImageError = {
nativeEvent?:ImageError | null,
}
type EventImageSuccess = {
nativeEvent?:ImageSuccess | null,
}
interface ImageCallBack extends ImageSuccess , ImageError , ImageResult {
}
interface SourceBase {
uri?:string
headers?:Object | null,
priority?:Priority,
width?:number | null,
height?:number | null,
resizeMode?: ResizeMode,
skipMemoryCache?:boolean | null,
diskCacheStrategy?:DiskCacheStrategy,
}
interface ImageSource extends SourceBase{
asGif?:boolean | null,
placeholder?:string | null,
}
interface ImageProps extends ViewProps {
source: ImageSource | null
scaleType?:ScaleType;
translateZ?:number
onLoadStart?:() => void | null;
onLoadEnd?:() => void | null;
onLoadError?:(event:EventImageError) => void | null;
onLoadSuccess?:(event:EventImageSuccess) => void | null;
}
declare class ImageComponent extends React.Component<ImageProps> {}
declare const ImageBase: Constructor<NativeMethods> & typeof ImageComponent;
export class CachedImage extends ImageBase {}
export class DrawableImage extends ImageBase {}
export class Controller {
static clearMemoryCache():Promise<boolean>
static requestImage(ref:CachedImage | DrawableImage | undefined | null,format?:CompressFormat,quality?:number): Promise<string>
static clear(ref: CachedImage | DrawableImage | undefined | null): void
static get(data: SourceBase, cb:(result:ImageCallBack)=> void): void
}