From 3277de3424a220b91553e63855bd47c396301aba Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Wed, 18 Oct 2017 22:53:57 +0100 Subject: [PATCH] Added TypeScript definitions for the newly-added cx function. --- packages/emotion/typescript_tests/typescript_tests.ts | 8 +++++++- packages/emotion/typings/emotion.d.ts | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/emotion/typescript_tests/typescript_tests.ts b/packages/emotion/typescript_tests/typescript_tests.ts index 86b4e6f29..57b8bfcd8 100644 --- a/packages/emotion/typescript_tests/typescript_tests.ts +++ b/packages/emotion/typescript_tests/typescript_tests.ts @@ -5,7 +5,8 @@ import { flush, css, fontFace, - hydrate + hydrate, + cx } from '../'; sheet.speedy(true); @@ -70,4 +71,9 @@ injectGlobal` } `; +const cxResult: string = cx(() => () => [ + () => [className, false && className2, 'modal'], + () => [() => [className, () => ({ [className2]: true }), 'profile']] +]); + hydrate(['css-123', 'css-456']); diff --git a/packages/emotion/typings/emotion.d.ts b/packages/emotion/typings/emotion.d.ts index 735678ed6..257efb8da 100644 --- a/packages/emotion/typings/emotion.d.ts +++ b/packages/emotion/typings/emotion.d.ts @@ -42,4 +42,6 @@ export const fontFace: CreateStyles; export function getRegisteredStyles(registeredStyles: string[], classNames: string): string; +export function cx(...interpolations: Interpolation[]): string; + export function hydrate(ids: string[]): void; \ No newline at end of file