rn-css 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import type { Style } from '../types';
1
+ import { CompleteStyle, Style } from '../types';
2
2
  declare function cssToStyle(css: string): Style;
3
3
  export declare function cssToRNStyle(css: string, units?: {
4
4
  em?: number;
5
5
  width?: number;
6
6
  height?: number;
7
- }): import("../types").AnyStyle;
7
+ }): CompleteStyle;
8
8
  export default cssToStyle;
@@ -1,5 +1,5 @@
1
1
  import React, { MouseEvent } from 'react';
2
- import { FlatListProps, LayoutChangeEvent, SectionListProps, StyleProp, VirtualizedListProps } from 'react-native';
2
+ import { Animated, FlatListProps, LayoutChangeEvent, SectionListProps, StyleProp, VirtualizedListProps } from 'react-native';
3
3
  import type { AnyStyle, CompleteStyle, Units } from './types';
4
4
  export declare const defaultUnits: Units;
5
5
  export declare const RemContext: React.Context<number>;
@@ -13,7 +13,7 @@ declare type Functs<T> = (arg: T & {
13
13
  shared: unknown;
14
14
  theme: DefaultTheme;
15
15
  }) => Primitive;
16
- declare type OptionalProps<T extends AnyStyle = AnyStyle> = {
16
+ declare type OptionalProps<T extends AnyStyle | Animated.WithAnimatedValue<AnyStyle> = AnyStyle> = {
17
17
  rnCSS?: `${string};`;
18
18
  onMouseEnter?: (event: MouseEvent) => void;
19
19
  onMouseLeave?: (event: MouseEvent) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-css",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "scripts": {
5
5
  "test": "jest",
6
6
  "prepare": "tsc",
@@ -1,6 +1,6 @@
1
1
  import { Dimensions } from 'react-native'
2
2
  import convertStyle from '../convertStyle'
3
- import type { Context, PartialStyle, Style, Units } from '../types'
3
+ import { CompleteStyle, Context, PartialStyle, Style, Units } from '../types'
4
4
  import { sideValue, border, borderLike, cornerValue, font, textDecoration, shadow, placeContent, flex, flexFlow, transform, background } from './convert'
5
5
  import { createMedia } from './mediaQueries'
6
6
 
@@ -54,7 +54,7 @@ export function cssToRNStyle (css: string, units: { em?: number, width?: number,
54
54
  ...units
55
55
  }
56
56
  const rnStyle = cssChunkToStyle(css)
57
- return convertStyle(rnStyle, finalUnits)
57
+ return convertStyle<CompleteStyle>(rnStyle, finalUnits)
58
58
  }
59
59
 
60
60
  function cssChunkToStyle (css: string) {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable react/display-name */
3
3
  import React, { MouseEvent } from 'react'
4
- import { FlatList, FlatListProps, LayoutChangeEvent, Platform, SectionList, SectionListProps, StyleProp, StyleSheet, VirtualizedList, VirtualizedListProps } from 'react-native'
4
+ import { Animated, FlatList, FlatListProps, LayoutChangeEvent, Platform, SectionList, SectionListProps, StyleProp, StyleSheet, VirtualizedList, VirtualizedListProps } from 'react-native'
5
5
  import convertStyle from './convertStyle'
6
6
  import cssToStyle from './cssToRN'
7
7
  import { useFontSize, useHover, useLayout, useScreenSize, useMediaQuery } from './features'
@@ -21,7 +21,7 @@ export interface DefaultTheme {}
21
21
 
22
22
  type Primitive = number | string | null | undefined | boolean | CompleteStyle
23
23
  type Functs<T> = (arg: T & { rnCSS?: string; shared: unknown, theme: DefaultTheme }) => Primitive
24
- type OptionalProps<T extends AnyStyle = AnyStyle> = {
24
+ type OptionalProps<T extends AnyStyle | Animated.WithAnimatedValue<AnyStyle> = AnyStyle> = {
25
25
  rnCSS?: `${string};`;
26
26
  onMouseEnter?: (event: MouseEvent) => void;
27
27
  onMouseLeave?: (event: MouseEvent) => void;