1 | import React from 'react';
|
2 | import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyle, ImageRequireSource, AccessibilityProps, ViewProps, ColorValue } from 'react-native';
|
3 | export declare type ResizeMode = 'contain' | 'cover' | 'stretch' | 'center';
|
4 | declare const resizeMode: {
|
5 | readonly contain: "contain";
|
6 | readonly cover: "cover";
|
7 | readonly stretch: "stretch";
|
8 | readonly center: "center";
|
9 | };
|
10 | export declare type Priority = 'low' | 'normal' | 'high';
|
11 | declare const priority: {
|
12 | readonly low: "low";
|
13 | readonly normal: "normal";
|
14 | readonly high: "high";
|
15 | };
|
16 | declare type Cache = 'immutable' | 'web' | 'cacheOnly';
|
17 | declare const cacheControl: {
|
18 | readonly immutable: "immutable";
|
19 | readonly web: "web";
|
20 | readonly cacheOnly: "cacheOnly";
|
21 | };
|
22 | export declare type Source = {
|
23 | uri?: string;
|
24 | headers?: {
|
25 | [key: string]: string;
|
26 | };
|
27 | priority?: Priority;
|
28 | cache?: Cache;
|
29 | };
|
30 | export interface OnLoadEvent {
|
31 | nativeEvent: {
|
32 | width: number;
|
33 | height: number;
|
34 | };
|
35 | }
|
36 | export interface OnProgressEvent {
|
37 | nativeEvent: {
|
38 | loaded: number;
|
39 | total: number;
|
40 | };
|
41 | }
|
42 | export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {
|
43 | backfaceVisibility?: 'visible' | 'hidden';
|
44 | borderBottomLeftRadius?: number;
|
45 | borderBottomRightRadius?: number;
|
46 | backgroundColor?: string;
|
47 | borderColor?: string;
|
48 | borderWidth?: number;
|
49 | borderRadius?: number;
|
50 | borderTopLeftRadius?: number;
|
51 | borderTopRightRadius?: number;
|
52 | overlayColor?: string;
|
53 | opacity?: number;
|
54 | }
|
55 | export interface FastImageProps extends AccessibilityProps, ViewProps {
|
56 | source?: Source | ImageRequireSource;
|
57 | defaultSource?: ImageRequireSource;
|
58 | resizeMode?: ResizeMode;
|
59 | fallback?: boolean;
|
60 | onLoadStart?(): void;
|
61 | onProgress?(event: OnProgressEvent): void;
|
62 | onLoad?(event: OnLoadEvent): void;
|
63 | onError?(): void;
|
64 | onLoadEnd?(): void;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | onLayout?: (event: LayoutChangeEvent) => void;
|
73 | |
74 |
|
75 |
|
76 |
|
77 | style?: StyleProp<ImageStyle>;
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 | tintColor?: ColorValue;
|
84 | |
85 |
|
86 |
|
87 | testID?: string;
|
88 | |
89 |
|
90 |
|
91 | children?: React.ReactNode;
|
92 | }
|
93 | export interface FastImageStaticProperties {
|
94 | resizeMode: typeof resizeMode;
|
95 | priority: typeof priority;
|
96 | cacheControl: typeof cacheControl;
|
97 | preload: (sources: Source[]) => void;
|
98 | clearMemoryCache: () => Promise<void>;
|
99 | clearDiskCache: () => Promise<void>;
|
100 | }
|
101 | declare const FastImage: React.ComponentType<FastImageProps> & FastImageStaticProperties;
|
102 | export default FastImage;
|
103 |
|
\ | No newline at end of file |