-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.d.ts
41 lines (35 loc) · 1.35 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
declare module 'react-native-blasted-image' {
import * as React from 'react';
import { ImageSourcePropType, ViewStyle, StyleProp } from 'react-native';
interface SourceProp {
uri: string;
hybridAssets?: boolean;
cloudUrl?: string | null;
}
interface BlastedImageProps {
resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
isBackground?: boolean;
fallbackSource?: ImageSourcePropType;
source: SourceProp | number;
width?: number;
height?: number;
style?: StyleProp<ViewStyle>;
onLoad?: () => void;
onError?: (error: Error) => void;
children?: React.ReactNode;
}
interface BlastedImageStatic {
clearMemoryCache(): void;
clearDiskCache(): void;
clearAllCaches(): void;
preload(input: { uri: string; skipMemoryCache?: boolean; hybridAssets?: boolean; cloudUrl?: string | null } | Array<{ uri: string; skipMemoryCache?: boolean; hybridAssets?: boolean; cloudUrl?: string | null }>): Promise<void>;
}
const BlastedImage: React.FC<BlastedImageProps> & BlastedImageStatic;
export function loadImage(
imageUrl: string,
skipMemoryCache?: boolean,
hybridAssets?: boolean,
cloudUrl?: string | null
): Promise<void>;
export default BlastedImage;
}