Permalink
Browse files

Created types definition

  • Loading branch information...
Andrea Ascari
Andrea Ascari committed Dec 27, 2017
1 parent c508247 commit f5422f851d428c8b60ca170a682164a32ffa4bb9
Showing with 56 additions and 0 deletions.
  1. +56 −0 index.d.ts
View
@@ -0,0 +1,56 @@
import * as React from 'react';
import { ObjectOverwrite } from 'typelevel-ts';
import { ImageProperties, ImageStatic } from 'react-native';
declare namespace FastImage {
export namespace priority {
type low = 'low';
type normal = 'normal';
type high = 'high';
}
type priority =
FastImage.priority.low |
FastImage.priority.normal |
FastImage.priority.high;
export namespace resizeMode {
type contain = 'contain';
type cover = 'cover';
type stretch = 'stretch';
type center = 'center';
}
export type resizeMode =
FastImage.resizeMode.contain |
FastImage.resizeMode.cover |
FastImage.resizeMode.stretch |
FastImage.resizeMode.center
}
export type FastImageSource = {
uri?: string,
headers?: object;
priority?: FastImage.priority;
};
export type FastImageProperties = ObjectOverwrite<ImageProperties, {
source: FastImageSource | number,
resizeMode?: FastImage.resizeMode;
onLoadStart?(): void;
onprogress?(event: any): void;
onLoad?(): void;
onError?(): void;
onLoadEnd?(): void;
}>;
interface FastImageStatic extends React.ComponentClass<FastImageProperties> {
resizeMode: FastImage.resizeMode;
preload(sources: Array<FastImageProperties['source']>): void;
}
declare var FastImage: FastImageStatic;
type FastImage = FastImageStatic;
export default FastImage;

0 comments on commit f5422f8

Please sign in to comment.