From 53952c7f36ad40bc38bd4ef35bc58b70e0c89820 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 12 Feb 2018 09:24:31 -0800 Subject: [PATCH] Upgrade csstype, remove hacks --- types/jss/css.d.ts | 41 +---------------------------------------- types/jss/jss-tests.ts | 2 +- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index fb886a6a61..125571309d 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -3,47 +3,8 @@ import { Observable } from './observable' import * as csstype from 'csstype' -/** - * Value of a CSS Property. Could be a single value or a list of fallbacks - * NOTE: array is for fallbacks - */ -export type CSSValue = T | Observable; - -/** - * Remove the variants of the second union of string literals from - * the first. - */ -export type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; - -/** - * Drop keys `K` from `T`. - */ -export type Omit = Pick>; - -export interface SimpleProperties extends Omit< - csstype.Properties, - 'display' | 'width' | 'height' -> { - // https://github.com/frenic/csstype/issues/7 - width: number | string; - height: number | string; - // https://github.com/frenic/csstype/issues/8 - display: - | csstype.All - | csstype.DisplayOutside - | csstype.DisplayInside - | csstype.DisplayInternal - | csstype.DisplayBox - | csstype.DisplayLegacy - ; -} - export type CSSProperties = { - [K in keyof csstype.Properties]: CSSValue + [K in keyof csstype.Properties]: csstype.Properties[K] | Observable } export interface JssProps { diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 06e4ab2eb6..28db02b91b 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -65,7 +65,7 @@ styleSheet.addRule('badProperty', { }); styleSheet.addRule('badValue', { // $ExpectError - display: 'thisIsNotAValidDisplayValue', + alignItems: 'thisIsNotAValidValue', }); styleSheet.detach();