refactor(web): improve types

This commit is contained in:
Mikael Sand
2020-01-03 02:51:03 +02:00
parent bb9d384381
commit d7043bb9e5
2 changed files with 3 additions and 7 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import * as React from 'react';
import { createElement, GestureResponderEvent } from 'react-native';
import { NumberProp, TransformProps } from './lib/extract/types';
import SvgTouchableMixin from './lib/SvgTouchableMixin';
import { IterableStyles, resolve } from './lib/resolve';
import { resolve } from './lib/resolve';
type BlurEvent = Object;
type FocusEvent = Object;
@@ -49,7 +49,7 @@ interface BaseProps {
fontSize?: NumberProp;
fontFamily?: string;
forwardedRef: {};
style: IterableStyles<{}>;
style: Iterable<{}>;
}
/**
+1 -5
View File
@@ -1,11 +1,7 @@
import { StyleSheet } from 'react-native';
export interface IterableStyles<T> {
[Symbol.iterator](): Iterator<T>;
}
// Kept in separate file, to avoid name collision with Symbol element
export function resolve<T>(styleProp: IterableStyles<T>, cleanedProps: T) {
export function resolve<T>(styleProp: Iterable<T>, cleanedProps: T) {
if (styleProp) {
return StyleSheet
? [styleProp, cleanedProps]