react-native-fast-image 8.5.5 → 8.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/index.cjs.js.flow +73 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -19,10 +19,18 @@ Performant React Native image component.
|
|
|
19
19
|
|
|
20
20
|
<p align="center" >
|
|
21
21
|
<kbd>
|
|
22
|
-
<img
|
|
22
|
+
<img
|
|
23
|
+
src="https://github.com/DylanVann/react-native-fast-image/blob/main/docs/assets/scroll.gif?raw=true"
|
|
24
|
+
title="Scroll Demo"
|
|
25
|
+
float="left"
|
|
26
|
+
>
|
|
23
27
|
</kbd>
|
|
24
28
|
<kbd>
|
|
25
|
-
<img
|
|
29
|
+
<img
|
|
30
|
+
src="https://github.com/DylanVann/react-native-fast-image/blob/main/docs/assets/priority.gif?raw=true"
|
|
31
|
+
title="Priority Demo"
|
|
32
|
+
float="left"
|
|
33
|
+
>
|
|
26
34
|
</kbd>
|
|
27
35
|
<br>
|
|
28
36
|
<em>FastImage example app.</em>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes'
|
|
4
|
+
import type { SyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes'
|
|
5
|
+
|
|
6
|
+
export type OnLoadEvent = SyntheticEvent<
|
|
7
|
+
$ReadOnly<{
|
|
8
|
+
width: number,
|
|
9
|
+
height: number,
|
|
10
|
+
}>,
|
|
11
|
+
>
|
|
12
|
+
|
|
13
|
+
export type OnProgressEvent = SyntheticEvent<
|
|
14
|
+
$ReadOnly<{|
|
|
15
|
+
loaded: number,
|
|
16
|
+
total: number,
|
|
17
|
+
|}>,
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
export type ResizeMode = $ReadOnly<{|
|
|
21
|
+
contain: 'contain',
|
|
22
|
+
cover: 'cover',
|
|
23
|
+
stretch: 'stretch',
|
|
24
|
+
center: 'center',
|
|
25
|
+
|}>
|
|
26
|
+
|
|
27
|
+
export type Priority = $ReadOnly<{|
|
|
28
|
+
low: 'low',
|
|
29
|
+
normal: 'normal',
|
|
30
|
+
high: 'high',
|
|
31
|
+
|}>
|
|
32
|
+
|
|
33
|
+
export type CacheControl = $ReadOnly<{|
|
|
34
|
+
immutable: 'immutable',
|
|
35
|
+
web: 'web',
|
|
36
|
+
cacheOnly: 'cacheOnly',
|
|
37
|
+
|}>
|
|
38
|
+
|
|
39
|
+
export type ResizeModes = $Values<ResizeMode>
|
|
40
|
+
export type Priorities = $Values<Priority>
|
|
41
|
+
export type CacheControls = $Values<CacheControl>
|
|
42
|
+
|
|
43
|
+
export type PreloadFn = (sources: Array<FastImageSource>) => void
|
|
44
|
+
export type FastImageSource = {
|
|
45
|
+
uri?: string,
|
|
46
|
+
headers?: Object,
|
|
47
|
+
priority?: Priorities,
|
|
48
|
+
cache?: CacheControls,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type FastImageProps = $ReadOnly<{|
|
|
52
|
+
...ViewProps,
|
|
53
|
+
onError?: ?() => void,
|
|
54
|
+
onLoad?: ?(event: OnLoadEvent) => void,
|
|
55
|
+
onLoadEnd?: ?() => void,
|
|
56
|
+
onLoadStart?: ?() => void,
|
|
57
|
+
onProgress?: ?(event: OnProgressEvent) => void,
|
|
58
|
+
|
|
59
|
+
source: FastImageSource | number,
|
|
60
|
+
|
|
61
|
+
resizeMode?: ?ResizeModes,
|
|
62
|
+
fallback?: ?boolean,
|
|
63
|
+
testID?: ?string,
|
|
64
|
+
|}>
|
|
65
|
+
|
|
66
|
+
declare export default class FastImage extends React$Component<FastImageProps> {
|
|
67
|
+
static resizeMode: ResizeMode;
|
|
68
|
+
static priority: Priority;
|
|
69
|
+
static cacheControl: CacheControl;
|
|
70
|
+
static preload: PreloadFn;
|
|
71
|
+
static clearMemoryCache: () => Promise<void>;
|
|
72
|
+
static clearDiskCache: () => Promise<void>;
|
|
73
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyle, AccessibilityProps } from 'react-native';
|
|
2
|
+
import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyle, AccessibilityProps, ViewProps } from 'react-native';
|
|
3
3
|
export declare type ResizeMode = 'contain' | 'cover' | 'stretch' | 'center';
|
|
4
4
|
declare const resizeMode: {
|
|
5
5
|
readonly contain: "contain";
|
|
@@ -53,7 +53,7 @@ export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {
|
|
|
53
53
|
tintColor?: string;
|
|
54
54
|
opacity?: number;
|
|
55
55
|
}
|
|
56
|
-
export interface FastImageProps extends AccessibilityProps {
|
|
56
|
+
export interface FastImageProps extends AccessibilityProps, ViewProps {
|
|
57
57
|
source: Source | number;
|
|
58
58
|
resizeMode?: ResizeMode;
|
|
59
59
|
fallback?: boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAC/C,OAAO,EAMH,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAC/C,OAAO,EAMH,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,SAAS,EACZ,MAAM,cAAc,CAAA;AAIrB,oBAAY,UAAU,GAAG,SA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}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-fast-image",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.9",
|
|
4
4
|
"description": "🚩 FastImage, performant React Native image component.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cache",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"RNFastImage.podspec"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "dv-scripts build && cp src/index.js.flow dist/index.js.flow",
|
|
34
|
+
"build": "dv-scripts build && cp src/index.js.flow dist/index.js.flow && cp src/index.js.flow dist/index.cjs.js.flow",
|
|
35
35
|
"lint": "dv-scripts lint",
|
|
36
36
|
"release": "dv-scripts release",
|
|
37
37
|
"test": "dv-scripts test"
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"extends": "dv-scripts"
|
|
47
47
|
},
|
|
48
48
|
"jest": {
|
|
49
|
+
"coveragePathIgnorePatterns": [
|
|
50
|
+
"ReactNativeFastImageExample*",
|
|
51
|
+
"ReactNativeFastImageExampleServer*"
|
|
52
|
+
],
|
|
49
53
|
"modulePathIgnorePatterns": [
|
|
50
54
|
"ReactNativeFastImageExample*",
|
|
51
55
|
"ReactNativeFastImageExampleServer*"
|