From aaf72860426805d645f54ff39fcf213f942c0165 Mon Sep 17 00:00:00 2001 From: YJ Date: Tue, 10 Jul 2018 23:49:35 -0700 Subject: [PATCH] stricter types (#134) --- packages/apps/src/SideBar/index.tsx | 2 +- packages/ui-app/src/Button/types.d.ts | 4 ++-- packages/ui-app/src/Input.tsx | 2 +- packages/ui-app/src/Output.tsx | 2 +- packages/ui-app/src/Password.tsx | 2 +- packages/ui-app/src/Static.tsx | 2 +- packages/ui-react-rx/src/types.d.ts | 2 +- packages/ui-signer/src/Extrinsic.tsx | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/apps/src/SideBar/index.tsx b/packages/apps/src/SideBar/index.tsx index bc21d961b4..f27bcb9d25 100644 --- a/packages/apps/src/SideBar/index.tsx +++ b/packages/apps/src/SideBar/index.tsx @@ -17,7 +17,7 @@ import translate from '../translate'; import Item from './Item'; type Props = I18nProps & { - children?: any // React$Node + children?: React.ReactNode }; function SideBar ({ children, className, style, t }: Props) { diff --git a/packages/ui-app/src/Button/types.d.ts b/packages/ui-app/src/Button/types.d.ts index 2b351ae38a..662ef79798 100644 --- a/packages/ui-app/src/Button/types.d.ts +++ b/packages/ui-app/src/Button/types.d.ts @@ -7,7 +7,7 @@ import { BareProps } from '../types'; export type Button$Sizes = 'mini' | 'tiny' | 'small' | 'medium' | 'large' | 'big' | 'huge' | 'massive'; export type ButtonProps = BareProps & { - children?: any, + children?: React.ReactNode, floated?: 'left' | 'right', icon?: string, isBasic?: boolean, @@ -23,7 +23,7 @@ export type ButtonProps = BareProps & { export type DividerProps = BareProps; export type GroupProps = BareProps & { - children?: any + children?: React.ReactNode }; export type GroupType = React.ComponentType & { diff --git a/packages/ui-app/src/Input.tsx b/packages/ui-app/src/Input.tsx index e9d994edf1..ad898c8e9b 100644 --- a/packages/ui-app/src/Input.tsx +++ b/packages/ui-app/src/Input.tsx @@ -14,7 +14,7 @@ import Labelled from './Labelled'; type Input$Type = 'number' | 'password' | 'text'; type Props = BareProps & { - children?: any, // node? + children?: React.ReactNode, defaultValue?: any, icon?: any, // node? isAction?: boolean, diff --git a/packages/ui-app/src/Output.tsx b/packages/ui-app/src/Output.tsx index ef10aa32c8..1c6675a848 100644 --- a/packages/ui-app/src/Output.tsx +++ b/packages/ui-app/src/Output.tsx @@ -11,7 +11,7 @@ import Labelled from './Labelled'; import classes from './util/classes'; type Props = BareProps & { - children?: any, // node?, + children?: React.ReactNode, isError?: boolean, isHidden?: boolean, label?: any, // node? diff --git a/packages/ui-app/src/Password.tsx b/packages/ui-app/src/Password.tsx index 30abd32152..1b0b23f1f1 100644 --- a/packages/ui-app/src/Password.tsx +++ b/packages/ui-app/src/Password.tsx @@ -11,7 +11,7 @@ import Input from './Input'; type Props = BareProps & { defaultValue?: any, - children?: any, // node? + children?: React.ReactNode, isDisabled?: boolean, isError?: boolean, label?: string, diff --git a/packages/ui-app/src/Static.tsx b/packages/ui-app/src/Static.tsx index 5dbd6be27b..c9a6b8a8f7 100644 --- a/packages/ui-app/src/Static.tsx +++ b/packages/ui-app/src/Static.tsx @@ -9,7 +9,7 @@ import React from 'react'; import Labelled from './Labelled'; type Props = BareProps & { - children?: any, // node? + children?: React.ReactNode, isHidden?: boolean, label?: any, // node? value?: any, // node? diff --git a/packages/ui-react-rx/src/types.d.ts b/packages/ui-react-rx/src/types.d.ts index fd6b269ae2..cefe2e5ed8 100644 --- a/packages/ui-react-rx/src/types.d.ts +++ b/packages/ui-react-rx/src/types.d.ts @@ -41,7 +41,7 @@ export type RxProps = { } export type BaseProps = BareProps & ApiProps & ChangeProps & ParamProps & RxProps & { - children?: any, // node? + children?: React.ReactNode, label?: string, render?: (value?: T) => any // node? }; diff --git a/packages/ui-signer/src/Extrinsic.tsx b/packages/ui-signer/src/Extrinsic.tsx index 99d5623004..3a5f642a96 100644 --- a/packages/ui-signer/src/Extrinsic.tsx +++ b/packages/ui-signer/src/Extrinsic.tsx @@ -18,7 +18,7 @@ import addressEncode from '@polkadot/util-keyring/address/encode'; import translate from './translate'; type Props = I18nProps & { - children?: any, // node? + children?: React.ReactNode, value: QueueTx };