Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
react-native-fast-image
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
react-native-fast-image
Commits
11c7e9e8
Commit
11c7e9e8
authored
Sep 24, 2018
by
David Narbutovich
Committed by
Dylan Vann
Sep 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Flow type definitions.
* Add flow definitions * Fix export default
parent
e66d7e0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
src/index.js.flow
src/index.js.flow
+70
-0
No files found.
src/index.js.flow
0 → 100644
View file @
11c7e9e8
// @flow
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes'
import type { SyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes'
export type OnLoadEvent = SyntheticEvent<
$ReadOnly<{
width: number,
height: number,
}>,
>
export type OnProgressEvent = SyntheticEvent<
$ReadOnly<{|
loaded: number,
total: number,
|}>,
>
export type ResizeMode = $ReadOnly<{|
contain: 'contain',
cover: 'cover',
stretch: 'stretch',
center: 'center',
|}>
export type Priority = $ReadOnly<{|
low: 'low',
normal: 'normal',
high: 'high',
|}>
export type CacheControl = $ReadOnly<{|
immutable: 'immutable',
web: 'web',
cacheOnly: 'cacheOnly',
|}>
export type ResizeModes = $Values<ResizeMode>
export type Priorities = $Values<Priority>
export type CacheControls = $Values<CacheControl>
export type PreloadFn = (sources: Array<FastImageSource>) => void
export type FastImageSource = {
uri?: string,
headers?: Object,
priority?: Priorities,
cache?: CacheControls,
}
export type FastImageProps = $ReadOnly<{|
...ViewProps,
onError?: ?() => void,
onLoad?: ?(event?: OnLoadEvent) => void,
onLoadEnd?: ?() => void,
onLoadStart?: ?() => void,
onProgress?: ?(event?: OnProgressEvent) => void,
source: FastImageSource | number,
resizeMode?: ?ResizeModes,
fallback?: ?boolean,
testID?: ?string,
|}>
declare export default class FastImage extends React$Component<FastImageProps> {
static resizeMode: ResizeMode;
static priority: Priority;
static cacheControl: CacheControl;
static preload: PreloadFn;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment