From aa684d58ef72f4ab11ee0f170247dc97cf0255c8 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Fri, 24 May 2024 18:48:55 +0200 Subject: [PATCH] fix: Correct context for declaration files Fixes "Cannot find module 'styled-jsx' or its corresponding type declarations" --- css.d.ts | 3 ++- index.d.ts | 3 ++- macro.d.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/css.d.ts b/css.d.ts index 9148a3a..9603111 100644 --- a/css.d.ts +++ b/css.d.ts @@ -1,7 +1,8 @@ -import type { JSX } from "react"; // Definitions by: @types/styled-jsx declare module 'styled-jsx/css' { + import type { JSX } from "react"; + function css(chunks: TemplateStringsArray, ...args: any[]): JSX.Element namespace css { export function global( diff --git a/index.d.ts b/index.d.ts index e23338a..1bc51ef 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,10 +1,11 @@ -import type { JSX } from "react"; /// /// /// /// declare module 'styled-jsx' { + import type { JSX } from "react"; + export type StyledJsxStyleRegistry = { styles(options?: { nonce?: string }): JSX.Element[] flush(): void diff --git a/macro.d.ts b/macro.d.ts index 92c8df5..3efb926 100644 --- a/macro.d.ts +++ b/macro.d.ts @@ -1,5 +1,6 @@ -import type { JSX } from "react"; declare module 'styled-jsx/macro' { + import type { JSX } from "react"; + namespace macro { function resolve( chunks: TemplateStringsArray,