add jsdoc comments

This commit is contained in:
lchen committed 2026-11-18 10:14:21 +08:00
1 parent 6de354ad47
commit 8c1205bc13
24 files changed
+1228 -425

No files matched your search

+7
View File
@@ -1,3 +1,10 @@
/**
* @template {keyof HTMLElementTagNameMap} K
* @param {K} tagName
* @param {string | ((e: HTMLElementTagNameMap[K]) => void) | null} [init]
* @param {...(string | Node)} children
* @returns {HTMLElementTagNameMap[K]}
*/
export function createElement(tagName, init, ...children) {
const element = document.createElement(tagName);
if (typeof init === 'function') {