// Definitions by: Pat Sissons // Edited by to support Extended Stylesheets: Wendell Misiedjan // TypeScript Version: 3.4 import * as RN from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; export type Theme = { rem?: number; } & T; export type AnyStyle = T & { [key: string]: T & { [key: string]: T & string; }; }; export type StyleProp = RN.StyleProp & { [key: string]: RN.StyleProp; }; export type TestType = AnyStyle; export type ReactNativeStyle = | ExtendedStyle | ExtendedStyle | ExtendedStyle; export type CustomClasses = | ':first-child' | ':nth-child-even' | ':nth-child-odd' | ':last-child' | '@media web' | '@media ios' | '@media android' | '@media macos' | '@media windows'; export type MediaTypes = RN.PlatformOSType; export type CustomProperties = { $outline?: boolean; $scale?: number; }; export type ExtendedStyle = | T | { [key in CustomClasses]: T | undefined; } | { [key: string]: T; } | { [key in keyof T]: string | number | string[]; }; export type ReactNativeStyleType = Props extends { style?: StyleProp; } ? StyleType extends ReactNativeStyle ? StyleType : ReactNativeStyle : ReactNativeStyle; export type ExtendedStylesheet = typeof EStyleSheet; export interface Stylesheet extends ExtendedStylesheet { sheets: Array>>; } // export const StyleSheet: Stylesheet;