From cbfc58ee3fe0e2efbb210182a2c958e3afa13afc Mon Sep 17 00:00:00 2001 From: Kira Date: Thu, 13 Jan 2022 17:08:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E4=B8=8Bjsx?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/index.ts | 1 + typescript/shims-tsx.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/typescript/index.ts b/typescript/index.ts index 54f7106a8..bcb501473 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -180,6 +180,7 @@ import { TdLayout } from './core/wrapper/layout/layout.td'; import { MultiLayerSelectLevelTree } from './widget/multilayerselecttree/multilayerselecttree.leveltree'; import { SelectTreeExpander } from './widget/selecttree/selecttree.expander'; import { DownListGroupItem } from "./widget/downlist/item.downlistgroup"; +import './shims-tsx'; export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { diff --git a/typescript/shims-tsx.ts b/typescript/shims-tsx.ts index 9b8abdb03..c30bdee66 100644 --- a/typescript/shims-tsx.ts +++ b/typescript/shims-tsx.ts @@ -63,7 +63,14 @@ interface ElementClassProps extends UIProps { destroyed(): void; } +type Widget = import('./index').Widget; +type Props = Partial & AdditionalProps>; + declare namespace JSX { + interface Element extends Props { + type: string; + } + interface ElementClass extends Widget {} // for undefined interface IntrinsicElements { [elemName: string]: Partial; From 5b649661e34f7015787cb6bc0460f031d1d36230 Mon Sep 17 00:00:00 2001 From: Kira Date: Thu, 13 Jan 2022 17:15:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E4=B8=8Bjsx?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/shims-tsx.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/shims-tsx.ts b/typescript/shims-tsx.ts index c30bdee66..fcf24ecf2 100644 --- a/typescript/shims-tsx.ts +++ b/typescript/shims-tsx.ts @@ -4,9 +4,9 @@ interface UIProps { width: number | string; height: number | string; top: number; - left: number; + left: number | JSX.Element; bottom: number; - right: number; + right: number | JSX.Element; rgap: number; lgap: number; tgap: number; @@ -64,7 +64,7 @@ interface ElementClassProps extends UIProps { } type Widget = import('./index').Widget; -type Props = Partial & AdditionalProps>; +type Props = Partial & AdditionalProps & Record>; declare namespace JSX { interface Element extends Props {