diff --git a/package.json b/package.json index 5b5fb24..f2e13a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jynxs", - "version": "0.2.0", + "version": "0.2.1", "description": "Lightweight React-like JSX runtime with the basics.", "keywords": [ "react", diff --git a/src/runtime/jsx-runtime.ts b/src/runtime/jsx-runtime.ts index 8a94038..de3ee2d 100644 --- a/src/runtime/jsx-runtime.ts +++ b/src/runtime/jsx-runtime.ts @@ -1,5 +1,26 @@ import { shallowEquals } from './utils' +export declare namespace JSX { + // type HTMLAttributes = Record<string, JSXNode | undefined> & JSXChildren + type HTMLAttributes = Record<string, any | undefined> + + interface IntrinsicElements { + [elemName: string]: any + } + + type SyncElement = { + type: string | Function + props: { + children?: Element | Element[] + [key: string]: any + } + } + + type Element = SyncElement | Promise<SyncElement> + + type ElementType = string | ((props: any) => Element | Promise<Element>) +} + type Props = { [key: string]: any } type JSXRef = | { @@ -7,8 +28,6 @@ type JSXRef = } | ((element: HTMLElement) => void) -// type JSXNode = string | number | null | undefined | JSXElement | JSXNode[]; - type JSXElement = { type: string | Function props: Props diff --git a/src/runtime/types.d.ts b/src/runtime/types.d.ts deleted file mode 100644 index a3f842f..0000000 --- a/src/runtime/types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -declare namespace JSX { - type HTMLAttributes = Record<string, JSXNode | undefined> & JSXChildren - - interface IntrinsicElements { - [elemName: string]: any - } - - type SyncElement = { - type: string | Function - props: { - children?: Element | Element[] - [key: string]: any - } - } - - type Element = SyncElement | Promise<SyncElement> - - type ElementType = string | ((props: any) => Element | Promise<Element>) -}