From 58b1320d4166e0703a680cb5cadaf9bffdfcf23f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 1 Dec 2020 14:18:19 +0100 Subject: [PATCH] Use type import (#556) * Use type import * Small updates --- .../src/background/RequestBytesSign.ts | 7 ++++--- .../src/background/RequestExtrinsicSign.ts | 6 +++--- .../src/background/handlers/Extension.ts | 8 ++++---- .../extension-base/src/background/handlers/State.ts | 10 +++++----- .../extension-base/src/background/handlers/Tabs.ts | 12 ++++++------ .../extension-base/src/background/handlers/index.ts | 2 +- .../src/background/handlers/subscriptions.ts | 2 +- packages/extension-base/src/background/types.ts | 11 ++++++----- packages/extension-base/src/page/Accounts.ts | 4 ++-- packages/extension-base/src/page/Injected.ts | 6 +++--- packages/extension-base/src/page/Metadata.ts | 4 ++-- .../extension-base/src/page/PostMessageProvider.ts | 10 +++++----- packages/extension-base/src/page/Signer.ts | 6 +++--- packages/extension-base/src/page/index.ts | 2 +- packages/extension-base/src/page/types.ts | 2 +- packages/extension-base/src/stores/Accounts.ts | 2 +- packages/extension-base/src/stores/Metadata.ts | 2 +- packages/extension-chains/src/chains.ts | 2 +- packages/extension-chains/src/index.ts | 4 ++-- packages/extension-chains/src/types.ts | 4 ++-- packages/extension-dapp/src/compat/singleSource.ts | 4 ++-- packages/extension-dapp/src/index.ts | 3 ++- packages/extension-inject/src/index.ts | 2 +- packages/extension-inject/src/types.ts | 4 ++-- packages/extension-ui/src/Popup/Accounts/Account.tsx | 2 +- .../extension-ui/src/Popup/Accounts/AccountsTree.tsx | 3 ++- .../extension-ui/src/Popup/Accounts/AddAccount.tsx | 2 +- .../src/Popup/Accounts/AddAccountImage.tsx | 2 +- packages/extension-ui/src/Popup/Accounts/index.tsx | 2 +- .../src/Popup/Authorize/Authorize.test.tsx | 2 +- .../extension-ui/src/Popup/Authorize/Request.tsx | 4 ++-- packages/extension-ui/src/Popup/Authorize/index.tsx | 2 +- .../src/Popup/Derive/AddressDropdown.tsx | 2 +- .../extension-ui/src/Popup/Derive/DerivationPath.tsx | 2 +- .../extension-ui/src/Popup/Derive/Derive.test.tsx | 3 ++- .../extension-ui/src/Popup/Derive/SelectParent.tsx | 2 +- packages/extension-ui/src/Popup/Export.tsx | 2 +- packages/extension-ui/src/Popup/Forget.tsx | 2 +- packages/extension-ui/src/Popup/Metadata/Request.tsx | 4 ++-- packages/extension-ui/src/Popup/PhishingDetected.tsx | 2 +- packages/extension-ui/src/Popup/RestoreJson.tsx | 2 +- .../extension-ui/src/Popup/Signing/Extrinsic.tsx | 6 +++--- packages/extension-ui/src/Popup/Signing/Qr.tsx | 4 ++-- .../extension-ui/src/Popup/Signing/Request/index.tsx | 8 ++++---- .../extension-ui/src/Popup/Signing/Signing.test.tsx | 2 +- .../src/Popup/Signing/TransactionIndex.tsx | 2 +- packages/extension-ui/src/Popup/Signing/index.tsx | 2 +- packages/extension-ui/src/Popup/Welcome.tsx | 2 +- packages/extension-ui/src/Popup/index.tsx | 4 ++-- packages/extension-ui/src/components/ActionText.tsx | 6 +++--- packages/extension-ui/src/components/Address.tsx | 8 ++++---- packages/extension-ui/src/components/BackButton.tsx | 2 +- packages/extension-ui/src/components/Box.tsx | 2 +- packages/extension-ui/src/components/Button.tsx | 2 +- packages/extension-ui/src/components/ButtonArea.tsx | 2 +- packages/extension-ui/src/components/Checkbox.tsx | 2 +- packages/extension-ui/src/components/Dropdown.tsx | 2 +- packages/extension-ui/src/components/Identicon.tsx | 2 +- .../src/components/InputFileWithLabel.tsx | 2 +- packages/extension-ui/src/components/Label.tsx | 2 +- packages/extension-ui/src/components/Link.tsx | 2 +- packages/extension-ui/src/components/List.tsx | 2 +- packages/extension-ui/src/components/Main.tsx | 2 +- packages/extension-ui/src/components/Menu.tsx | 2 +- packages/extension-ui/src/components/MenuDivider.tsx | 2 +- packages/extension-ui/src/components/MenuItem.tsx | 2 +- .../extension-ui/src/components/MnemonicSeed.tsx | 2 +- .../extension-ui/src/components/NextStepButton.tsx | 2 +- packages/extension-ui/src/components/Spinner.tsx | 2 +- packages/extension-ui/src/components/Svg.tsx | 2 +- packages/extension-ui/src/components/Switch.tsx | 2 +- packages/extension-ui/src/components/Table.tsx | 2 +- packages/extension-ui/src/components/TextInputs.ts | 2 +- packages/extension-ui/src/components/Toast/Toast.tsx | 2 +- packages/extension-ui/src/components/View.tsx | 2 +- packages/extension-ui/src/components/Warning.tsx | 2 +- packages/extension-ui/src/components/contexts.tsx | 6 +++--- packages/extension-ui/src/hooks/useMetadata.ts | 2 +- packages/extension-ui/src/messaging.ts | 12 ++++++------ packages/extension-ui/src/partials/Header.tsx | 2 +- .../extension-ui/src/partials/HeaderWithSteps.tsx | 2 +- packages/extension-ui/src/partials/MenuAdd.tsx | 2 +- packages/extension-ui/src/partials/MenuSettings.tsx | 2 +- .../extension-ui/src/util/buildHierarchy.test.ts | 3 ++- packages/extension-ui/src/util/buildHierarchy.ts | 2 +- packages/extension-ui/src/util/nextDerivationPath.ts | 2 +- packages/extension/src/content.ts | 2 +- packages/extension/src/page.ts | 2 +- 88 files changed, 149 insertions(+), 143 deletions(-) diff --git a/packages/extension-base/src/background/RequestBytesSign.ts b/packages/extension-base/src/background/RequestBytesSign.ts index 4068429e..cfad0205 100644 --- a/packages/extension-base/src/background/RequestBytesSign.ts +++ b/packages/extension-base/src/background/RequestBytesSign.ts @@ -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'; diff --git a/packages/extension-base/src/background/RequestExtrinsicSign.ts b/packages/extension-base/src/background/RequestExtrinsicSign.ts index 7c235e0f..ea0a4074 100644 --- a/packages/extension-base/src/background/RequestExtrinsicSign.ts +++ b/packages/extension-base/src/background/RequestExtrinsicSign.ts @@ -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'; diff --git a/packages/extension-base/src/background/handlers/Extension.ts b/packages/extension-base/src/background/handlers/Extension.ts index f6d7621d..32d815f6 100644 --- a/packages/extension-base/src/background/handlers/Extension.ts +++ b/packages/extension-base/src/background/handlers/Extension.ts @@ -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'; diff --git a/packages/extension-base/src/background/handlers/State.ts b/packages/extension-base/src/background/handlers/State.ts index e371eba3..319aeb68 100644 --- a/packages/extension-base/src/background/handlers/State.ts +++ b/packages/extension-base/src/background/handlers/State.ts @@ -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'; diff --git a/packages/extension-base/src/background/handlers/Tabs.ts b/packages/extension-base/src/background/handlers/Tabs.ts index ef387795..3f69f086 100644 --- a/packages/extension-base/src/background/handlers/Tabs.ts +++ b/packages/extension-base/src/background/handlers/Tabs.ts @@ -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'; diff --git a/packages/extension-base/src/background/handlers/index.ts b/packages/extension-base/src/background/handlers/index.ts index c615f19d..57d0055d 100644 --- a/packages/extension-base/src/background/handlers/index.ts +++ b/packages/extension-base/src/background/handlers/index.ts @@ -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'; diff --git a/packages/extension-base/src/background/handlers/subscriptions.ts b/packages/extension-base/src/background/handlers/subscriptions.ts index c97022a9..81f0cdab 100644 --- a/packages/extension-base/src/background/handlers/subscriptions.ts +++ b/packages/extension-base/src/background/handlers/subscriptions.ts @@ -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; diff --git a/packages/extension-base/src/background/types.ts b/packages/extension-base/src/background/types.ts index 20e74c91..f4c27a98 100644 --- a/packages/extension-base/src/background/types.ts +++ b/packages/extension-base/src/background/types.ts @@ -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'; diff --git a/packages/extension-base/src/page/Accounts.ts b/packages/extension-base/src/page/Accounts.ts index 9233e62c..dedfca12 100644 --- a/packages/extension-base/src/page/Accounts.ts +++ b/packages/extension-base/src/page/Accounts.ts @@ -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; diff --git a/packages/extension-base/src/page/Injected.ts b/packages/extension-base/src/page/Injected.ts index e3d0aad9..4c9a300b 100644 --- a/packages/extension-base/src/page/Injected.ts +++ b/packages/extension-base/src/page/Injected.ts @@ -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 { diff --git a/packages/extension-base/src/page/Metadata.ts b/packages/extension-base/src/page/Metadata.ts index 58922144..86a795fe 100644 --- a/packages/extension-base/src/page/Metadata.ts +++ b/packages/extension-base/src/page/Metadata.ts @@ -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; diff --git a/packages/extension-base/src/page/PostMessageProvider.ts b/packages/extension-base/src/page/PostMessageProvider.ts index bbbdbea3..6c21c627 100644 --- a/packages/extension-base/src/page/PostMessageProvider.ts +++ b/packages/extension-base/src/page/PostMessageProvider.ts @@ -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; diff --git a/packages/extension-base/src/page/Signer.ts b/packages/extension-base/src/page/Signer.ts index 5dad7f9d..f7f29ee4 100644 --- a/packages/extension-base/src/page/Signer.ts +++ b/packages/extension-base/src/page/Signer.ts @@ -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; diff --git a/packages/extension-base/src/page/index.ts b/packages/extension-base/src/page/index.ts index 9f013b49..83232f75 100644 --- a/packages/extension-base/src/page/index.ts +++ b/packages/extension-base/src/page/index.ts @@ -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'; diff --git a/packages/extension-base/src/page/types.ts b/packages/extension-base/src/page/types.ts index 62b0247f..6578c8ac 100644 --- a/packages/extension-base/src/page/types.ts +++ b/packages/extension-base/src/page/types.ts @@ -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 { (message: TMessageType): Promise; diff --git a/packages/extension-base/src/stores/Accounts.ts b/packages/extension-base/src/stores/Accounts.ts index 80d24c91..63bbec1d 100644 --- a/packages/extension-base/src/stores/Accounts.ts +++ b/packages/extension-base/src/stores/Accounts.ts @@ -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'; diff --git a/packages/extension-base/src/stores/Metadata.ts b/packages/extension-base/src/stores/Metadata.ts index bb0492f4..03554e7f 100644 --- a/packages/extension-base/src/stores/Metadata.ts +++ b/packages/extension-base/src/stores/Metadata.ts @@ -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'; diff --git a/packages/extension-chains/src/chains.ts b/packages/extension-chains/src/chains.ts index 81b5c21e..70158754 100644 --- a/packages/extension-chains/src/chains.ts +++ b/packages/extension-chains/src/chains.ts @@ -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 diff --git a/packages/extension-chains/src/index.ts b/packages/extension-chains/src/index.ts index f35d3068..814264ae 100644 --- a/packages/extension-chains/src/index.ts +++ b/packages/extension-chains/src/index.ts @@ -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'; diff --git a/packages/extension-chains/src/types.ts b/packages/extension-chains/src/types.ts index 4ec77658..e13d9fd5 100644 --- a/packages/extension-chains/src/types.ts +++ b/packages/extension-chains/src/types.ts @@ -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; diff --git a/packages/extension-dapp/src/compat/singleSource.ts b/packages/extension-dapp/src/compat/singleSource.ts index c0ac3274..b329324d 100644 --- a/packages/extension-dapp/src/compat/singleSource.ts +++ b/packages/extension-dapp/src/compat/singleSource.ts @@ -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 { diff --git a/packages/extension-dapp/src/index.ts b/packages/extension-dapp/src/index.ts index 3cdf4b22..54c862d8 100644 --- a/packages/extension-dapp/src/index.ts +++ b/packages/extension-dapp/src/index.ts @@ -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'; diff --git a/packages/extension-inject/src/index.ts b/packages/extension-inject/src/index.ts index 9bc11145..3b9aead0 100644 --- a/packages/extension-inject/src/index.ts +++ b/packages/extension-inject/src/index.ts @@ -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, diff --git a/packages/extension-inject/src/types.ts b/packages/extension-inject/src/types.ts index 4038f466..442b45c3 100644 --- a/packages/extension-inject/src/types.ts +++ b/packages/extension-inject/src/types.ts @@ -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; diff --git a/packages/extension-ui/src/Popup/Accounts/Account.tsx b/packages/extension-ui/src/Popup/Accounts/Account.tsx index aa991a75..d66c94e0 100644 --- a/packages/extension-ui/src/Popup/Accounts/Account.tsx +++ b/packages/extension-ui/src/Popup/Accounts/Account.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Accounts/AccountsTree.tsx b/packages/extension-ui/src/Popup/Accounts/AccountsTree.tsx index c794bc2f..64ff1839 100644 --- a/packages/extension-ui/src/Popup/Accounts/AccountsTree.tsx +++ b/packages/extension-ui/src/Popup/Accounts/AccountsTree.tsx @@ -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 { diff --git a/packages/extension-ui/src/Popup/Accounts/AddAccount.tsx b/packages/extension-ui/src/Popup/Accounts/AddAccount.tsx index da501184..ac811284 100644 --- a/packages/extension-ui/src/Popup/Accounts/AddAccount.tsx +++ b/packages/extension-ui/src/Popup/Accounts/AddAccount.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Accounts/AddAccountImage.tsx b/packages/extension-ui/src/Popup/Accounts/AddAccountImage.tsx index ac977e1a..7c78402c 100644 --- a/packages/extension-ui/src/Popup/Accounts/AddAccountImage.tsx +++ b/packages/extension-ui/src/Popup/Accounts/AddAccountImage.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Accounts/index.tsx b/packages/extension-ui/src/Popup/Accounts/index.tsx index 749a0172..9e1df3f0 100644 --- a/packages/extension-ui/src/Popup/Accounts/index.tsx +++ b/packages/extension-ui/src/Popup/Accounts/index.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Authorize/Authorize.test.tsx b/packages/extension-ui/src/Popup/Authorize/Authorize.test.tsx index 9eb079d7..8b40a3a5 100644 --- a/packages/extension-ui/src/Popup/Authorize/Authorize.test.tsx +++ b/packages/extension-ui/src/Popup/Authorize/Authorize.test.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Authorize/Request.tsx b/packages/extension-ui/src/Popup/Authorize/Request.tsx index a28b5ac2..64e85b3e 100644 --- a/packages/extension-ui/src/Popup/Authorize/Request.tsx +++ b/packages/extension-ui/src/Popup/Authorize/Request.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Authorize/index.tsx b/packages/extension-ui/src/Popup/Authorize/index.tsx index abf43cfe..06cf2fcb 100644 --- a/packages/extension-ui/src/Popup/Authorize/index.tsx +++ b/packages/extension-ui/src/Popup/Authorize/index.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Derive/AddressDropdown.tsx b/packages/extension-ui/src/Popup/Derive/AddressDropdown.tsx index 5399886a..f19a6363 100644 --- a/packages/extension-ui/src/Popup/Derive/AddressDropdown.tsx +++ b/packages/extension-ui/src/Popup/Derive/AddressDropdown.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Derive/DerivationPath.tsx b/packages/extension-ui/src/Popup/Derive/DerivationPath.tsx index 2ba636b7..33b8c2f9 100644 --- a/packages/extension-ui/src/Popup/Derive/DerivationPath.tsx +++ b/packages/extension-ui/src/Popup/Derive/DerivationPath.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Derive/Derive.test.tsx b/packages/extension-ui/src/Popup/Derive/Derive.test.tsx index 6d89a3ab..83e800a2 100644 --- a/packages/extension-ui/src/Popup/Derive/Derive.test.tsx +++ b/packages/extension-ui/src/Popup/Derive/Derive.test.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Derive/SelectParent.tsx b/packages/extension-ui/src/Popup/Derive/SelectParent.tsx index 15f560a5..91723bd1 100644 --- a/packages/extension-ui/src/Popup/Derive/SelectParent.tsx +++ b/packages/extension-ui/src/Popup/Derive/SelectParent.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Export.tsx b/packages/extension-ui/src/Popup/Export.tsx index f4e67a53..4a11e939 100644 --- a/packages/extension-ui/src/Popup/Export.tsx +++ b/packages/extension-ui/src/Popup/Export.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Forget.tsx b/packages/extension-ui/src/Popup/Forget.tsx index 646ee125..90b244f0 100644 --- a/packages/extension-ui/src/Popup/Forget.tsx +++ b/packages/extension-ui/src/Popup/Forget.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Metadata/Request.tsx b/packages/extension-ui/src/Popup/Metadata/Request.tsx index f24e34ec..672e31b0 100644 --- a/packages/extension-ui/src/Popup/Metadata/Request.tsx +++ b/packages/extension-ui/src/Popup/Metadata/Request.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/PhishingDetected.tsx b/packages/extension-ui/src/Popup/PhishingDetected.tsx index 8dafc7d8..1bb256d0 100644 --- a/packages/extension-ui/src/Popup/PhishingDetected.tsx +++ b/packages/extension-ui/src/Popup/PhishingDetected.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/RestoreJson.tsx b/packages/extension-ui/src/Popup/RestoreJson.tsx index d814e767..e32e1ee9 100644 --- a/packages/extension-ui/src/Popup/RestoreJson.tsx +++ b/packages/extension-ui/src/Popup/RestoreJson.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/Extrinsic.tsx b/packages/extension-ui/src/Popup/Signing/Extrinsic.tsx index 070770c6..9bd01d59 100644 --- a/packages/extension-ui/src/Popup/Signing/Extrinsic.tsx +++ b/packages/extension-ui/src/Popup/Signing/Extrinsic.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/Qr.tsx b/packages/extension-ui/src/Popup/Signing/Qr.tsx index 08eb1121..6f1e074b 100644 --- a/packages/extension-ui/src/Popup/Signing/Qr.tsx +++ b/packages/extension-ui/src/Popup/Signing/Qr.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/Request/index.tsx b/packages/extension-ui/src/Popup/Signing/Request/index.tsx index 0f32e479..0c8852eb 100644 --- a/packages/extension-ui/src/Popup/Signing/Request/index.tsx +++ b/packages/extension-ui/src/Popup/Signing/Request/index.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/Signing.test.tsx b/packages/extension-ui/src/Popup/Signing/Signing.test.tsx index 4dd3875e..ad80dd0b 100644 --- a/packages/extension-ui/src/Popup/Signing/Signing.test.tsx +++ b/packages/extension-ui/src/Popup/Signing/Signing.test.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx b/packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx index 8929ada7..8eb460dd 100644 --- a/packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx +++ b/packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Signing/index.tsx b/packages/extension-ui/src/Popup/Signing/index.tsx index aa56ac2d..5bf2a5fe 100644 --- a/packages/extension-ui/src/Popup/Signing/index.tsx +++ b/packages/extension-ui/src/Popup/Signing/index.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/Welcome.tsx b/packages/extension-ui/src/Popup/Welcome.tsx index e884960d..ba39465d 100644 --- a/packages/extension-ui/src/Popup/Welcome.tsx +++ b/packages/extension-ui/src/Popup/Welcome.tsx @@ -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'; diff --git a/packages/extension-ui/src/Popup/index.tsx b/packages/extension-ui/src/Popup/index.tsx index adad2343..0891d34a 100644 --- a/packages/extension-ui/src/Popup/index.tsx +++ b/packages/extension-ui/src/Popup/index.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/ActionText.tsx b/packages/extension-ui/src/components/ActionText.tsx index 3641990b..cd3268df 100644 --- a/packages/extension-ui/src/components/ActionText.tsx +++ b/packages/extension-ui/src/components/ActionText.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Address.tsx b/packages/extension-ui/src/components/Address.tsx index ac2bf7aa..39ce67fb 100644 --- a/packages/extension-ui/src/components/Address.tsx +++ b/packages/extension-ui/src/components/Address.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/BackButton.tsx b/packages/extension-ui/src/components/BackButton.tsx index 4d7bebc0..1076ec68 100644 --- a/packages/extension-ui/src/components/BackButton.tsx +++ b/packages/extension-ui/src/components/BackButton.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Box.tsx b/packages/extension-ui/src/components/Box.tsx index dcd55c78..4afd90fb 100644 --- a/packages/extension-ui/src/components/Box.tsx +++ b/packages/extension-ui/src/components/Box.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Button.tsx b/packages/extension-ui/src/components/Button.tsx index a949f376..9440eaf1 100644 --- a/packages/extension-ui/src/components/Button.tsx +++ b/packages/extension-ui/src/components/Button.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/ButtonArea.tsx b/packages/extension-ui/src/components/ButtonArea.tsx index 97f4ec26..54c285ad 100644 --- a/packages/extension-ui/src/components/ButtonArea.tsx +++ b/packages/extension-ui/src/components/ButtonArea.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Checkbox.tsx b/packages/extension-ui/src/components/Checkbox.tsx index 69c9ea05..c4ce5b3e 100644 --- a/packages/extension-ui/src/components/Checkbox.tsx +++ b/packages/extension-ui/src/components/Checkbox.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Dropdown.tsx b/packages/extension-ui/src/components/Dropdown.tsx index 3c72e44e..c7295b42 100644 --- a/packages/extension-ui/src/components/Dropdown.tsx +++ b/packages/extension-ui/src/components/Dropdown.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Identicon.tsx b/packages/extension-ui/src/components/Identicon.tsx index 4061a938..32420e33 100644 --- a/packages/extension-ui/src/components/Identicon.tsx +++ b/packages/extension-ui/src/components/Identicon.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/InputFileWithLabel.tsx b/packages/extension-ui/src/components/InputFileWithLabel.tsx index 8585a29c..d8444d37 100644 --- a/packages/extension-ui/src/components/InputFileWithLabel.tsx +++ b/packages/extension-ui/src/components/InputFileWithLabel.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Label.tsx b/packages/extension-ui/src/components/Label.tsx index 37d9e0bd..91e48d8b 100644 --- a/packages/extension-ui/src/components/Label.tsx +++ b/packages/extension-ui/src/components/Label.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Link.tsx b/packages/extension-ui/src/components/Link.tsx index a64b6525..d59d3b23 100644 --- a/packages/extension-ui/src/components/Link.tsx +++ b/packages/extension-ui/src/components/Link.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/List.tsx b/packages/extension-ui/src/components/List.tsx index bdc5efc9..ce37b2d7 100644 --- a/packages/extension-ui/src/components/List.tsx +++ b/packages/extension-ui/src/components/List.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import { ThemeProps } from '../types'; +import type { ThemeProps } from '../types'; import styled from 'styled-components'; diff --git a/packages/extension-ui/src/components/Main.tsx b/packages/extension-ui/src/components/Main.tsx index 00423878..44af4d9b 100644 --- a/packages/extension-ui/src/components/Main.tsx +++ b/packages/extension-ui/src/components/Main.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Menu.tsx b/packages/extension-ui/src/components/Menu.tsx index e60c7169..68bf64f2 100644 --- a/packages/extension-ui/src/components/Menu.tsx +++ b/packages/extension-ui/src/components/Menu.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/MenuDivider.tsx b/packages/extension-ui/src/components/MenuDivider.tsx index b8d4611c..023c9029 100644 --- a/packages/extension-ui/src/components/MenuDivider.tsx +++ b/packages/extension-ui/src/components/MenuDivider.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/MenuItem.tsx b/packages/extension-ui/src/components/MenuItem.tsx index bb2a4de1..04f1b520 100644 --- a/packages/extension-ui/src/components/MenuItem.tsx +++ b/packages/extension-ui/src/components/MenuItem.tsx @@ -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; diff --git a/packages/extension-ui/src/components/MnemonicSeed.tsx b/packages/extension-ui/src/components/MnemonicSeed.tsx index c38911db..c1112e85 100644 --- a/packages/extension-ui/src/components/MnemonicSeed.tsx +++ b/packages/extension-ui/src/components/MnemonicSeed.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/NextStepButton.tsx b/packages/extension-ui/src/components/NextStepButton.tsx index 230b7cf8..25a8cdcd 100644 --- a/packages/extension-ui/src/components/NextStepButton.tsx +++ b/packages/extension-ui/src/components/NextStepButton.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Spinner.tsx b/packages/extension-ui/src/components/Spinner.tsx index 68321d68..cdc55fc8 100644 --- a/packages/extension-ui/src/components/Spinner.tsx +++ b/packages/extension-ui/src/components/Spinner.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Svg.tsx b/packages/extension-ui/src/components/Svg.tsx index 1749d3dc..67a75997 100644 --- a/packages/extension-ui/src/components/Svg.tsx +++ b/packages/extension-ui/src/components/Svg.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import { ThemeProps } from '../types'; +import type { ThemeProps } from '../types'; import styled from 'styled-components'; diff --git a/packages/extension-ui/src/components/Switch.tsx b/packages/extension-ui/src/components/Switch.tsx index 543ad38c..171bbfde 100644 --- a/packages/extension-ui/src/components/Switch.tsx +++ b/packages/extension-ui/src/components/Switch.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Table.tsx b/packages/extension-ui/src/components/Table.tsx index 5bb2f735..9040b92d 100644 --- a/packages/extension-ui/src/components/Table.tsx +++ b/packages/extension-ui/src/components/Table.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/TextInputs.ts b/packages/extension-ui/src/components/TextInputs.ts index 169f89ca..0ef68bb2 100644 --- a/packages/extension-ui/src/components/TextInputs.ts +++ b/packages/extension-ui/src/components/TextInputs.ts @@ -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'; diff --git a/packages/extension-ui/src/components/Toast/Toast.tsx b/packages/extension-ui/src/components/Toast/Toast.tsx index f9c48bce..42257ab0 100644 --- a/packages/extension-ui/src/components/Toast/Toast.tsx +++ b/packages/extension-ui/src/components/Toast/Toast.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/View.tsx b/packages/extension-ui/src/components/View.tsx index fae0c0fa..f85605de 100644 --- a/packages/extension-ui/src/components/View.tsx +++ b/packages/extension-ui/src/components/View.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/Warning.tsx b/packages/extension-ui/src/components/Warning.tsx index d3824a72..6fa36a75 100644 --- a/packages/extension-ui/src/components/Warning.tsx +++ b/packages/extension-ui/src/components/Warning.tsx @@ -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'; diff --git a/packages/extension-ui/src/components/contexts.tsx b/packages/extension-ui/src/components/contexts.tsx index 8d0cf9a2..695b5a76 100644 --- a/packages/extension-ui/src/components/contexts.tsx +++ b/packages/extension-ui/src/components/contexts.tsx @@ -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'; diff --git a/packages/extension-ui/src/hooks/useMetadata.ts b/packages/extension-ui/src/hooks/useMetadata.ts index 9f9e5163..dcc62b52 100644 --- a/packages/extension-ui/src/hooks/useMetadata.ts +++ b/packages/extension-ui/src/hooks/useMetadata.ts @@ -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'; diff --git a/packages/extension-ui/src/messaging.ts b/packages/extension-ui/src/messaging.ts index c4368497..9e9a3069 100644 --- a/packages/extension-ui/src/messaging.ts +++ b/packages/extension-ui/src/messaging.ts @@ -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 diff --git a/packages/extension-ui/src/partials/Header.tsx b/packages/extension-ui/src/partials/Header.tsx index 5eb73c58..f5a310b9 100644 --- a/packages/extension-ui/src/partials/Header.tsx +++ b/packages/extension-ui/src/partials/Header.tsx @@ -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'; diff --git a/packages/extension-ui/src/partials/HeaderWithSteps.tsx b/packages/extension-ui/src/partials/HeaderWithSteps.tsx index f8de764e..297568ea 100644 --- a/packages/extension-ui/src/partials/HeaderWithSteps.tsx +++ b/packages/extension-ui/src/partials/HeaderWithSteps.tsx @@ -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'; diff --git a/packages/extension-ui/src/partials/MenuAdd.tsx b/packages/extension-ui/src/partials/MenuAdd.tsx index 2ccea0be..de69ef5a 100644 --- a/packages/extension-ui/src/partials/MenuAdd.tsx +++ b/packages/extension-ui/src/partials/MenuAdd.tsx @@ -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'; diff --git a/packages/extension-ui/src/partials/MenuSettings.tsx b/packages/extension-ui/src/partials/MenuSettings.tsx index 49400de7..5481dadb 100644 --- a/packages/extension-ui/src/partials/MenuSettings.tsx +++ b/packages/extension-ui/src/partials/MenuSettings.tsx @@ -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'; diff --git a/packages/extension-ui/src/util/buildHierarchy.test.ts b/packages/extension-ui/src/util/buildHierarchy.test.ts index c804373b..89927013 100644 --- a/packages/extension-ui/src/util/buildHierarchy.test.ts +++ b/packages/extension-ui/src/util/buildHierarchy.test.ts @@ -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 = { diff --git a/packages/extension-ui/src/util/buildHierarchy.ts b/packages/extension-ui/src/util/buildHierarchy.ts index 05fc26d7..e83ad9a5 100644 --- a/packages/extension-ui/src/util/buildHierarchy.ts +++ b/packages/extension-ui/src/util/buildHierarchy.ts @@ -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'; diff --git a/packages/extension-ui/src/util/nextDerivationPath.ts b/packages/extension-ui/src/util/nextDerivationPath.ts index fefd12e3..20a093c0 100644 --- a/packages/extension-ui/src/util/nextDerivationPath.ts +++ b/packages/extension-ui/src/util/nextDerivationPath.ts @@ -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; diff --git a/packages/extension/src/content.ts b/packages/extension/src/content.ts index 5238a32b..e7d1988c 100644 --- a/packages/extension/src/content.ts +++ b/packages/extension/src/content.ts @@ -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'; diff --git a/packages/extension/src/page.ts b/packages/extension/src/page.ts index 648f4db4..0e78dfd6 100644 --- a/packages/extension/src/page.ts +++ b/packages/extension/src/page.ts @@ -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';