diff --git a/packages/uni-uts-v1/lib/tsconfig/hbuilderx/shim-dom.d.ts b/packages/uni-uts-v1/lib/tsconfig/hbuilderx/shim-dom.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e3f32e6256730b96311354297078c51686bdff73 --- /dev/null +++ b/packages/uni-uts-v1/lib/tsconfig/hbuilderx/shim-dom.d.ts @@ -0,0 +1,87 @@ +// 为dom顶层类型添加声明,保证用户使用时不报错,但是并不保证类型正确推断 +declare global { + type document = any + type window = any + type navigator = any + type localStorage = any + type location = any + type history = any + type XMLHttpRequest = any + type FormData = any + type FileReader = any + type WebSocket = any + type Image = any + type HTMLElement = any + type HTMLCanvasElement = any + type HTMLImageElement = any + type HTMLVideoElement = any + type HTMLAudioElement = any + type HTMLMediaElement = any + type HTMLInputElement = any + type HTMLTextAreaElement = any + type HTMLSelectElement = any + type HTMLButtonElement = any + type HTMLAnchorElement = any + type HTMLFormElement = any + type HTMLDocument = any + type HTMLScriptElement = any + type HTMLStyleElement = any + type HTMLLinkElement = any + type HTMLIFrameElement = any + type HTMLFrameElement = any + type HTMLFrameSetElement = any + type HTMLBodyElement = any + type HTMLHeadElement = any + type HTMLMetaElement = any + type HTMLTitleElement = any + type HTMLBaseElement = any + type HTMLHtmlElement = any + type HTMLTableElement = any + type HTMLTableRowElement = any + type HTMLTableCellElement = any + type HTMLTableColElement = any + type HTMLTableSectionElement = any + type HTMLUListElement = any + type HTMLOListElement = any + type HTMLLIElement = any + type HTMLDListElement = any + type HTMLDivElement = any + type HTMLSpanElement = any + type HTMLHeadingElement = any + type HTMLQuoteElement = any + type HTMLPreElement = any + type HTMLBRElement = any + type HTMLParagraphElement = any + type HTMLHRElement = any + type HTMLModElement = any + type HTMLAnchorElement = any + type HTMLAreaElement = any + type HTMLLabelElement = any + type HTMLButtonElement = any + type HTMLSelectElement = any + type HTMLInputElement = any + type HTMLTextAreaElement = any + type HTMLFormElement = any + type HTMLFieldSetElement = any + type HTMLLegendElement = any + type HTMLTableCaptionElement = any + type HTMLDivElement = any + type HTMLTableColElement = any + type HTMLTableSectionElement = any + type HTMLTableRowElement = any + type HTMLTableCellElement = any + type HTMLFrameElement = any + type HTMLFrameSetElement = any + type HTMLIFrameElement = any + type HTMLBodyElement = any + type HTMLHtmlElement = any + type HTMLHeadElement = any + type HTMLTitleElement = any + type HTMLBaseElement = any + type HTMLMetaElement = any + type HTMLStyleElement = any + type HTMLLinkElement = any + type HTMLScriptElement = any + type HTMLDocument = any + type HTMLCollection = any +} \ No newline at end of file diff --git a/packages/uni-uts-v1/lib/tsconfig/hbuilderx/tsconfig.json b/packages/uni-uts-v1/lib/tsconfig/hbuilderx/tsconfig.json index f613b5d43cc8a8387197df96e818ead6db81e4b4..414c0827df5d40a4f6af10d1233b029c0d2945a0 100644 --- a/packages/uni-uts-v1/lib/tsconfig/hbuilderx/tsconfig.json +++ b/packages/uni-uts-v1/lib/tsconfig/hbuilderx/tsconfig.json @@ -11,6 +11,7 @@ "include": [ "env.d.ts", "shim-uni.d.ts", + "shim-dom.d.ts", "global.d.ts", "**/*.uts", "**/*.ts",