Use type import (#556)

* Use type import

* Small updates
This commit is contained in:
Jaco Greeff 2020-12-01 14:18:19 +01:00 committed by GitHub
parent 10a7db7066
commit 58b1320d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
88 changed files with 149 additions and 143 deletions

View File

@ -1,9 +1,10 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { KeyringPair } from '@polkadot/keyring/types';
import { RequestSign } from './types';
import { SignerPayloadRaw } from '@polkadot/types/types';
import type { KeyringPair } from '@polkadot/keyring/types';
import type { SignerPayloadRaw } from '@polkadot/types/types';
import type { RequestSign } from './types';
import { u8aToHex, hexToU8a } from '@polkadot/util';
import { TypeRegistry } from '@polkadot/types';

View File

@ -1,9 +1,9 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { KeyringPair } from '@polkadot/keyring/types';
import { SignerPayloadJSON } from '@polkadot/types/types';
import { RequestSign } from './types';
import type { KeyringPair } from '@polkadot/keyring/types';
import type { SignerPayloadJSON } from '@polkadot/types/types';
import type { RequestSign } from './types';
import { TypeRegistry } from '@polkadot/types';

View File

@ -1,16 +1,16 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDef } from '@polkadot/extension-inject/types';
import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
import { AccountJson, AllowedPath, AuthorizeRequest, MessageTypes, MetadataRequest, RequestAccountChangePassword, RequestAccountCreateExternal, RequestAccountCreateSuri, RequestAccountEdit, RequestAccountExport, RequestAccountShow, RequestAccountTie, RequestAccountValidate, RequestAuthorizeApprove, RequestAuthorizeReject, RequestDeriveCreate, ResponseDeriveValidate, RequestMetadataApprove, RequestMetadataReject, RequestSigningApprovePassword, RequestSigningApproveSignature, RequestSigningCancel, RequestSigningIsLocked, RequestSeedCreate, RequestTypes, ResponseAccountExport, RequestAccountForget, ResponseSeedCreate, RequestSeedValidate, RequestDeriveValidate, RequestJsonRestore, ResponseJsonRestore, ResponseSeedValidate, ResponseSigningIsLocked, ResponseType, SigningRequest } from '../types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import type { KeyringPair, KeyringPair$Meta } from '@polkadot/keyring/types';
import type { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
import type { AccountJson, AllowedPath, AuthorizeRequest, MessageTypes, MetadataRequest, RequestAccountChangePassword, RequestAccountCreateExternal, RequestAccountCreateSuri, RequestAccountEdit, RequestAccountExport, RequestAccountShow, RequestAccountTie, RequestAccountValidate, RequestAuthorizeApprove, RequestAuthorizeReject, RequestDeriveCreate, ResponseDeriveValidate, RequestMetadataApprove, RequestMetadataReject, RequestSigningApprovePassword, RequestSigningApproveSignature, RequestSigningCancel, RequestSigningIsLocked, RequestSeedCreate, RequestTypes, ResponseAccountExport, RequestAccountForget, ResponseSeedCreate, RequestSeedValidate, RequestDeriveValidate, RequestJsonRestore, ResponseJsonRestore, ResponseSeedValidate, ResponseSigningIsLocked, ResponseType, SigningRequest } from '../types';
import { ALLOWED_PATH, PASSWORD_EXPIRY_MS } from '@polkadot/extension-base/defaults';
import chrome from '@polkadot/extension-inject/chrome';
import keyring from '@polkadot/ui-keyring';
import accountsObservable from '@polkadot/ui-keyring/observable/accounts';
import { TypeRegistry } from '@polkadot/types';
import { KeyringPair, KeyringPair$Meta } from '@polkadot/keyring/types';
import { assert, isHex, isObject } from '@polkadot/util';
import { keyExtractSuri, mnemonicGenerate, mnemonicValidate } from '@polkadot/util-crypto';

View File

@ -1,14 +1,14 @@
// Copyright 2019-2020 @polkadot/extension-bg authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { knownMetadata, addMetadata } from '@polkadot/extension-chains';
import { ProviderMeta, MetadataDef } from '@polkadot/extension-inject/types';
import { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback } from '@polkadot/rpc-provider/types';
import { AccountJson, AuthorizeRequest, MetadataRequest, RequestAuthorizeTab, RequestRpcSend, RequestRpcSubscribe, RequestSign, ResponseRpcListProviders, ResponseSigning, SigningRequest, RequestRpcUnsubscribe } from '../types';
import type { ProviderMeta, MetadataDef } from '@polkadot/extension-inject/types';
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback } from '@polkadot/rpc-provider/types';
import type { AccountJson, AuthorizeRequest, MetadataRequest, RequestAuthorizeTab, RequestRpcSend, RequestRpcSubscribe, RequestSign, ResponseRpcListProviders, ResponseSigning, SigningRequest, RequestRpcUnsubscribe } from '../types';
import { BehaviorSubject } from 'rxjs';
import { assert } from '@polkadot/util';
import { knownMetadata, addMetadata } from '@polkadot/extension-chains';
import chrome from '@polkadot/extension-inject/chrome';
import { assert } from '@polkadot/util';
import { MetadataStore } from '../../stores';

View File

@ -1,12 +1,12 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { InjectedAccount, InjectedMetadataKnown, MetadataDef, ProviderMeta } from '@polkadot/extension-inject/types';
import { KeyringPair } from '@polkadot/keyring/types';
import { JsonRpcResponse } from '@polkadot/rpc-provider/types';
import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
import { RequestAuthorizeTab, ResponseSigning, RequestTypes, ResponseTypes, MessageTypes, ResponseRpcListProviders, RequestRpcSend, RequestRpcSubscribe, RequestRpcUnsubscribe, SubscriptionMessageTypes } from '../types';
import type { InjectedAccount, InjectedMetadataKnown, MetadataDef, ProviderMeta } from '@polkadot/extension-inject/types';
import type { KeyringPair } from '@polkadot/keyring/types';
import type { JsonRpcResponse } from '@polkadot/rpc-provider/types';
import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import type { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
import type { RequestAuthorizeTab, ResponseSigning, RequestTypes, ResponseTypes, MessageTypes, ResponseRpcListProviders, RequestRpcSend, RequestRpcSubscribe, RequestRpcUnsubscribe, SubscriptionMessageTypes } from '../types';
import { PHISHING_PAGE_REDIRECT } from '@polkadot/extension-base/defaults';
import keyring from '@polkadot/ui-keyring';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TransportRequestMessage, MessageTypes } from '../types';
import type { TransportRequestMessage, MessageTypes } from '../types';
import { assert } from '@polkadot/util';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SubscriptionMessageTypes, MessageTypesWithSubscriptions } from '../types';
import type { SubscriptionMessageTypes, MessageTypesWithSubscriptions } from '../types';
type Subscriptions = Record<string, chrome.runtime.Port>;

View File

@ -3,11 +3,12 @@
/* eslint-disable no-use-before-define */
import { InjectedAccount, MetadataDef, ProviderList, ProviderMeta, InjectedMetadataKnown } from '@polkadot/extension-inject/types';
import { JsonRpcResponse } from '@polkadot/rpc-provider/types';
import { KeypairType } from '@polkadot/util-crypto/types';
import { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types';
import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import type { InjectedAccount, MetadataDef, ProviderList, ProviderMeta, InjectedMetadataKnown } from '@polkadot/extension-inject/types';
import type { JsonRpcResponse } from '@polkadot/rpc-provider/types';
import type { KeypairType } from '@polkadot/util-crypto/types';
import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types';
import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import { TypeRegistry } from '@polkadot/types';
import { ALLOWED_PATH } from '../defaults';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { InjectedAccounts, InjectedAccount, Unsubcall } from '@polkadot/extension-inject/types';
import { SendRequest } from './types';
import type { InjectedAccounts, InjectedAccount, Unsubcall } from '@polkadot/extension-inject/types';
import type { SendRequest } from './types';
// External to class, this.# is not private enough (yet)
let sendRequest: SendRequest;

View File

@ -1,12 +1,12 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import PostMessageProvider from './PostMessageProvider';
import { Injected } from '@polkadot/extension-inject/types';
import { SendRequest } from './types';
import type { Injected } from '@polkadot/extension-inject/types';
import type { SendRequest } from './types';
import Accounts from './Accounts';
import Metadata from './Metadata';
import PostMessageProvider from './PostMessageProvider';
import Signer from './Signer';
export default class implements Injected {

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { InjectedMetadata, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types';
import { SendRequest } from './types';
import type { InjectedMetadata, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types';
import type { SendRequest } from './types';
// External to class, this.# is not private enough (yet)
let sendRequest: SendRequest;

View File

@ -1,14 +1,14 @@
// Copyright 2019-2020 @polkadot/extension-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import { AnyFunction } from '@polkadot/types/types';
import type { ProviderList, ProviderMeta, InjectedProvider } from '@polkadot/extension-inject/types';
import type { ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import type { AnyFunction } from '@polkadot/types/types';
import type { SendRequest } from './types';
import { isUndefined, logger } from '@polkadot/util';
import EventEmitter from 'eventemitter3';
import { SendRequest } from './types';
import { ProviderList, ProviderMeta, InjectedProvider } from '@polkadot/extension-inject/types';
const l = logger('PostMessageProvider');
type CallbackHandler = (error?: null | Error, value?: unknown) => void;

View File

@ -1,9 +1,9 @@
// Copyright 2019-2020 @polkadot/extension-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Signer as SignerInterface, SignerResult } from '@polkadot/api/types';
import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import { SendRequest } from './types';
import type { Signer as SignerInterface, SignerResult } from '@polkadot/api/types';
import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import type { SendRequest } from './types';
// External to class, this.# is not private enough (yet)
let sendRequest: SendRequest;

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ResponseTypes, TransportRequestMessage, TransportResponseMessage, MessageTypes, RequestTypes, MessageTypesWithNullRequest, SubscriptionMessageTypes, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions } from '../background/types';
import type { ResponseTypes, TransportRequestMessage, TransportResponseMessage, MessageTypes, RequestTypes, MessageTypesWithNullRequest, SubscriptionMessageTypes, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions } from '../background/types';
import Injected from './Injected';
import { isXmlOrPdf } from '../utils';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { RequestTypes, ResponseTypes, SubscriptionMessageTypes, MessageTypesWithNullRequest, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions } from '../background/types';
import type { RequestTypes, ResponseTypes, SubscriptionMessageTypes, MessageTypesWithNullRequest, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions } from '../background/types';
export interface SendRequest {
<TMessageType extends MessageTypesWithNullRequest>(message: TMessageType): Promise<ResponseTypes[TMessageType]>;

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { KeyringStore, KeyringJson } from '@polkadot/ui-keyring/types';
import type { KeyringStore, KeyringJson } from '@polkadot/ui-keyring/types';
import BaseStore from './Base';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDef } from '@polkadot/extension-inject/types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import BaseStore from './Base';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-chains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDefBase } from '@polkadot/extension-inject/types';
import type { MetadataDefBase } from '@polkadot/extension-inject/types';
import networks from '@polkadot/networks';
const hashes: MetadataDefBase[] = networks

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-chains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDef } from '@polkadot/extension-inject/types';
import { Chain } from './types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import type { Chain } from './types';
import { Metadata } from '@polkadot/metadata';
import { TypeRegistry } from '@polkadot/types';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-chains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDef } from '@polkadot/extension-inject/types';
import { Registry } from '@polkadot/types/types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import type { Registry } from '@polkadot/types/types';
export interface Chain {
definition: MetadataDef;

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-dapp authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Signer } from '@polkadot/api/types';
import { Injected, InjectedAccount, InjectedWindow } from '@polkadot/extension-inject/types';
import type { Signer } from '@polkadot/api/types';
import type { Injected, InjectedAccount, InjectedWindow } from '@polkadot/extension-inject/types';
// RxJs interface, only the bare-bones of what we need here
interface Subscriber<T> {

View File

@ -1,7 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-dapp authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Injected, InjectedAccount, InjectedAccountWithMeta, InjectedExtension, InjectedExtensionInfo, InjectedProviderWithMeta, InjectedWindow, ProviderList, Unsubcall, Web3AccountsOptions } from '@polkadot/extension-inject/types';
import type { Injected, InjectedAccount, InjectedAccountWithMeta, InjectedExtension, InjectedExtensionInfo, InjectedProviderWithMeta, InjectedWindow, ProviderList, Unsubcall, Web3AccountsOptions } from '@polkadot/extension-inject/types';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
import { documentReadyPromise } from './util';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-inject authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Injected, InjectedWindow, InjectOptions } from './types';
import type { Injected, InjectedWindow, InjectOptions } from './types';
// It is recommended to always use the function below to shield the extension and dapp from
// any future changes. The exposed interface will manage access between the 2 environments,

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-inject authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Signer as InjectedSigner } from '@polkadot/api/types';
import { ProviderInterface } from '@polkadot/rpc-provider/types';
import type { Signer as InjectedSigner } from '@polkadot/api/types';
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
// eslint-disable-next-line no-undef
type This = typeof globalThis;

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson } from '@polkadot/extension-base/background/types';
import type { AccountJson } from '@polkadot/extension-base/background/types';
import React, { useCallback, useContext, useMemo, useState } from 'react';
import styled from 'styled-components';

View File

@ -1,8 +1,9 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AccountWithChildren } from '@polkadot/extension-base/background/types';
import React from 'react';
import { AccountWithChildren } from '@polkadot/extension-base/background/types';
import Account from './Account';
interface Props extends AccountWithChildren {

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React, { useCallback, useContext } from 'react';
import styled from 'styled-components';

View File

@ -7,7 +7,7 @@
/* eslint-disable react/jsx-sort-props */
/* eslint-disable react/jsx-max-props-per-line */
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React, { useContext } from 'react';
import styled from 'styled-components';

View File

@ -3,7 +3,7 @@
import '../../../../../__mocks__/chrome';
import { AuthorizeRequest } from '@polkadot/extension-base/background/types';
import type { AuthorizeRequest } from '@polkadot/extension-base/background/types';
import { configure, mount, ReactWrapper } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { RequestAuthorizeTab } from '@polkadot/extension-base/background/types';
import { ThemeProps } from '../../types';
import type { RequestAuthorizeTab } from '@polkadot/extension-base/background/types';
import type { ThemeProps } from '../../types';
import React, { useCallback, useContext } from 'react';
import { Trans } from 'react-i18next';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React, { useContext } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React, { useCallback, useRef, useState } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import { faLock, faLockOpen } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

View File

@ -2,7 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
import '../../../../../__mocks__/chrome';
import { ResponseDeriveValidate } from '@polkadot/extension-base/background/types';
import type { ResponseDeriveValidate } from '@polkadot/extension-base/background/types';
import React from 'react';
import { MemoryRouter, Route } from 'react-router';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback, useContext, useState } from 'react';
import { RouteComponentProps, withRouter } from 'react-router';

View File

@ -1,6 +1,6 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback, useContext } from 'react';
import { RouteComponentProps, withRouter } from 'react-router';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataDef } from '@polkadot/extension-inject/types';
import { ThemeProps } from '../../types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import type { ThemeProps } from '../../types';
import React, { useCallback, useContext } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import { Trans } from 'react-i18next';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { KeyringPair$Json } from '@polkadot/keyring/types';
import type { KeyringPair$Json } from '@polkadot/keyring/types';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import styled from 'styled-components';

View File

@ -1,9 +1,9 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Chain } from '@polkadot/extension-chains/types';
import { Call, ExtrinsicEra, ExtrinsicPayload } from '@polkadot/types/interfaces';
import { AnyJson, SignerPayloadJSON } from '@polkadot/types/types';
import type { Chain } from '@polkadot/extension-chains/types';
import type { Call, ExtrinsicEra, ExtrinsicPayload } from '@polkadot/types/interfaces';
import type { AnyJson, SignerPayloadJSON } from '@polkadot/types/types';
import BN from 'bn.js';
import React, { useMemo, useRef } from 'react';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtrinsicPayload } from '@polkadot/types/interfaces';
import { SignerPayloadJSON } from '@polkadot/types/types';
import type { ExtrinsicPayload } from '@polkadot/types/interfaces';
import type { SignerPayloadJSON } from '@polkadot/types/types';
import React, { useCallback, useMemo, useState } from 'react';
import styled from 'styled-components';

View File

@ -1,12 +1,12 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtrinsicPayload } from '@polkadot/types/interfaces';
import { AccountJson, RequestSign } from '@polkadot/extension-base/background/types';
import { TypeRegistry } from '@polkadot/types';
import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import type { ExtrinsicPayload } from '@polkadot/types/interfaces';
import type { AccountJson, RequestSign } from '@polkadot/extension-base/background/types';
import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import React, { useCallback, useEffect, useContext, useState } from 'react';
import { TypeRegistry } from '@polkadot/types';
import { ActionContext, Address, VerticalSpace } from '../../../components';
import { approveSignSignature } from '../../../messaging';

View File

@ -3,7 +3,7 @@
import '../../../../../__mocks__/chrome';
import { SigningRequest } from '@polkadot/extension-base/background/types';
import type { SigningRequest } from '@polkadot/extension-base/background/types';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import { configure, mount, ReactWrapper } from 'enzyme';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SignerPayloadJSON } from '@polkadot/types/types';
import type { SignerPayloadJSON } from '@polkadot/types/types';
import React, { useCallback, useContext, useEffect, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useContext } from 'react';
import styled from 'styled-components';

View File

@ -1,8 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson, AccountsContext, AuthorizeRequest, MetadataRequest, SigningRequest } from '@polkadot/extension-base/background/types';
import { SettingsStruct } from '@polkadot/ui-settings/types';
import type { AccountJson, AccountsContext, AuthorizeRequest, MetadataRequest, SigningRequest } from '@polkadot/extension-base/background/types';
import type { SettingsStruct } from '@polkadot/ui-settings/types';
import React, { useEffect, useState } from 'react';
import { Route, Switch } from 'react-router';

View File

@ -1,10 +1,10 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { ThemeProps } from '../types';
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import type { ThemeProps } from '../types';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React, { MouseEventHandler } from 'react';
import styled from 'styled-components';

View File

@ -1,10 +1,10 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import { Chain } from '@polkadot/extension-chains/types';
import { SettingsStruct } from '@polkadot/ui-settings/types';
import { ThemeProps } from '../types';
import type { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import type { Chain } from '@polkadot/extension-chains/types';
import type { SettingsStruct } from '@polkadot/ui-settings/types';
import type { ThemeProps } from '../types';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
import { faCopy, faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback, useState, createRef } from 'react';
import Dropzone, { DropzoneRef } from 'react-dropzone';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -3,7 +3,7 @@
import React from 'react';
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -4,7 +4,7 @@
import React from 'react';
import styled from 'styled-components';
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
interface Props extends ThemeProps {
children: React.ReactNode;

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import { faCopy } from '@fortawesome/free-regular-svg-icons';
import React, { MouseEventHandler } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import { faArrowRight } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -3,7 +3,7 @@
import React from 'react';
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import styled, { css } from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../../types';
import type { ThemeProps } from '../../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useState } from 'react';
import { ThemeProvider, createGlobalStyle } from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,9 +1,9 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountsContext, AuthorizeRequest, MetadataRequest, SigningRequest } from '@polkadot/extension-base/background/types';
import { SettingsStruct } from '@polkadot/ui-settings/types';
import { AvailableThemes } from './themes';
import type { AccountsContext, AuthorizeRequest, MetadataRequest, SigningRequest } from '@polkadot/extension-base/background/types';
import type { SettingsStruct } from '@polkadot/ui-settings/types';
import type { AvailableThemes } from './themes';
import React from 'react';
import settings from '@polkadot/ui-settings';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Chain } from '@polkadot/extension-chains/types';
import type { Chain } from '@polkadot/extension-chains/types';
import { useEffect, useState } from 'react';

View File

@ -1,17 +1,17 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Message } from '@polkadot/extension-base/types';
import { AccountJson, AllowedPath, AuthorizeRequest, SigningRequest, RequestTypes, MessageTypes, ResponseTypes, SeedLengths, SubscriptionMessageTypes, MetadataRequest, MessageTypesWithNullRequest, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions, ResponseDeriveValidate, ResponseJsonRestore, ResponseSigningIsLocked } from '@polkadot/extension-base/background/types';
import { Chain } from '@polkadot/extension-chains/types';
import { MetadataDef } from '@polkadot/extension-inject/types';
import { KeypairType } from '@polkadot/util-crypto/types';
import type { Message } from '@polkadot/extension-base/types';
import type { AccountJson, AllowedPath, AuthorizeRequest, SigningRequest, RequestTypes, MessageTypes, ResponseTypes, SeedLengths, SubscriptionMessageTypes, MetadataRequest, MessageTypesWithNullRequest, MessageTypesWithNoSubscriptions, MessageTypesWithSubscriptions, ResponseDeriveValidate, ResponseJsonRestore, ResponseSigningIsLocked } from '@polkadot/extension-base/background/types';
import type { Chain } from '@polkadot/extension-chains/types';
import type { MetadataDef } from '@polkadot/extension-inject/types';
import type { KeyringPair$Json } from '@polkadot/keyring/types';
import type { KeypairType } from '@polkadot/util-crypto/types';
import { PORT_EXTENSION } from '@polkadot/extension-base/defaults';
import allChains from '@polkadot/extension-chains/chains';
import { metadataExpand } from '@polkadot/extension-chains';
import chrome from '@polkadot/extension-inject/chrome';
import { KeyringPair$Json } from '@polkadot/keyring/types';
interface Handler {
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import { faArrowLeft, faCog, faPlusCircle } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import React, { useCallback, useContext } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ThemeProps } from '../types';
import type { ThemeProps } from '../types';
import { faPlusCircle, faFileUpload, faKey, faQrcode } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Theme, ThemeProps } from '../types';
import type { Theme, ThemeProps } from '../types';
import settings from '@polkadot/ui-settings';
import { faExpand } from '@fortawesome/free-solid-svg-icons';

View File

@ -1,7 +1,8 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import type { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import { buildHierarchy } from './buildHierarchy';
const genesisExample = {

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import type { AccountJson, AccountWithChildren } from '@polkadot/extension-base/background/types';
import getNetworkMap from './getNetworkMap';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountJson } from '@polkadot/extension-base/background/types';
import type { AccountJson } from '@polkadot/extension-base/background/types';
export function nextDerivationPath (accounts: AccountJson[], parentAddress: string): string {
const siblingsCount = accounts.filter((account) => account.parentAddress === parentAddress).length;

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Message } from '@polkadot/extension-base/types';
import type { Message } from '@polkadot/extension-base/types';
import { PORT_CONTENT } from '@polkadot/extension-base/defaults';
import chrome from '@polkadot/extension-inject/chrome';

View File

@ -1,7 +1,7 @@
// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Message } from '@polkadot/extension-base/types';
import type { Message } from '@polkadot/extension-base/types';
import { enable, handleResponse, redirectPhishing } from '@polkadot/extension-base/page';
import { injectExtension } from '@polkadot/extension-inject';