chore: 使用 TS 重構部分 React 組件, 引入 Mdui 部分組件的類型定義

This commit is contained in:
CrescentLeaf
2025-09-06 16:40:17 +08:00
parent 7553c5b281
commit 8a1ff9ac23
5 changed files with 3410 additions and 31 deletions

View File

@@ -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,
}