From 53dc8dbcff1c985b9795b44d52b9bbbbedbefe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E5=B1=BF=E6=9C=89=E7=87=95?= Date: Tue, 20 Feb 2024 11:55:56 +0800 Subject: [PATCH] chore: add React module --- src/InPageEdit/React/React.ts | 3 +++ src/InPageEdit/React/definition.json | 3 +++ src/InPageEdit/React/modules/global.d.ts | 4 ++++ src/InPageEdit/global.d.ts | 25 ++++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 src/InPageEdit/React/React.ts create mode 100644 src/InPageEdit/React/definition.json create mode 100644 src/InPageEdit/React/modules/global.d.ts create mode 100644 src/InPageEdit/global.d.ts diff --git a/src/InPageEdit/React/React.ts b/src/InPageEdit/React/React.ts new file mode 100644 index 00000000..b5cafcb1 --- /dev/null +++ b/src/InPageEdit/React/React.ts @@ -0,0 +1,3 @@ +/* eslint-disable unicorn/no-empty-file */ +// 如果使用 jsx-dom,则取消注释以下行 / To Use jsx-dom, uncomment the following line +// export * from 'jsx-dom'; diff --git a/src/InPageEdit/React/definition.json b/src/InPageEdit/React/definition.json new file mode 100644 index 00000000..9c4e7371 --- /dev/null +++ b/src/InPageEdit/React/definition.json @@ -0,0 +1,3 @@ +{ + "enable": false +} diff --git a/src/InPageEdit/React/modules/global.d.ts b/src/InPageEdit/React/modules/global.d.ts new file mode 100644 index 00000000..d9d7b7e6 --- /dev/null +++ b/src/InPageEdit/React/modules/global.d.ts @@ -0,0 +1,4 @@ +declare module 'ext.gadget.React' { + // 如果使用 jsx-dom,则取消注释以下行 / To Use jsx-dom, uncomment the following line + // export * from 'jsx-dom'; +} diff --git a/src/InPageEdit/global.d.ts b/src/InPageEdit/global.d.ts new file mode 100644 index 00000000..b5af8aca --- /dev/null +++ b/src/InPageEdit/global.d.ts @@ -0,0 +1,25 @@ +/** + * @summary For import styles in TypeScript + */ +declare module '*.css'; +declare module '*.less'; +declare module '*.module.css' { + const classes: {[key: string]: string}; + export default classes; +} + +declare module '*.module.less' { + const classes: {[key: string]: string}; + export default classes; +} + +/** + * @summary Do not forget to declare these file extensions in `scripts/build-esbuild_options.ts` + * @see {@link https://esbuild.github.io/api/#loader} + */ +declare module '*.gif'; +declare module '*.ico'; +declare module '*.jpg'; +declare module '*.jpeg'; +declare module '*.png'; +declare module '*.svg';