File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 4040// }
4141// });
4242
43- import { ImageStyle , TextStyle , ViewStyle } from 'react-native' ;
43+ import { ImageStyle , TextStyle , ViewStyle , DimensionValue } from 'react-native' ;
4444
45- // Types for variant styles
46- type StyleObject = ViewStyle | TextStyle | ImageStyle ;
45+ type TokenString = `$${string } `;
46+
47+ export type StyleObject = Partial < {
48+ [ K in keyof ( ViewStyle & TextStyle & ImageStyle ) ] :
49+ | ( ViewStyle & TextStyle & ImageStyle ) [ K ]
50+ | ( K extends keyof ViewStyle ? TokenString | DimensionValue : TokenString ) ;
51+ } > ;
4752
4853// Define the VariantOptions type to ensure type safety in variant definitions
4954type VariantOptions < V > = {
@@ -138,3 +143,7 @@ export function styles<V extends VariantOptions<V>>(config: VariantStyleConfig<V
138143 return styles ;
139144 } ;
140145}
146+
147+ // Add these types above the existing types
148+
149+ export { createTokens } from './tokens' ;
You can’t perform that action at this time.
0 commit comments