From 8a1ff9ac2311e730d66b41594c59f76ec83295c3 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 6 Sep 2025 16:40:17 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20TS=20=E9=87=8D?= =?UTF-8?q?=E6=A7=8B=E9=83=A8=E5=88=86=20React=20=E7=B5=84=E4=BB=B6,=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5=20Mdui=20=E9=83=A8=E5=88=86=E7=B5=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E9=A1=9E=E5=9E=8B=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/Imports.ts | 20 + client/index.html | 2 +- client/typedef/mdui-jsx.d.ts | 3350 +++++++++++++++++ client/ui/{App.jsx => App.tsx} | 56 +- .../{LoginDialog.jsx => LoginDialog.tsx} | 13 +- 5 files changed, 3410 insertions(+), 31 deletions(-) create mode 100644 client/typedef/mdui-jsx.d.ts rename client/ui/{App.jsx => App.tsx} (77%) rename client/ui/dialog/{LoginDialog.jsx => LoginDialog.tsx} (60%) diff --git a/client/Imports.ts b/client/Imports.ts index 48847a1..15ff7ad 100644 --- a/client/Imports.ts +++ b/client/Imports.ts @@ -2,8 +2,28 @@ import * as React from 'https://esm.sh/react@18.3.1' import * as ReactDOM from 'https://esm.sh/react-dom@18.3.1' import CryptoES from 'https://unpkg.com/crypto-es@3.0.4/dist/index.mjs' +import type { Dialog } from 'https://unpkg.com/mdui@2.1.4/components/dialog/index.d.ts' +import type { TextField } from 'https://unpkg.com/mdui@2.1.4/components/text-field/index.d.ts' +import type { Button } from 'https://unpkg.com/mdui@2.1.4/components/button/index.d.ts' +import type { NavigationRail } from 'https://unpkg.com/mdui@2.1.4/components/navigation-rail/navigation-rail.d.ts' + +declare global { + namespace React { + namespace JSX { + interface IntrinsicAttributes { + id?: string + } + } + } +} + export { React, ReactDOM, CryptoES, + + Dialog as MduiDialog, + TextField as MduiTextField, + Button as MduiButton, + NavigationRail as MduiNavigationRail, } diff --git a/client/index.html b/client/index.html index abaf3ae..cc2dd44 100644 --- a/client/index.html +++ b/client/index.html @@ -99,7 +99,7 @@ alert('很抱歉, 此应用无法在较旧的浏览器运行, 请使用基于 Chromium 89+ 的浏览器(内核)使用 :(')