Skip to content

Commit

Permalink
Fix typings for enums.
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVann committed Feb 1, 2018
1 parent 050a0de commit 82ce824
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyl

declare namespace FastImage {

export namespace priority {
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 {
namespace resizeMode {
type contain = 'contain'
type cover = 'cover'
type stretch = 'stretch'
type center = 'center'
}

export type resizeMode =
export type Priority =
FastImage.priority.low |
FastImage.priority.normal |
FastImage.priority.high

export type ResizeMode =
FastImage.resizeMode.contain |
FastImage.resizeMode.cover |
FastImage.resizeMode.stretch |
Expand All @@ -31,7 +31,7 @@ declare namespace FastImage {
export type FastImageSource = {
uri?: string,
headers?: object
priority?: FastImage.priority
priority?: FastImage.Priority
}

export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {
Expand All @@ -45,7 +45,7 @@ export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {

export interface FastImageProperties {
source: FastImageSource | number
resizeMode?: FastImage.resizeMode
resizeMode?: FastImage.ResizeMode

onLoadStart?(): void

Expand Down Expand Up @@ -79,8 +79,18 @@ export interface FastImageProperties {
}

interface FastImageStatic extends React.ComponentClass<FastImageProperties> {
resizeMode: FastImage.resizeMode
priority: FastImage.priority
resizeMode: {
contain: FastImage.resizeMode.contain
cover: FastImage.resizeMode.cover
stretch: FastImage.resizeMode.stretch
center: FastImage.resizeMode.center
}

priority: {
low: FastImage.priority.low
normal: FastImage.priority.normal
high: FastImage.priority.high
}

preload(sources: FastImageSource[]): void
}
Expand Down

0 comments on commit 82ce824

Please sign in to comment.