Migrate Clipspace to ts (#30)

* rename

* Migrate to ts
This commit is contained in:
Chenlei Hu
2024-06-18 14:05:49 -04:00
committed by GitHub
parent dd81f49ad9
commit 681bb69217
2 changed files with 8 additions and 6 deletions

View File

@@ -21,7 +21,9 @@ type Props = {
[key: string]: any
};
export function $el(tag: string, propsOrChildren?: string | Element | Element[] | Props, children?: Element[] | Element): HTMLElement {
type Children = Element[] | Element | string | string[];
export function $el(tag: string, propsOrChildren?: Children | Props, children?: Children): HTMLElement {
const split = tag.split(".");
const element = document.createElement(split.shift() as string);
if (split.length > 0) {