From b670fd3d4f16d0de278cf67eafc2107e1c5bc9f7 Mon Sep 17 00:00:00 2001 From: CoolElectronics Date: Thu, 25 Apr 2024 18:27:02 -0400 Subject: [PATCH] update typedefs & fix runtime error --- dreamland.d.ts | 3 ++- src/css.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dreamland.d.ts b/dreamland.d.ts index d3da8ac..78bc823 100644 --- a/dreamland.d.ts +++ b/dreamland.d.ts @@ -14,7 +14,7 @@ declare namespace JSX { } declare function h( - type: string, + type: string | Component, props?: { [index: string]: any } | null, ...children: (HTMLElement | string)[] ): Node @@ -59,6 +59,7 @@ declare function handle( ): void declare function css(strings: TemplateStringsArray, ...values: any): string +type scope = typeof css type DLCSS = string diff --git a/src/css.js b/src/css.js index 151a4f8..737b9fe 100644 --- a/src/css.js +++ b/src/css.js @@ -83,6 +83,7 @@ function genCss(str, scoped) { const styleElement = document.createElement('style') document.head.appendChild(styleElement) + let newstr, selfstr if (scoped) { /* POLYFILL.SCOPE.START */ if (!scopeSupported) {