From 46ad21ff94b48b85782186e72bc4f92a08b110a7 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 2 Jun 2020 11:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E5=88=87=E6=88=90=20typescript@3.8.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 ++- package.json | 6 +++--- publish.sh | 2 +- src/components/AssociatedCheckboxes.tsx | 6 +++--- src/components/ListRadios.tsx | 2 +- src/components/TreeRadios.tsx | 2 +- types/uncontrollable/index.d.ts | 11 +++++++---- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f89ed5f1d..6a30c1d58 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "editor.formatOnSave": true + "editor.formatOnSave": true, + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/package.json b/package.json index 5a549dfcc..2077e2222 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@types/classnames": "^2.2.3", "@types/dom-helpers": "^3.4.1", "@types/history": "^4.6.0", - "@types/hoist-non-react-statics": "^3.0.1", + "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^24.0.11", "@types/jquery": "^3.3.1", "@types/lodash": "^4.14.76", @@ -89,7 +89,7 @@ "@types/pretty-bytes": "^4.0.0", "@types/prop-types": "^15.5.2", "@types/qs": "^6.5.1", - "@types/react": "^16.8.1", + "@types/react": "^16.9.35", "@types/react-addons-update": "^0.14.19", "@types/react-color": "^2.13.3", "@types/react-cropper": "^0.10.1", @@ -139,7 +139,7 @@ "react-testing-library": "6.0.4", "strip-json-comments": "^2.0.1", "ts-jest": "^24.0.0", - "typescript": "^3.9.2" + "typescript": "^3.8.3" }, "jest": { "testEnvironment": "jsdom", diff --git a/publish.sh b/publish.sh index c8f1bdcfc..7e641f4a6 100644 --- a/publish.sh +++ b/publish.sh @@ -11,7 +11,7 @@ rm -rf lib/node_modules rm -rf sdk && fis3 release publish-sdk -c # ็”Ÿๆˆ .d.ts ๆ–‡ไปถ -tsc --allowJs --declaration +./node_modules/.bin/tsc --allowJs --declaration cd output diff --git a/src/components/AssociatedCheckboxes.tsx b/src/components/AssociatedCheckboxes.tsx index cfb524efd..279de9a60 100644 --- a/src/components/AssociatedCheckboxes.tsx +++ b/src/components/AssociatedCheckboxes.tsx @@ -58,7 +58,7 @@ export class AssociatedCheckboxes extends Checkboxes< const selectdOption = ListRadios.resolveSelected( leftValue, options, - option => option.ref + (option: Option) => option.ref ); if (selectdOption && onDeferLoad && selectdOption.defer) { @@ -80,7 +80,7 @@ export class AssociatedCheckboxes extends Checkboxes< const selectdOption = ListRadios.resolveSelected( value, options, - option => option.ref + (option: Option) => option.ref ); if (selectdOption && onDeferLoad && selectdOption.defer) { @@ -111,7 +111,7 @@ export class AssociatedCheckboxes extends Checkboxes< const selectdOption = ListRadios.resolveSelected( this.state.leftValue, options, - option => option.ref + (option: Option) => option.ref ); return ( diff --git a/src/components/ListRadios.tsx b/src/components/ListRadios.tsx index 58efd6bd2..74377c4a0 100644 --- a/src/components/ListRadios.tsx +++ b/src/components/ListRadios.tsx @@ -24,7 +24,7 @@ export interface ListRadiosProps extends ThemeProps { export class ListRadios< T extends ListRadiosProps = ListRadiosProps, - S = any + S = {} > extends React.Component { selected: Option | undefined | null; diff --git a/src/components/TreeRadios.tsx b/src/components/TreeRadios.tsx index 3e0190a65..c7803aa47 100644 --- a/src/components/TreeRadios.tsx +++ b/src/components/TreeRadios.tsx @@ -8,7 +8,7 @@ import Spinner from './Spinner'; import {ListRadiosProps, ListRadios} from './ListRadios'; export interface TreeRadiosProps extends ListRadiosProps { - expand?: 'all' | 'first' | 'root' | 'none'; + expand: 'all' | 'first' | 'root' | 'none'; } export interface TreeRadiosState { diff --git a/types/uncontrollable/index.d.ts b/types/uncontrollable/index.d.ts index fb57b7abc..ee4b35a9d 100644 --- a/types/uncontrollable/index.d.ts +++ b/types/uncontrollable/index.d.ts @@ -1,7 +1,10 @@ declare module 'uncontrollable' { - function uncontrollable, P extends { - [propName:string]: any - }>(arg:T, config:P):T; + function uncontrollable< + T extends Raect.ComponentType, + P extends { + [propName: string]: any; + } + >(arg: T, config: P): T; - export = uncontrollable; + export = uncontrollable; }