diff --git a/.vscode/settings.json b/.vscode/settings.json index f89ed5f1..6a30c1d5 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 5a549dfc..2077e222 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 c8f1bdcf..7e641f4a 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 cfb524ef..279de9a6 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 58efd6bd..74377c4a 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 3e0190a6..c7803aa4 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 fb57b7ab..ee4b35a9 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; }