@emotion/serialize
Advanced tools
Comparing version 0.11.15-next.2 to 0.12.0-next.3
# @emotion/serialize | ||
## 0.12.0-next.3 | ||
### Minor Changes | ||
- [`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b) [#1600](https://github.com/emotion-js/emotion/pull/1600) Thanks [@joltmode](https://github.com/joltmode)! - Reworked Interpolation-related types. Correct types should now be provided to all flavours of emotion. | ||
## 0.11.15-next.2 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@emotion/serialize", | ||
"version": "0.11.15-next.2", | ||
"version": "0.12.0-next.3", | ||
"description": "serialization utils for emotion", | ||
@@ -5,0 +5,0 @@ "main": "dist/serialize.cjs.js", |
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun> | ||
// TypeScript Version: 2.8 | ||
import { Theme } from '@emotion/core' | ||
import { RegisteredCache, SerializedStyles } from '@emotion/utils' | ||
@@ -15,15 +16,8 @@ import * as CSS from 'csstype' | ||
} | ||
/** | ||
* @desc Following type exists for autocompletion of key. | ||
*/ | ||
export type CSSPseudos<MP> = { [K in CSS.Pseudos]?: ObjectInterpolation<MP> } | ||
export interface CSSOthersObject<MP> { | ||
[propertiesName: string]: Interpolation<MP> | ||
} | ||
export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject } | ||
export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject } | ||
export interface ArrayCSSInterpolation extends Array<CSSInterpolation> {} | ||
export type CSSInterpolation = | ||
export type InterpolationPrimitive = | ||
| null | ||
@@ -38,5 +32,6 @@ | undefined | ||
| CSSObject | ||
| ArrayCSSInterpolation | ||
export interface CSSOthersObjectForCSSObject { | ||
export type CSSInterpolation = InterpolationPrimitive | ArrayCSSInterpolation | ||
export interface CSSOthersObject { | ||
[propertiesName: string]: CSSInterpolation | ||
@@ -47,4 +42,4 @@ } | ||
extends CSSPropertiesWithMultiValues, | ||
CSSPseudosForCSSObject, | ||
CSSOthersObjectForCSSObject {} | ||
CSSPseudos, | ||
CSSOthersObject {} | ||
@@ -62,29 +57,18 @@ export interface ComponentSelector { | ||
export interface ArrayInterpolation<MP> extends Array<Interpolation<MP>> {} | ||
export interface ObjectInterpolation<MP> | ||
extends CSSPropertiesWithMultiValues, | ||
CSSPseudos<MP>, | ||
CSSOthersObject<MP> {} | ||
export interface ArrayInterpolation<Props> | ||
extends Array<Interpolation<Props>> {} | ||
export interface FunctionInterpolation<MergedProps> { | ||
(mergedProps: MergedProps): Interpolation<MergedProps> | ||
export interface FunctionInterpolation<Props> { | ||
(props: Props): Interpolation<Props> | ||
} | ||
export type Interpolation<MergedProps = undefined> = | ||
| null | ||
| undefined | ||
| boolean | ||
| number | ||
| string | ||
| ComponentSelector | ||
| Keyframes | ||
| SerializedStyles | ||
| ArrayInterpolation<MergedProps> | ||
| ObjectInterpolation<MergedProps> | ||
| FunctionInterpolation<MergedProps> | ||
export type Interpolation<Props> = | ||
| InterpolationPrimitive | ||
| ArrayInterpolation<Props> | ||
| FunctionInterpolation<Props> | ||
export function serializeStyles<MP>( | ||
args: Array<TemplateStringsArray | Interpolation<MP>>, | ||
export function serializeStyles<Props>( | ||
args: Array<TemplateStringsArray | Interpolation<Props>>, | ||
registered: RegisteredCache, | ||
mergedProps?: MP | ||
props?: Props | ||
): SerializedStyles |
@@ -1,7 +0,2 @@ | ||
import { | ||
CSSObject, | ||
ObjectInterpolation, | ||
Keyframes, | ||
serializeStyles | ||
} from '@emotion/serialize' | ||
import { CSSObject, Keyframes, serializeStyles } from '@emotion/serialize' | ||
@@ -11,6 +6,6 @@ declare const testTemplateStringsArray: TemplateStringsArray | ||
const testObjectInterpolation0: ObjectInterpolation<undefined> = { | ||
const testCSSObject0: CSSObject = { | ||
animation: testKeyframes | ||
} | ||
const testObjectInterpolation1: ObjectInterpolation<undefined> = { | ||
const testCSSObject1: CSSObject = { | ||
animationName: testKeyframes | ||
@@ -17,0 +12,0 @@ } |
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
75294
1697