mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-30 13:38:30 +00:00
refactor(web): improve types
This commit is contained in:
@@ -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
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user