From 6bbce2e0facc9b362ebbe220335f085516bb688f Mon Sep 17 00:00:00 2001 From: Jonathan Neal Date: Wed, 21 Jul 2021 09:24:51 -0400 Subject: [PATCH] update types / improve theme typing --- packages/core/types/sheet.d.ts | 13 ++++++++----- packages/react/types/sheet.d.ts | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/core/types/sheet.d.ts b/packages/core/types/sheet.d.ts index fcfd63d9..a16db4a6 100644 --- a/packages/core/types/sheet.d.ts +++ b/packages/core/types/sheet.d.ts @@ -37,7 +37,7 @@ export default interface Sheet< name: string } }, - theme: { + theme: string & { ( nameOrScalesArg0: ( | string @@ -71,10 +71,13 @@ export default interface Sheet< } ) ) - ): { - className: string - selector: string - } + ): + & string + & { + className: string + selector: string + } + & ThemeTokens, Prefix> } & { [Scale in keyof Theme]: { [Token in keyof Theme[Scale]]: ThemeUtil.Token, string, Extract, Prefix> diff --git a/packages/react/types/sheet.d.ts b/packages/react/types/sheet.d.ts index c474c9bb..8dd5d9f2 100644 --- a/packages/react/types/sheet.d.ts +++ b/packages/react/types/sheet.d.ts @@ -37,7 +37,7 @@ export default interface Sheet< name: string } }, - theme: { + theme: string & { ( nameOrScalesArg0: ( | string @@ -71,10 +71,13 @@ export default interface Sheet< } ) ) - ): { - className: string - selector: string - } & ThemeTokens, Prefix> + ): + & string + & { + className: string + selector: string + } + & ThemeTokens, Prefix> } & { [Scale in keyof Theme]: { [Token in keyof Theme[Scale]]: ThemeUtil.Token, string, Extract, Prefix>