@compiled/react
Advanced tools
Comparing version 0.16.5 to 0.16.6
@@ -47,3 +47,3 @@ import type { StrictCSSProperties, CSSPseudos } from '../types'; | ||
*/ | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema>): { | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema> & TStylesMap): { | ||
readonly [P in keyof TStylesMap]: CompiledStyles<TStylesMap[P]>; | ||
@@ -50,0 +50,0 @@ }; |
@@ -47,3 +47,3 @@ import type { StrictCSSProperties, CSSPseudos } from '../types'; | ||
*/ | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema>): { | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema> & TStylesMap): { | ||
readonly [P in keyof TStylesMap]: CompiledStyles<TStylesMap[P]>; | ||
@@ -50,0 +50,0 @@ }; |
@@ -47,3 +47,3 @@ import type { StrictCSSProperties, CSSPseudos } from '../types'; | ||
*/ | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema>): { | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>(styles: CSSMapStyles<TSchema> & TStylesMap): { | ||
readonly [P in keyof TStylesMap]: CompiledStyles<TStylesMap[P]>; | ||
@@ -50,0 +50,0 @@ }; |
{ | ||
"name": "@compiled/react", | ||
"version": "0.16.5", | ||
"version": "0.16.6", | ||
"description": "A familiar and performant compile time CSS-in-JS library for React.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -24,2 +24,3 @@ import type { StrictCSSProperties, CSSPseudos } from '../types'; | ||
EnforceSchema<TSchema>; | ||
type CSSMapStyles<TSchema extends CompiledSchema> = Record<string, CSSStyles<TSchema>>; | ||
@@ -61,5 +62,6 @@ | ||
cssMap<TStylesMap extends CSSMapStyles<TSchema>>( | ||
// NOTE: This should match the generic `TStylesMap extends …` as we want this arg to strictly satisfy this type, not just extend it. | ||
// The "extends" functionality is to infer and build the return type, this is to enforce the input type. | ||
styles: CSSMapStyles<TSchema> | ||
// We intersection type the generic both with the concrete type and the generic to ensure the output has the generic applied. | ||
// Without both it would either have the input arg not have excess property check kick in allowing unexpected values or | ||
// have all values set as the output making usage with XCSSProp have type violations unexpectedly. | ||
styles: CSSMapStyles<TSchema> & TStylesMap | ||
): { | ||
@@ -66,0 +68,0 @@ readonly [P in keyof TStylesMap]: CompiledStyles<TStylesMap[P]>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
402575
9735