Skip to content

Commit

Permalink
Merge pull request #2 from thefrontside/tm/fix-jsx-types
Browse files Browse the repository at this point in the history
Fix JSXElement Types
  • Loading branch information
taras authored Nov 3, 2023
2 parents c5de0f5 + 5bce500 commit 0944a49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jsx-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export type Element = hast.Element;

export type JSXChild = string | number | boolean | JSXElement;

export type JSXChildren = JSXChild | JSXChild[];

export type JSXElement = hast.Element | hast.Root | hast.Text;

export type JSXElementProps = Record<string, string> & {
children?: JSXChild | JSXChild[];
children?: JSXChildren;
};
export type JSXComponentProps = Record<string, unknown> & {
key?: string;
Expand All @@ -25,7 +27,7 @@ export interface JSXElementConstructor {
}

declare global {
namespace JSX {
export namespace JSX {
type Element = JSXElement;
type ElementType =
| keyof html.HTMLElements
Expand Down
1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type { JSXChildren, JSXElement } from "./jsx-runtime.ts";

0 comments on commit 0944a49

Please sign in to comment.