Skip to content

Commit 18a186c

Browse files
committed
🎉 feat: custom tag, custom attribute
1 parent 302bc47 commit 18a186c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

example/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const page = `
1313

1414
const jsx = (
1515
<html lang="en">
16-
<head hx-a=''>
16+
<head hx-a="A">
1717
<title>Hello World</title>
1818
</head>
1919
<body>

src/declaration.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-nocheck
2-
31
// @ts-ignore
42
const { createElement } = require('typed-html')
53

@@ -9,8 +7,13 @@ globalThis.ElysiaJSX = createElement
97
declare function ElysiaJSX(...params: any[]): string
108

119
declare namespace JSX {
12-
// type Element = string;
13-
interface HtmlTag {
10+
// @ts-ignore
11+
type Element = string;
12+
13+
// @ts-ignore
14+
type BaseHTMLTag = Record<string, unknown>
15+
16+
interface HtmlTag extends BaseHTMLTag {
1417
accesskey?: string
1518
class?: string
1619
contenteditable?: string
@@ -482,8 +485,6 @@ declare namespace JSX {
482485
onunload?: string
483486
}
484487
interface HtmlTag {
485-
// @ts-ignore
486-
[attributes?: string]: string | boolean
487488
oncontextmenu?: string
488489
onkeydown?: string
489490
onkeypress?: string

0 commit comments

Comments
 (0)