Comparing version 5.0.0 to 5.0.1
@@ -1,3 +0,10 @@ | ||
## 5.0.0 - 2019-12-19 | ||
### 5.0.1 - 2019-12-19 | ||
#### ⚙️ Types | ||
- Fixed an issue with neverization where deeply nested objects cannot be typed correctly, and would | ||
error with "Type instantiation is excessively deep and possibly infinite.". | ||
# 5.0.0 - 2019-12-19 | ||
For improved interoperability, the `Aesthetic` instance is now global and no longer needs to be | ||
@@ -4,0 +11,0 @@ instantiated. |
import Adapter from './Adapter'; | ||
import { AestheticOptions, GlobalSheetFactory, StyleName, StyleSheet, StyleSheetFactory, ThemeName, ThemeSheet } from './types'; | ||
import { AestheticOptions, GlobalSheet, GlobalSheetFactory, StyleName, StyleSheet, StyleSheetFactory, ThemeName, ThemeSheet } from './types'; | ||
export default class Aesthetic { | ||
@@ -43,3 +43,3 @@ globalSheets: { | ||
*/ | ||
getGlobalSheet(themeName: ThemeName): StyleSheet | null; | ||
getGlobalSheet(themeName: ThemeName): GlobalSheet | null; | ||
/** | ||
@@ -46,0 +46,0 @@ * Retrieve the component style sheet for the defined theme. |
@@ -56,3 +56,3 @@ import CSS from 'csstype'; | ||
}; | ||
export declare type StyleSheetFactory<Theme = ThemeSheet, T = {}> = (theme: Theme) => StyleSheet & StyleSheetNeverize<T>; | ||
export declare type StyleSheetFactory<Theme = ThemeSheet, T = unknown> = (theme: Theme) => T extends unknown ? StyleSheet : StyleSheet & StyleSheetNeverize<T>; | ||
export interface GlobalSheet { | ||
@@ -76,3 +76,3 @@ '@charset'?: string; | ||
}; | ||
export declare type GlobalSheetFactory<Theme = ThemeSheet, T = {}> = (theme: Theme) => GlobalSheet & GlobalSheetNeverize<T>; | ||
export declare type GlobalSheetFactory<Theme = ThemeSheet, T = unknown> = (theme: Theme) => T extends unknown ? GlobalSheet : GlobalSheet & GlobalSheetNeverize<T>; | ||
export interface ThemeSheet { | ||
@@ -79,0 +79,0 @@ [key: string]: any; |
{ | ||
"name": "aesthetic", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Aesthetic is a powerful type-safe, framework agnostic, CSS-in-JS library for styling components through the use of adapters.", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "e2e68e0ad88fac9e8e9b7d04643fc65592af9a41" | ||
"gitHead": "55fcac7d6a93ec62194dc2b9024ed54ce0170d42" | ||
} |
@@ -17,3 +17,5 @@ /* eslint-disable */ | ||
type StyleSheetFactory<T = {}> = () => StyleSheet & StyleSheetNeverize<T>; | ||
type StyleSheetFactory<T = unknown> = () => T extends unknown | ||
? StyleSheet | ||
: StyleSheet & StyleSheetNeverize<T>; | ||
@@ -20,0 +22,0 @@ type CompiledStyleSheet = { [key: string]: object }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170097
3752