Hygiene, some additional type -> interface (#1552)

* Higene, some additional type -> interface

* Liniting
This commit is contained in:
Jaco Greeff 2019-08-28 12:52:48 +02:00 committed by GitHub
parent 012322a361
commit 66ca8ea61e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 49 additions and 47 deletions

View File

@ -15,7 +15,7 @@ import { formatBalance, formatNumber } from '@polkadot/util';
import translate from './translate';
type Props = ApiProps & BareProps & I18nProps & {
interface Props extends ApiProps, BareProps, I18nProps {
balances_totalIssuance?: BN;
chain_bestNumber?: BN;
chain_bestNumberLag?: BN;
@ -25,7 +25,8 @@ type Props = ApiProps & BareProps & I18nProps & {
system_chain?: string;
system_name?: string;
system_version?: string;
};
}
interface State {
nextUp: AccountId[];
}

View File

@ -19,7 +19,8 @@ import Transfer from './Transfer';
import translate from './translate';
// define out internal types
type Props = AppProps & I18nProps;
interface Props extends AppProps, I18nProps {}
interface State {
accountId?: string;
}

View File

@ -18,9 +18,9 @@ import Overview from './Overview';
import translate from './translate';
import Vanity from './Vanity';
type Props = AppProps & I18nProps & {
interface Props extends AppProps, I18nProps {
allAccounts?: SubjectInfo;
};
}
interface State {
hidden: string[];

View File

@ -17,9 +17,9 @@ import basicMd from './md/basic.md';
import Overview from './Overview';
import translate from './translate';
type Props = AppProps & I18nProps & {
interface Props extends AppProps, I18nProps {
allAddresses?: SubjectInfo;
};
}
interface State {
hidden: string[];

View File

@ -7,7 +7,7 @@ import { TabItem } from '@polkadot/react-components/Tabs';
import { ComponentProps, LocationProps } from './types';
import React from 'react';
import { Route, RouteComponentProps, Switch } from 'react-router';
import { Route, Switch } from 'react-router';
import { withRouter } from 'react-router-dom';
import { HelpOverlay, Tabs } from '@polkadot/react-components';
import { withMulti, withObservable } from '@polkadot/react-api';
@ -21,10 +21,10 @@ import Contracts from './Contracts';
import Codes from './Codes';
import Deploy from './Deploy';
type Props = AppProps & I18nProps & RouteComponentProps & {
interface Props extends AppProps, I18nProps {
accounts: SubjectInfo[];
contracts: SubjectInfo[];
};
}
interface State {
codeHash?: string;

View File

@ -9,10 +9,10 @@ import { BareProps, CallProps } from '@polkadot/react-api/types';
import React from 'react';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
label?: string;
chain_subscribeNewHeads?: Header;
};
}
class BestHash extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -10,10 +10,10 @@ import { DerivedBalances } from '@polkadot/api-derive/types';
import { withCalls, withMulti } from '@polkadot/react-api';
import { InputBalance } from '@polkadot/react-components';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
balances_all?: DerivedBalances;
label?: React.ReactNode;
};
}
class BalanceDisplay extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -42,7 +42,7 @@ interface Injected {
window: null;
}
type Props = ApiProps & AppProps & I18nProps & {
interface Props extends ApiProps, AppProps, I18nProps {
match: {
params: {
base64?: string;
@ -50,7 +50,7 @@ type Props = ApiProps & AppProps & I18nProps & {
};
// FIXME wait for proper eslint integration in tslint, then hopefully remove this
history: any;
};
}
interface State {
animated: boolean;

View File

@ -14,9 +14,9 @@ import { isJsonObject, stringToU8a, u8aToString } from '@polkadot/util';
import translate from './translate';
type Props = AppProps & I18nProps & {
interface Props extends AppProps, I18nProps {
onStatusChange: (status: ActionStatus) => void;
};
}
interface State {
code: string;

View File

@ -13,9 +13,9 @@ import uiSettings from '@polkadot/ui-settings';
import translate from './translate';
type Props = AppProps & I18nProps & {
interface Props extends AppProps, I18nProps {
onStatusChange: (status: ActionStatus) => void;
};
}
interface State {
isCustomNode: boolean;

View File

@ -17,9 +17,9 @@ import Sign from './Sign';
import Verify from './Verify';
import translate from './translate';
type Props = AppProps & I18nProps & {
interface Props extends AppProps, I18nProps {
allAccounts?: SubjectInfo;
};
}
interface State {
tabs: TabItem[];

View File

@ -9,12 +9,12 @@ import { AccountId, AccountIndex } from '@polkadot/types/interfaces';
import React from 'react';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
params?: string;
accounts_idAndIndex?: [AccountId?, AccountIndex?];
};
}
export class AccountIndexDisplay extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -11,12 +11,12 @@ import React from 'react';
import { formatBalance } from '@polkadot/util';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
balances_all?: DerivedBalances;
children?: React.ReactNode;
label?: React.ReactNode;
params?: AccountId | AccountIndex | Address | string | Uint8Array | null;
};
}
export class AvailableDisplay extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -12,12 +12,12 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatBalance } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
params?: AccountId | AccountIndex | Address | string | Uint8Array | null;
balances_all?: DerivedBalances;
};
}
export class BalanceDisplay extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -10,11 +10,11 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatNumber } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
chain_bestNumberFinalized?: BlockNumber;
};
}
export class BestFinalized extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -10,11 +10,11 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatNumber } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
chain_bestNumber?: BlockNumber;
};
}
export class BestNumber extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -11,12 +11,12 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatBalance } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
params?: AccountId | AccountIndex | Address | string | Uint8Array | null;
label?: React.ReactNode;
staking_ledger?: StakingLedger | null;
};
}
export class BondedDisplay extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -9,11 +9,11 @@ import React from 'react';
import { Text } from '@polkadot/types';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
system_chain?: Text;
};
}
export class Chain extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -9,11 +9,11 @@ import React from 'react';
import { Text } from '@polkadot/types';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
system_name?: Text;
};
}
export class NodeName extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -9,11 +9,11 @@ import React from 'react';
import { Text } from '@polkadot/types';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
system_version?: Text;
};
}
export class NodeVersion extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -10,13 +10,13 @@ import React from 'react';
import { formatNumber } from '@polkadot/util';
import { withCalls } from '@polkadot/react-api';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
accountNonce?: BN;
callOnResult?: (accountNonce: BN) => void;
children?: React.ReactNode;
label?: React.ReactNode;
params?: string;
};
}
export class Nonce extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -11,11 +11,11 @@ import { withCalls } from '@polkadot/react-api';
import Elapsed from './Elapsed';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
timestamp_now?: Moment;
};
}
export class TimeNow extends React.PureComponent<Props> {
public render (): React.ReactNode {

View File

@ -10,7 +10,7 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatNumber } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
babe_expectedBlockTime?: Moment;
children?: React.ReactNode;
label?: React.ReactNode;

View File

@ -10,11 +10,11 @@ import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { formatBalance } from '@polkadot/util';
type Props = BareProps & CallProps & {
interface Props extends BareProps, CallProps {
children?: React.ReactNode;
label?: React.ReactNode;
balances_totalIssuance?: Balance;
};
}
export class TotalIssuance extends React.PureComponent<Props> {
public render (): React.ReactNode {