From 0e52e8fe23ed029b8101cf8bf82deccd5aa7a790 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 2 Dec 2020 10:12:19 +0100 Subject: [PATCH] Some type imports (interfaces) (#2887) * Some type imports (interfaces) * Additional * Additional * Small movements/fixes * Additional * Additional * Unsaved... --- packages/api-contract/src/Abi.ts | 8 +++--- packages/api-contract/src/MetaRegistry.ts | 5 ++-- packages/api-contract/src/base/Base.ts | 4 +-- packages/api-contract/src/base/Blueprint.ts | 12 ++++----- packages/api-contract/src/base/Code.ts | 8 +++--- packages/api-contract/src/base/Contract.ts | 14 +++++------ packages/api-contract/src/base/types.ts | 15 ++++++----- .../api-contract/src/promise/Blueprint.ts | 4 +-- packages/api-contract/src/promise/Code.ts | 5 ++-- packages/api-contract/src/promise/Contract.ts | 4 +-- packages/api-contract/src/rx/Blueprint.ts | 4 +-- packages/api-contract/src/rx/Code.ts | 4 +-- packages/api-contract/src/rx/Contract.ts | 4 +-- packages/api-contract/src/types.ts | 16 ++++++------ packages/api-contract/src/util.ts | 10 ++++---- packages/api-derive/src/accounts/accountId.ts | 5 ++-- packages/api-derive/src/accounts/flags.ts | 13 +++++----- .../api-derive/src/accounts/idAndIndex.ts | 7 +++--- packages/api-derive/src/accounts/idToIndex.ts | 6 ++--- packages/api-derive/src/accounts/identity.ts | 13 +++++----- packages/api-derive/src/accounts/indexToId.ts | 9 ++++--- packages/api-derive/src/accounts/indexes.ts | 11 ++++---- packages/api-derive/src/accounts/info.ts | 13 +++++----- packages/api-derive/src/accounts/types.ts | 2 +- packages/api-derive/src/balances/account.ts | 9 ++++--- packages/api-derive/src/balances/all.ts | 11 ++++---- packages/api-derive/src/balances/fees.ts | 9 ++++--- .../api-derive/src/balances/votingBalances.ts | 7 +++--- packages/api-derive/src/chain/bestNumber.ts | 4 +-- .../src/chain/bestNumberFinalized.ts | 4 +-- .../api-derive/src/chain/bestNumberLag.ts | 5 ++-- packages/api-derive/src/chain/getBlock.ts | 3 ++- packages/api-derive/src/chain/getHeader.ts | 3 ++- .../src/chain/subscribeNewBlocks.ts | 9 ++++--- .../api-derive/src/chain/subscribeNewHeads.ts | 3 ++- packages/api-derive/src/chain/types.ts | 2 +- .../api-derive/src/collective/proposals.ts | 11 ++++---- packages/api-derive/src/contracts/fees.ts | 7 +++--- packages/api-derive/src/council/proposals.ts | 8 +++--- packages/api-derive/src/council/types.ts | 2 +- packages/api-derive/src/council/votes.ts | 13 +++++----- packages/api-derive/src/council/votesOf.ts | 8 +++--- .../api-derive/src/democracy/dispatchQueue.ts | 13 +++++----- packages/api-derive/src/democracy/locks.ts | 11 ++++---- .../api-derive/src/democracy/nextExternal.ts | 13 +++++----- packages/api-derive/src/democracy/preimage.ts | 12 ++++----- .../api-derive/src/democracy/preimages.ts | 12 ++++----- .../api-derive/src/democracy/proposals.ts | 13 +++++----- .../api-derive/src/democracy/referendumIds.ts | 7 +++--- .../api-derive/src/democracy/referendums.ts | 7 +++--- .../src/democracy/referendumsActive.ts | 7 +++--- .../src/democracy/referendumsFinished.ts | 8 +++--- .../src/democracy/referendumsInfo.ts | 11 ++++---- .../src/democracy/sqrtElectorate.ts | 2 +- packages/api-derive/src/democracy/types.ts | 5 ++-- packages/api-derive/src/democracy/util.ts | 10 ++++---- packages/api-derive/src/elections/info.ts | 12 ++++----- packages/api-derive/src/elections/types.ts | 5 ++-- .../src/imOnline/receivedHeartbeats.ts | 11 ++++---- packages/api-derive/src/index.ts | 7 +++--- packages/api-derive/src/parachains/info.ts | 9 ++++--- .../api-derive/src/parachains/overview.ts | 9 ++++--- packages/api-derive/src/parachains/types.ts | 7 +++--- packages/api-derive/src/parachains/util.ts | 4 +-- packages/api-derive/src/session/eraLength.ts | 4 +-- .../api-derive/src/session/eraProgress.ts | 4 +-- packages/api-derive/src/session/indexes.ts | 11 ++++---- packages/api-derive/src/session/info.ts | 10 ++++---- packages/api-derive/src/session/progress.ts | 11 ++++---- .../api-derive/src/session/sessionProgress.ts | 4 +-- packages/api-derive/src/session/types.ts | 5 ++-- packages/api-derive/src/society/candidates.ts | 13 +++++----- packages/api-derive/src/society/info.ts | 10 ++++---- packages/api-derive/src/society/member.ts | 12 ++++----- packages/api-derive/src/society/members.ts | 9 ++++--- packages/api-derive/src/staking/account.ts | 6 ++--- .../api-derive/src/staking/currentPoints.ts | 7 +++--- .../api-derive/src/staking/electedInfo.ts | 8 +++--- .../api-derive/src/staking/erasExposure.ts | 11 ++++---- .../api-derive/src/staking/erasHistoric.ts | 9 ++++--- packages/api-derive/src/staking/erasPoints.ts | 9 ++++--- packages/api-derive/src/staking/erasPrefs.ts | 11 ++++---- .../api-derive/src/staking/erasRewards.ts | 11 ++++---- .../api-derive/src/staking/erasSlashes.ts | 13 +++++----- packages/api-derive/src/staking/keys.ts | 13 +++++----- packages/api-derive/src/staking/overview.ts | 7 +++--- .../api-derive/src/staking/ownExposure.ts | 9 ++++--- packages/api-derive/src/staking/ownSlashes.ts | 13 +++++----- packages/api-derive/src/staking/query.ts | 13 +++++----- .../api-derive/src/staking/stakerExposure.ts | 8 +++--- .../api-derive/src/staking/stakerPoints.ts | 8 +++--- .../api-derive/src/staking/stakerPrefs.ts | 16 ++++++------ .../api-derive/src/staking/stakerRewards.ts | 13 +++++----- .../api-derive/src/staking/stakerSlashes.ts | 8 +++--- packages/api-derive/src/staking/stashes.ts | 6 ++--- packages/api-derive/src/staking/types.ts | 4 +-- packages/api-derive/src/staking/util.ts | 2 +- packages/api-derive/src/staking/validators.ts | 9 ++++--- .../api-derive/src/staking/validatorsFrom.ts | 10 ++++---- .../api-derive/src/staking/waitingInfo.ts | 7 +++--- .../src/technicalCommittee/proposals.ts | 6 ++--- packages/api-derive/src/treasury/proposals.ts | 11 ++++---- packages/api-derive/src/tx/events.ts | 5 ++-- packages/api-derive/src/tx/signingInfo.ts | 7 +++--- .../api-derive/src/type/HeaderExtended.ts | 4 +-- .../src/type/SignedBlockExtended.ts | 4 +-- packages/api-derive/src/type/util.ts | 2 +- packages/api-derive/src/types.ts | 5 ++-- .../src/util/approvalFlagToBools.spec.ts | 2 +- .../src/util/approvalFlagsToBools.ts | 11 ++++---- packages/api-derive/src/util/cache.ts | 2 +- packages/api-derive/src/util/cacheImpl.ts | 2 +- packages/api-derive/src/util/memo.ts | 4 ++- packages/api/src/base/Decorate.ts | 16 ++++++------ packages/api/src/base/Events.ts | 2 +- packages/api/src/base/Getters.ts | 10 ++++---- packages/api/src/base/Init.ts | 13 +++++----- packages/api/src/base/index.ts | 4 +-- packages/api/src/base/types.ts | 9 +++---- packages/api/src/checkTypes.manual.ts | 4 +-- packages/api/src/promise/Combinator.ts | 4 +-- packages/api/src/promise/Combinators.spec.ts | 3 ++- packages/api/src/promise/index.spec.ts | 2 +- packages/api/src/promise/index.ts | 4 +-- packages/api/src/promise/types.ts | 5 ++-- packages/api/src/rx/index.spec.ts | 4 +-- packages/api/src/rx/index.ts | 4 +-- packages/api/src/submittable/Result.ts | 6 ++--- packages/api/src/submittable/createClass.ts | 11 ++++---- .../api/src/submittable/createSubmittable.ts | 6 ++--- packages/api/src/submittable/types.ts | 9 +++---- packages/api/src/types/base.ts | 2 +- packages/api/src/types/consts.ts | 10 +++----- packages/api/src/types/index.ts | 25 +++++++++---------- packages/api/src/types/rpc.ts | 7 +++--- packages/api/src/types/storage.ts | 14 +++++------ packages/api/src/types/submittable.ts | 7 +++--- packages/api/src/util/decorate.ts | 4 +-- packages/api/src/util/filterEvents.ts | 2 +- packages/api/src/util/isKeyringPair.ts | 4 +-- packages/api/src/util/validate.ts | 4 +-- packages/api/test/util/SingleAccountSigner.ts | 6 ++--- packages/api/test/util/logEvents.ts | 2 +- packages/metadata/src/MagicNumber.ts | 2 +- packages/metadata/src/Metadata.ts | 2 +- packages/metadata/src/MetadataVersioned.ts | 4 +-- .../src/decorate/consts/fromMetadata.spec.ts | 2 +- .../src/decorate/consts/fromMetadata.ts | 4 +-- .../decorate/extrinsics/createUnchecked.ts | 4 +-- .../src/decorate/extrinsics/fromMetadata.ts | 2 +- .../metadata/src/decorate/extrinsics/index.ts | 2 +- packages/metadata/src/decorate/index.ts | 4 +-- .../src/decorate/storage/createFunction.ts | 6 ++--- .../src/decorate/storage/fromMetadata.ts | 4 +-- .../src/decorate/storage/getHasher.ts | 5 ++-- .../metadata/src/decorate/storage/storage.ts | 6 ++--- .../src/decorate/storage/substrate.ts | 6 ++--- packages/metadata/src/decorate/types.ts | 6 ++--- packages/metadata/src/types.ts | 4 +-- packages/metadata/src/util/extractTypes.ts | 3 ++- packages/metadata/src/util/getUniqTypes.ts | 7 +++--- packages/metadata/src/util/testUtil.ts | 4 +-- packages/metadata/src/util/toCallsOnly.ts | 4 +-- packages/metadata/src/util/validateTypes.ts | 2 +- packages/metadata/src/v10/toV11.ts | 4 +-- packages/metadata/src/v11/toV12.ts | 4 +-- packages/metadata/src/v12/toLatest.ts | 4 +-- packages/metadata/src/v9/toV10.ts | 4 +-- packages/rpc-core/src/index.ts | 14 ++++++----- packages/rpc-core/src/methodSend.spec.ts | 2 +- packages/rpc-core/src/replay.spec.ts | 4 ++- packages/rpc-core/src/types.jsonrpc.ts | 2 +- packages/rpc-core/src/types.ts | 2 +- packages/rpc-core/src/util/drr.ts | 2 +- .../src/coder/decodeResponse.spec.ts | 3 ++- packages/rpc-provider/src/coder/index.ts | 2 +- packages/rpc-provider/src/http/index.ts | 2 +- packages/rpc-provider/src/http/types.ts | 4 +-- packages/rpc-provider/src/mock/index.ts | 8 +++--- packages/rpc-provider/src/mock/on.spec.ts | 2 +- packages/rpc-provider/src/mock/types.ts | 5 ++-- packages/rpc-provider/src/ws/index.ts | 2 +- packages/rpc-provider/src/ws/send.spec.ts | 2 +- .../rpc-provider/src/ws/subscribe.spec.ts | 2 +- .../rpc-provider/src/ws/unsubscribe.spec.ts | 2 +- packages/typegen/src/generate/query.ts | 6 ++--- packages/typegen/src/generate/rpc.ts | 4 +-- packages/typegen/src/generate/tsDef.ts | 5 ++-- packages/typegen/src/generate/tx.ts | 5 ++-- packages/typegen/src/metadataMd.ts | 4 +-- packages/typegen/src/util/class.ts | 2 +- packages/typegen/src/util/derived.ts | 5 ++-- packages/typegen/src/util/formatting.ts | 5 ++-- packages/types-known/src/chain/index.ts | 2 +- packages/types-known/src/index.ts | 6 ++--- packages/types-known/src/modules.ts | 2 +- .../types-known/src/spec/centrifuge-chain.ts | 2 +- packages/types-known/src/spec/index.ts | 2 +- packages/types-known/src/spec/kusama.ts | 2 +- .../types-known/src/spec/node-template.ts | 2 +- packages/types-known/src/spec/node.ts | 2 +- packages/types-known/src/spec/polkadot.ts | 2 +- packages/types-known/src/spec/rococo.ts | 2 +- packages/types-known/src/spec/westend.ts | 2 +- packages/types-known/src/upgrades/index.ts | 4 +-- packages/types-known/src/upgrades/kusama.ts | 2 +- packages/types-known/src/upgrades/polkadot.ts | 2 +- packages/types-known/src/upgrades/westend.ts | 2 +- packages/types/src/codec/AbstractArray.ts | 4 +-- packages/types/src/codec/AbstractInt.ts | 6 ++--- packages/types/src/codec/BTreeMap.ts | 2 +- packages/types/src/codec/BTreeSet.spec.ts | 2 +- packages/types/src/codec/BTreeSet.ts | 4 +-- packages/types/src/codec/Base.ts | 4 +-- packages/types/src/codec/Compact.ts | 6 ++--- packages/types/src/codec/Date.spec.ts | 2 +- packages/types/src/codec/Date.ts | 6 ++--- packages/types/src/codec/Enum.spec.ts | 2 +- packages/types/src/codec/Enum.ts | 4 +-- packages/types/src/codec/HashMap.ts | 2 +- packages/types/src/codec/Int.ts | 4 +-- packages/types/src/codec/Json.ts | 4 +-- packages/types/src/codec/Linkage.ts | 2 +- packages/types/src/codec/Map.spec.ts | 2 +- packages/types/src/codec/Map.ts | 4 +-- packages/types/src/codec/Option.ts | 4 +-- packages/types/src/codec/Raw.spec.ts | 2 +- packages/types/src/codec/Raw.ts | 4 +-- packages/types/src/codec/Result.ts | 2 +- packages/types/src/codec/Set.ts | 4 +-- packages/types/src/codec/Struct.spec.ts | 2 +- packages/types/src/codec/Struct.ts | 4 +-- packages/types/src/codec/Tuple.spec.ts | 6 ++--- packages/types/src/codec/Tuple.ts | 2 +- packages/types/src/codec/U8aFixed.ts | 4 +-- packages/types/src/codec/UInt.ts | 4 +-- packages/types/src/codec/Vec.spec.ts | 4 +-- packages/types/src/codec/Vec.ts | 2 +- packages/types/src/codec/VecAny.ts | 2 +- packages/types/src/codec/VecFixed.ts | 2 +- packages/types/src/codec/types.ts | 3 +-- .../types/src/codec/utils/compareMap.spec.ts | 2 +- packages/types/src/codec/utils/decodeU8a.ts | 2 +- .../types/src/codec/utils/mapToTypeMap.ts | 2 +- .../src/codec/utils/typeToConstructor.ts | 2 +- packages/types/src/create/createClass.spec.ts | 1 - packages/types/src/create/createClass.ts | 8 +++--- packages/types/src/create/createType.ts | 4 +-- packages/types/src/create/encodeTypes.ts | 4 ++- packages/types/src/create/getTypeDef.spec.ts | 1 - packages/types/src/create/getTypeDef.ts | 3 ++- packages/types/src/create/registry.spec.ts | 2 +- packages/types/src/create/registry.ts | 4 +-- packages/types/src/create/types.ts | 2 +- packages/types/src/ethereum/AccountId.ts | 2 +- packages/types/src/ethereum/LookupSource.ts | 2 +- packages/types/src/extrinsic/Extrinsic.ts | 8 +++--- packages/types/src/extrinsic/ExtrinsicEra.ts | 2 +- .../types/src/extrinsic/ExtrinsicPayload.ts | 6 ++--- .../src/extrinsic/ExtrinsicPayloadUnknown.ts | 4 +-- .../types/src/extrinsic/ExtrinsicUnknown.ts | 4 +-- packages/types/src/extrinsic/SignerPayload.ts | 4 +-- .../src/extrinsic/signedExtensions/index.ts | 2 +- .../extrinsic/signedExtensions/polkadot.ts | 2 +- .../extrinsic/signedExtensions/substrate.ts | 2 +- .../src/extrinsic/signedExtensions/types.ts | 2 +- packages/types/src/extrinsic/types.ts | 2 +- packages/types/src/extrinsic/util.ts | 4 +-- packages/types/src/extrinsic/v4/Extrinsic.ts | 8 +++--- .../src/extrinsic/v4/ExtrinsicPayload.ts | 8 +++--- .../src/extrinsic/v4/ExtrinsicSignature.ts | 8 +++--- packages/types/src/generic/AccountId.ts | 2 +- packages/types/src/generic/AccountIndex.ts | 2 +- packages/types/src/generic/Block.ts | 4 +-- packages/types/src/generic/Call.ts | 4 +-- packages/types/src/generic/Event.ts | 8 +++--- packages/types/src/generic/LookupSource.ts | 2 +- packages/types/src/generic/MultiAddress.ts | 2 +- packages/types/src/generic/Vote.ts | 6 ++--- packages/types/src/index.spec.ts | 3 ++- .../interfaces/attestations/definitions.ts | 2 +- .../types/src/interfaces/aura/definitions.ts | 2 +- .../src/interfaces/author/definitions.ts | 2 +- .../src/interfaces/authorship/definitions.ts | 2 +- .../types/src/interfaces/babe/definitions.ts | 2 +- .../src/interfaces/balances/definitions.ts | 2 +- .../types/src/interfaces/chain/definitions.ts | 2 +- .../src/interfaces/childstate/definitions.ts | 2 +- .../src/interfaces/claims/definitions.ts | 2 +- .../src/interfaces/collective/definitions.ts | 2 +- .../src/interfaces/consensus/definitions.ts | 2 +- .../src/interfaces/contracts/definitions.ts | 2 +- .../interfaces/contractsAbi/definitions.ts | 2 +- .../src/interfaces/democracy/definitions.ts | 2 +- .../src/interfaces/elections/definitions.ts | 2 +- .../src/interfaces/engine/definitions.ts | 2 +- .../src/interfaces/ethereum/definitions.ts | 2 +- .../types/src/interfaces/evm/definitions.ts | 2 +- .../src/interfaces/extrinsics/definitions.ts | 2 +- .../interfaces/genericAsset/definitions.ts | 2 +- .../src/interfaces/grandpa/definitions.ts | 2 +- .../src/interfaces/identity/definitions.ts | 2 +- .../src/interfaces/imOnline/definitions.ts | 2 +- packages/types/src/interfaces/jsonrpc.ts | 2 +- .../src/interfaces/metadata/definitions.ts | 2 +- .../src/interfaces/offchain/definitions.ts | 2 +- .../src/interfaces/offences/definitions.ts | 2 +- .../src/interfaces/parachains/definitions.ts | 2 +- .../src/interfaces/payment/definitions.ts | 2 +- .../types/src/interfaces/poll/definitions.ts | 2 +- .../types/src/interfaces/proxy/definitions.ts | 2 +- .../src/interfaces/purchase/definitions.ts | 2 +- .../src/interfaces/recovery/definitions.ts | 2 +- .../types/src/interfaces/rpc/definitions.ts | 2 +- .../src/interfaces/runtime/definitions.ts | 2 +- .../src/interfaces/scaleInfo/definitions.ts | 2 +- .../src/interfaces/scheduler/definitions.ts | 2 +- .../src/interfaces/session/definitions.ts | 2 +- .../src/interfaces/society/definitions.ts | 2 +- .../src/interfaces/staking/definitions.ts | 2 +- .../interfaces/state/RuntimeVersion.spec.ts | 2 +- .../types/src/interfaces/state/definitions.ts | 2 +- .../src/interfaces/support/definitions.ts | 2 +- .../src/interfaces/syncstate/definitions.ts | 2 +- .../src/interfaces/system/definitions.ts | 2 +- .../src/interfaces/treasury/definitions.ts | 2 +- .../src/interfaces/txpayment/definitions.ts | 2 +- .../src/interfaces/utility/definitions.ts | 2 +- .../src/interfaces/vesting/definitions.ts | 2 +- packages/types/src/primitive/BitVec.ts | 2 +- packages/types/src/primitive/Bool.spec.ts | 2 +- packages/types/src/primitive/Bool.ts | 4 +-- packages/types/src/primitive/Bytes.ts | 2 +- packages/types/src/primitive/Data.ts | 4 +-- .../types/src/primitive/DoNotConstruct.ts | 2 +- packages/types/src/primitive/Null.ts | 4 +-- packages/types/src/primitive/StorageKey.ts | 8 +++--- packages/types/src/primitive/Text.spec.ts | 3 ++- packages/types/src/primitive/Text.ts | 4 +-- packages/types/src/primitive/Type.ts | 2 +- packages/types/src/primitive/USize.ts | 2 +- packages/types/src/primitive/types.ts | 4 +-- 342 files changed, 887 insertions(+), 837 deletions(-) diff --git a/packages/api-contract/src/Abi.ts b/packages/api-contract/src/Abi.ts index 8172d4b7af..6fa8d7d8be 100644 --- a/packages/api-contract/src/Abi.ts +++ b/packages/api-contract/src/Abi.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyJson, Codec, CodecArg } from '@polkadot/types/types'; -import { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageSpec, ContractMessageParamSpec, ContractProject } from '@polkadot/types/interfaces'; -import { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types'; +import type { Bytes } from '@polkadot/types'; +import type { AnyJson, Codec, CodecArg } from '@polkadot/types/types'; +import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageSpec, ContractMessageParamSpec, ContractProject } from '@polkadot/types/interfaces'; +import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types'; -import { Bytes } from '@polkadot/types'; import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util'; import { MetaRegistry } from './MetaRegistry'; diff --git a/packages/api-contract/src/MetaRegistry.ts b/packages/api-contract/src/MetaRegistry.ts index 6bbbf708cf..ae15034d56 100644 --- a/packages/api-contract/src/MetaRegistry.ts +++ b/packages/api-contract/src/MetaRegistry.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ContractDisplayName, ChainProperties, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefVariant, SiTypeDefSequence, SiTypeDefTuple, SiVariant } from '@polkadot/types/interfaces'; -import { InterfaceTypes, TypeDef, TypeDefInfo } from '@polkadot/types/types'; +import type { ContractDisplayName, ChainProperties, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefVariant, SiTypeDefSequence, SiTypeDefTuple, SiVariant } from '@polkadot/types/interfaces'; +import type { InterfaceTypes, TypeDef } from '@polkadot/types/types'; import { assert, isUndefined } from '@polkadot/util'; import { TypeRegistry, withTypeString } from '@polkadot/types/create'; +import { TypeDefInfo } from '@polkadot/types/types'; interface PartialTypeSpec { readonly type: SiLookupTypeId; diff --git a/packages/api-contract/src/base/Base.ts b/packages/api-contract/src/base/Base.ts index ca2695f1dc..186b916ce4 100644 --- a/packages/api-contract/src/base/Base.ts +++ b/packages/api-contract/src/base/Base.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes, DecorateMethod } from '@polkadot/api/types'; -import { AnyJson, Registry } from '@polkadot/types/types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; +import type { AnyJson, Registry } from '@polkadot/types/types'; import { ApiBase } from '@polkadot/api/base'; import { assert } from '@polkadot/util'; diff --git a/packages/api-contract/src/base/Blueprint.ts b/packages/api-contract/src/base/Blueprint.ts index dab58f6ccb..28f3cbf024 100644 --- a/packages/api-contract/src/base/Blueprint.ts +++ b/packages/api-contract/src/base/Blueprint.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes, DecorateMethod } from '@polkadot/api/types'; -import { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; -import { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces'; -import { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types'; -import { AbiConstructor, BlueprintOptions } from '../types'; -import { BlueprintDeploy, ContractGeneric, MapConstructorExec } from './types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces'; +import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types'; +import type { AbiConstructor, BlueprintOptions } from '../types'; +import type { BlueprintDeploy, ContractGeneric, MapConstructorExec } from './types'; import BN from 'bn.js'; import { SubmittableResult } from '@polkadot/api'; diff --git a/packages/api-contract/src/base/Code.ts b/packages/api-contract/src/base/Code.ts index fd4d8e50b6..411b349413 100644 --- a/packages/api-contract/src/base/Code.ts +++ b/packages/api-contract/src/base/Code.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes, DecorateMethod } from '@polkadot/api/types'; -import { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; -import { EventRecord, Hash } from '@polkadot/types/interfaces'; -import { AnyJson, ISubmittableResult } from '@polkadot/types/types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { EventRecord, Hash } from '@polkadot/types/interfaces'; +import type { AnyJson, ISubmittableResult } from '@polkadot/types/types'; import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; diff --git a/packages/api-contract/src/base/Contract.ts b/packages/api-contract/src/base/Contract.ts index 3064f05293..e202b6d311 100644 --- a/packages/api-contract/src/base/Contract.ts +++ b/packages/api-contract/src/base/Contract.ts @@ -1,18 +1,18 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes, DecorateMethod } from '@polkadot/api/types'; -import { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; -import { AccountId, ContractExecResult, EventRecord } from '@polkadot/types/interfaces'; -import { AnyJson, CodecArg, ISubmittableResult, Registry } from '@polkadot/types/types'; -import { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types'; -import { ContractCallResult, ContractCallSend, ContractGeneric, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { Bytes } from '@polkadot/types'; +import type { AccountId, ContractExecResult, EventRecord } from '@polkadot/types/interfaces'; +import type { AnyJson, CodecArg, ISubmittableResult, Registry } from '@polkadot/types/types'; +import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types'; +import type { ContractCallResult, ContractCallSend, ContractGeneric, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types'; import BN from 'bn.js'; import { map } from 'rxjs/operators'; import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; -import { Bytes } from '@polkadot/types'; import { assert, bnToBn, isFunction, isUndefined, logger, stringCamelCase } from '@polkadot/util'; import { Abi } from '../Abi'; diff --git a/packages/api-contract/src/base/types.ts b/packages/api-contract/src/base/types.ts index 53234255ae..639195c655 100644 --- a/packages/api-contract/src/base/types.ts +++ b/packages/api-contract/src/base/types.ts @@ -1,14 +1,13 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes, ObsInnerType } from '@polkadot/api/types'; -import { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; -import { AccountId } from '@polkadot/types/interfaces'; -import { CodecArg } from '@polkadot/types/types'; -import { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types'; - -import BN from 'bn.js'; -import { Observable } from 'rxjs'; +import type BN from 'bn.js'; +import type { Observable } from 'rxjs'; +import type { ApiTypes, ObsInnerType } from '@polkadot/api/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { CodecArg } from '@polkadot/types/types'; +import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types'; export interface BlueprintDeploy { (options: BlueprintOptions, ...params: CodecArg[]): SubmittableExtrinsic; diff --git a/packages/api-contract/src/promise/Blueprint.ts b/packages/api-contract/src/promise/Blueprint.ts index b7b6d695d8..509b83ca2b 100644 --- a/packages/api-contract/src/promise/Blueprint.ts +++ b/packages/api-contract/src/promise/Blueprint.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Hash } from '@polkadot/types/interfaces'; -import { AnyJson } from '@polkadot/types/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { AnyJson } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; import { decorateMethod } from '@polkadot/api/promise'; diff --git a/packages/api-contract/src/promise/Code.ts b/packages/api-contract/src/promise/Code.ts index 32e665b1b1..8593d18163 100644 --- a/packages/api-contract/src/promise/Code.ts +++ b/packages/api-contract/src/promise/Code.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; +import type { ApiPromise } from '@polkadot/api'; +import type { AnyJson } from '@polkadot/types/types'; + import { decorateMethod } from '@polkadot/api/promise'; -import { AnyJson } from '@polkadot/types/types'; import { Abi } from '../Abi'; import { Code as BaseCode } from '../base'; diff --git a/packages/api-contract/src/promise/Contract.ts b/packages/api-contract/src/promise/Contract.ts index bf7364fd73..21806329b8 100644 --- a/packages/api-contract/src/promise/Contract.ts +++ b/packages/api-contract/src/promise/Contract.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId } from '@polkadot/types/interfaces'; -import { AnyJson } from '@polkadot/types/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { AnyJson } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; import { decorateMethod } from '@polkadot/api/promise'; diff --git a/packages/api-contract/src/rx/Blueprint.ts b/packages/api-contract/src/rx/Blueprint.ts index a443c13d2e..1cab803c82 100644 --- a/packages/api-contract/src/rx/Blueprint.ts +++ b/packages/api-contract/src/rx/Blueprint.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Hash } from '@polkadot/types/interfaces'; -import { AnyJson } from '@polkadot/types/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { AnyJson } from '@polkadot/types/types'; import { ApiRx } from '@polkadot/api'; import { decorateMethod } from '@polkadot/api/rx'; diff --git a/packages/api-contract/src/rx/Code.ts b/packages/api-contract/src/rx/Code.ts index 440fbe0292..c6b138692c 100644 --- a/packages/api-contract/src/rx/Code.ts +++ b/packages/api-contract/src/rx/Code.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyJson } from '@polkadot/types/types'; +import type { ApiRx } from '@polkadot/api'; +import type { AnyJson } from '@polkadot/types/types'; -import { ApiRx } from '@polkadot/api'; import { decorateMethod } from '@polkadot/api/rx'; import { Abi } from '../Abi'; diff --git a/packages/api-contract/src/rx/Contract.ts b/packages/api-contract/src/rx/Contract.ts index bf959ec0bb..4d5530d77f 100644 --- a/packages/api-contract/src/rx/Contract.ts +++ b/packages/api-contract/src/rx/Contract.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId } from '@polkadot/types/interfaces'; -import { AnyJson } from '@polkadot/types/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { AnyJson } from '@polkadot/types/types'; import { ApiRx } from '@polkadot/api'; import { decorateMethod } from '@polkadot/api/rx'; diff --git a/packages/api-contract/src/types.ts b/packages/api-contract/src/types.ts index 76ad2b7157..7423dbb70a 100644 --- a/packages/api-contract/src/types.ts +++ b/packages/api-contract/src/types.ts @@ -1,15 +1,13 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiTypes } from '@polkadot/api/types'; -import { ContractExecResultResult, ContractSelector } from '@polkadot/types/interfaces'; -import { Codec, CodecArg, TypeDef } from '@polkadot/types/types'; - -import BN from 'bn.js'; -import { ApiBase } from '@polkadot/api/base'; -import { Text, u64 } from '@polkadot/types'; - -import { Abi } from '.'; +import type BN from 'bn.js'; +import type { ApiBase } from '@polkadot/api/base'; +import type { ApiTypes } from '@polkadot/api/types'; +import type { Text, u64 } from '@polkadot/types'; +import type { ContractExecResultResult, ContractSelector } from '@polkadot/types/interfaces'; +import type { Codec, CodecArg, TypeDef } from '@polkadot/types/types'; +import type { Abi } from '.'; export interface ContractBase { readonly abi: Abi; diff --git a/packages/api-contract/src/util.ts b/packages/api-contract/src/util.ts index 3629773809..22e8a94924 100644 --- a/packages/api-contract/src/util.ts +++ b/packages/api-contract/src/util.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/rpc-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SubmittableResult } from '@polkadot/api'; -import { EventRecord } from '@polkadot/types/interfaces'; -import { Codec, CodecArg, Registry, TypeDef } from '@polkadot/types/types'; -import { BlueprintOptions, ContractOptions } from './types'; +import type { SubmittableResult } from '@polkadot/api'; +import type { Raw } from '@polkadot/types'; +import type { EventRecord } from '@polkadot/types/interfaces'; +import type { Codec, CodecArg, Registry, TypeDef } from '@polkadot/types/types'; +import type { BlueprintOptions, ContractOptions } from './types'; import BN from 'bn.js'; -import { Raw } from '@polkadot/types'; import { createTypeUnsafe } from '@polkadot/types/create'; import { isBn, isBigInt, isNumber, isString } from '@polkadot/util'; diff --git a/packages/api-derive/src/accounts/accountId.ts b/packages/api-derive/src/accounts/accountId.ts index 3efb956e1e..4623bb4f1b 100644 --- a/packages/api-derive/src/accounts/accountId.ts +++ b/packages/api-derive/src/accounts/accountId.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { isU8a, assertReturn } from '@polkadot/util'; diff --git a/packages/api-derive/src/accounts/flags.ts b/packages/api-derive/src/accounts/flags.ts index 02bca5b4db..cb560c3074 100644 --- a/packages/api-derive/src/accounts/flags.ts +++ b/packages/api-derive/src/accounts/flags.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, Address, Balance } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveAccountFlags } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Vec } from '@polkadot/types'; +import type { AccountId, Address, Balance } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveAccountFlags } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Vec } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/idAndIndex.ts b/packages/api-derive/src/accounts/idAndIndex.ts index ba45994eb7..b3fc1377c2 100644 --- a/packages/api-derive/src/accounts/idAndIndex.ts +++ b/packages/api-derive/src/accounts/idAndIndex.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import { AccountIdAndIndex } from '../types'; +import type { Observable } from 'rxjs'; +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; +import type { AccountIdAndIndex } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { isU8a } from '@polkadot/util'; diff --git a/packages/api-derive/src/accounts/idToIndex.ts b/packages/api-derive/src/accounts/idToIndex.ts index 95b66887c6..acc2e3c830 100644 --- a/packages/api-derive/src/accounts/idToIndex.ts +++ b/packages/api-derive/src/accounts/idToIndex.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex } from '@polkadot/types/interfaces'; -import { AccountIndexes } from '../types'; +import type { Observable } from 'rxjs'; +import type { AccountId, AccountIndex } from '@polkadot/types/interfaces'; +import type { AccountIndexes } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/accounts/identity.ts b/packages/api-derive/src/accounts/identity.ts index cb4235b74e..8c0104f4dc 100644 --- a/packages/api-derive/src/accounts/identity.ts +++ b/packages/api-derive/src/accounts/identity.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, IdentityInfoAdditional, Registration } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveAccountRegistration, DeriveHasIdentity } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Data, Option } from '@polkadot/types'; +import type { AccountId, IdentityInfoAdditional, Registration } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveAccountRegistration, DeriveHasIdentity } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Data, Option } from '@polkadot/types'; import { u8aToString } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/indexToId.ts b/packages/api-derive/src/accounts/indexToId.ts index dfe0938dc5..e69b5ed1fe 100644 --- a/packages/api-derive/src/accounts/indexToId.ts +++ b/packages/api-derive/src/accounts/indexToId.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, BalanceOf } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; +import type { Observable } from 'rxjs'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, AccountIndex, BalanceOf } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { ENUMSET_SIZE } from '@polkadot/types/generic/AccountIndex'; -import { Option, Vec } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/indexes.ts b/packages/api-derive/src/accounts/indexes.ts index 0dc047e8ae..1cc6efbb10 100644 --- a/packages/api-derive/src/accounts/indexes.ts +++ b/packages/api-derive/src/accounts/indexes.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, AccountIndex } from '@polkadot/types/interfaces'; -import { AccountIndexes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Vec } from '@polkadot/types'; +import type { AccountId, AccountIndex } from '@polkadot/types/interfaces'; +import type { AccountIndexes } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, startWith, switchMap } from 'rxjs/operators'; import { ENUMSET_SIZE } from '@polkadot/types/generic/AccountIndex'; -import { Vec } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/info.ts b/packages/api-derive/src/accounts/info.ts index 2bab0c10a1..71af21d77c 100644 --- a/packages/api-derive/src/accounts/info.ts +++ b/packages/api-derive/src/accounts/info.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveAccountInfo, DeriveAccountRegistration } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Bytes, Option, u32 } from '@polkadot/types'; +import type { AccountId, AccountIndex, Address, Balance } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveAccountInfo, DeriveAccountRegistration } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Bytes, Option, u32 } from '@polkadot/types'; import { u8aToString } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/types.ts b/packages/api-derive/src/accounts/types.ts index da58449018..d0d0124413 100644 --- a/packages/api-derive/src/accounts/types.ts +++ b/packages/api-derive/src/accounts/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, RegistrationJudgement } from '@polkadot/types/interfaces'; +import type { AccountId, AccountIndex, RegistrationJudgement } from '@polkadot/types/interfaces'; export type AccountIdAndIndex = [AccountId?, AccountIndex?]; diff --git a/packages/api-derive/src/balances/account.ts b/packages/api-derive/src/balances/account.ts index dc45052104..61243d301b 100644 --- a/packages/api-derive/src/balances/account.ts +++ b/packages/api-derive/src/balances/account.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountData, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveBalancesAccount } from '../types'; +import type { Observable } from 'rxjs'; +import type { AccountId, AccountData, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveBalancesAccount } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api-derive/src/balances/all.ts b/packages/api-derive/src/balances/all.ts index e93477437f..0721e3c048 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, Address, Balance, BalanceLock, BalanceLockTo212, BlockNumber, VestingInfo, VestingSchedule } from '@polkadot/types/interfaces'; -import { DeriveBalancesAccount, DeriveBalancesAll } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, AccountIndex, Address, Balance, BalanceLock, BalanceLockTo212, BlockNumber, VestingInfo, VestingSchedule } from '@polkadot/types/interfaces'; +import type { DeriveBalancesAccount, DeriveBalancesAll } from '../types'; import BN from 'bn.js'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Option, Vec } from '@polkadot/types'; import { bnMax, isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/balances/fees.ts b/packages/api-derive/src/balances/fees.ts index 6b8741d23a..80a271ee07 100644 --- a/packages/api-derive/src/balances/fees.ts +++ b/packages/api-derive/src/balances/fees.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Balance } from '@polkadot/types/interfaces'; -import { DeriveFees } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Balance } from '@polkadot/types/interfaces'; +import type { DeriveFees } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/balances/votingBalances.ts b/packages/api-derive/src/balances/votingBalances.ts index bd5112468a..a1fdc92028 100644 --- a/packages/api-derive/src/balances/votingBalances.ts +++ b/packages/api-derive/src/balances/votingBalances.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import { DeriveBalancesAccount } from '../types'; +import type { Observable } from 'rxjs'; +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; +import type { DeriveBalancesAccount } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/bestNumber.ts b/packages/api-derive/src/chain/bestNumber.ts index 3a88e278c7..cf0cf53fda 100644 --- a/packages/api-derive/src/chain/bestNumber.ts +++ b/packages/api-derive/src/chain/bestNumber.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/chain/bestNumberFinalized.ts b/packages/api-derive/src/chain/bestNumberFinalized.ts index c4a7b5a5a9..7533736bba 100644 --- a/packages/api-derive/src/chain/bestNumberFinalized.ts +++ b/packages/api-derive/src/chain/bestNumberFinalized.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/chain/bestNumberLag.ts b/packages/api-derive/src/chain/bestNumberLag.ts index 6d76c47e2f..9040b8cd07 100644 --- a/packages/api-derive/src/chain/bestNumberLag.ts +++ b/packages/api-derive/src/chain/bestNumberLag.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/chain/getBlock.ts b/packages/api-derive/src/chain/getBlock.ts index 0c808b39b4..e6a948bf62 100644 --- a/packages/api-derive/src/chain/getBlock.ts +++ b/packages/api-derive/src/chain/getBlock.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Observable } from 'rxjs'; import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { SignedBlockExtended } from '../type'; diff --git a/packages/api-derive/src/chain/getHeader.ts b/packages/api-derive/src/chain/getHeader.ts index 5a220a5c3b..3a461470be 100644 --- a/packages/api-derive/src/chain/getHeader.ts +++ b/packages/api-derive/src/chain/getHeader.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Observable } from 'rxjs'; import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { HeaderExtended } from '../type'; diff --git a/packages/api-derive/src/chain/subscribeNewBlocks.ts b/packages/api-derive/src/chain/subscribeNewBlocks.ts index bf48f9eb6d..fd0617ddd2 100644 --- a/packages/api-derive/src/chain/subscribeNewBlocks.ts +++ b/packages/api-derive/src/chain/subscribeNewBlocks.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; -import { FullNewBlock } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; +import type { FullNewBlock } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/subscribeNewHeads.ts b/packages/api-derive/src/chain/subscribeNewHeads.ts index 5ca357e559..eebf8327fb 100644 --- a/packages/api-derive/src/chain/subscribeNewHeads.ts +++ b/packages/api-derive/src/chain/subscribeNewHeads.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Observable } from 'rxjs'; import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { HeaderExtended } from '../type'; diff --git a/packages/api-derive/src/chain/types.ts b/packages/api-derive/src/chain/types.ts index ac54b1f54c..dd42e7600b 100644 --- a/packages/api-derive/src/chain/types.ts +++ b/packages/api-derive/src/chain/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Block, BlockNumber, EventRecord, Hash, Justification } from '@polkadot/types/interfaces'; +import type { Block, BlockNumber, EventRecord, Hash, Justification } from '@polkadot/types/interfaces'; export interface FullNewBlock { block: Block; diff --git a/packages/api-derive/src/collective/proposals.ts b/packages/api-derive/src/collective/proposals.ts index 3e13de1583..3fed74bf26 100644 --- a/packages/api-derive/src/collective/proposals.ts +++ b/packages/api-derive/src/collective/proposals.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Hash, Proposal, Votes } from '@polkadot/types/interfaces'; -import { DeriveCollectiveProposal } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { Hash, Proposal, Votes } from '@polkadot/types/interfaces'; +import type { DeriveCollectiveProposal } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { catchError, map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/contracts/fees.ts b/packages/api-derive/src/contracts/fees.ts index 4bbe381437..c0eee7b2df 100644 --- a/packages/api-derive/src/contracts/fees.ts +++ b/packages/api-derive/src/contracts/fees.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveContractFees } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveContractFees } from '../types'; import BN from 'bn.js'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/council/proposals.ts b/packages/api-derive/src/council/proposals.ts index a3a8f4e111..e294181f36 100644 --- a/packages/api-derive/src/council/proposals.ts +++ b/packages/api-derive/src/council/proposals.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Hash } from '@polkadot/types/interfaces'; -import { DeriveCollectiveProposal } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { DeriveCollectiveProposal } from '../types'; -import { Observable } from 'rxjs'; import { proposal as collectiveProposal, proposals as collectiveProposals } from '../collective'; import { memo } from '../util'; diff --git a/packages/api-derive/src/council/types.ts b/packages/api-derive/src/council/types.ts index 56393d4e13..fe5df8251b 100644 --- a/packages/api-derive/src/council/types.ts +++ b/packages/api-derive/src/council/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance } from '@polkadot/types/interfaces'; +import type { AccountId, Balance } from '@polkadot/types/interfaces'; export interface DeriveCouncilVote { stake: Balance; diff --git a/packages/api-derive/src/council/votes.ts b/packages/api-derive/src/council/votes.ts index 7fd160aa8f..86cfed3d6c 100644 --- a/packages/api-derive/src/council/votes.ts +++ b/packages/api-derive/src/council/votes.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveCouncilVote, DeriveCouncilVotes } from '../types'; +import type { Observable } from 'rxjs'; +import type { Vec } from '@polkadot/types'; +import type { AccountId, Balance } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveCouncilVote, DeriveCouncilVotes } from '../types'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Vec } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/council/votesOf.ts b/packages/api-derive/src/council/votesOf.ts index f218c35b12..fce6d03fa3 100644 --- a/packages/api-derive/src/council/votesOf.ts +++ b/packages/api-derive/src/council/votesOf.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveCouncilVote } from '../types'; +import type { Observable } from 'rxjs'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveCouncilVote } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/dispatchQueue.ts b/packages/api-derive/src/democracy/dispatchQueue.ts index 184c985d0c..223a6abdfc 100644 --- a/packages/api-derive/src/democracy/dispatchQueue.ts +++ b/packages/api-derive/src/democracy/dispatchQueue.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber, Hash, ReferendumIndex, Scheduled } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveDispatch, DeriveProposalImage } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec, u64 } from '@polkadot/types'; +import type { BlockNumber, Hash, ReferendumIndex, Scheduled } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveDispatch, DeriveProposalImage } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Option, Vec, u64 } from '@polkadot/types'; import { isFunction, stringToHex } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/locks.ts b/packages/api-derive/src/democracy/locks.ts index 79dbcda7fa..0a780de4ce 100644 --- a/packages/api-derive/src/democracy/locks.ts +++ b/packages/api-derive/src/democracy/locks.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, Vote, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveDemocracyLock } from '../types'; +import type { Observable } from 'rxjs'; +import type { Option } from '@polkadot/types'; +import type { AccountId, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, Vote, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveDemocracyLock } from '../types'; import BN from 'bn.js'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { BN_ZERO, isUndefined } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/nextExternal.ts b/packages/api-derive/src/democracy/nextExternal.ts index 1d93ae51ca..39406f992d 100644 --- a/packages/api-derive/src/democracy/nextExternal.ts +++ b/packages/api-derive/src/democracy/nextExternal.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Hash, VoteThreshold } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveProposalExternal } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { Hash, VoteThreshold } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveProposalExternal } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Option } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/preimage.ts b/packages/api-derive/src/democracy/preimage.ts index 215c155648..347f7fd5cd 100644 --- a/packages/api-derive/src/democracy/preimage.ts +++ b/packages/api-derive/src/democracy/preimage.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveProposalImage } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Bytes, Option } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveProposalImage } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Bytes, Option } from '@polkadot/types'; import { memo } from '../util'; import { parseImage } from './util'; diff --git a/packages/api-derive/src/democracy/preimages.ts b/packages/api-derive/src/democracy/preimages.ts index dfe5e9336c..944d38aca3 100644 --- a/packages/api-derive/src/democracy/preimages.ts +++ b/packages/api-derive/src/democracy/preimages.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveProposalImage } from '../types'; +import type { Observable } from 'rxjs'; +import type { Bytes, Option } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveProposalImage } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Bytes, Option } from '@polkadot/types'; import { memo } from '../util'; import { parseImage } from './util'; diff --git a/packages/api-derive/src/democracy/proposals.ts b/packages/api-derive/src/democracy/proposals.ts index a1b391c0b3..ad717d09ae 100644 --- a/packages/api-derive/src/democracy/proposals.ts +++ b/packages/api-derive/src/democracy/proposals.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance, Hash, PropIndex } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveProposalImage, DeriveProposal } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, Balance, Hash, PropIndex } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveProposalImage, DeriveProposal } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Option, Vec } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendumIds.ts b/packages/api-derive/src/democracy/referendumIds.ts index b73890d338..e7f49ac727 100644 --- a/packages/api-derive/src/democracy/referendumIds.ts +++ b/packages/api-derive/src/democracy/referendumIds.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { ReferendumIndex } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { ReferendumIndex } from '@polkadot/types/interfaces'; import BN from 'bn.js'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendums.ts b/packages/api-derive/src/democracy/referendums.ts index a3da2b3c9c..e86da0b69b 100644 --- a/packages/api-derive/src/democracy/referendums.ts +++ b/packages/api-derive/src/democracy/referendums.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveReferendumExt } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveReferendumExt } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendumsActive.ts b/packages/api-derive/src/democracy/referendumsActive.ts index 307403b92c..f40ea8ac28 100644 --- a/packages/api-derive/src/democracy/referendumsActive.ts +++ b/packages/api-derive/src/democracy/referendumsActive.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveReferendum } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveReferendum } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendumsFinished.ts b/packages/api-derive/src/democracy/referendumsFinished.ts index 7f327ccf12..bb7289dfa7 100644 --- a/packages/api-derive/src/democracy/referendumsFinished.ts +++ b/packages/api-derive/src/democracy/referendumsFinished.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { ReferendumInfo, ReferendumInfoFinished } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { ReferendumInfo, ReferendumInfoFinished } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendumsInfo.ts b/packages/api-derive/src/democracy/referendumsInfo.ts index b1ab3a5e81..021e0d3421 100644 --- a/packages/api-derive/src/democracy/referendumsInfo.ts +++ b/packages/api-derive/src/democracy/referendumsInfo.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, ReferendumInfo, ReferendumInfoTo239, Vote, Voting, VotingDirectVote, VotingDelegating } from '@polkadot/types/interfaces'; -import { DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, ReferendumInfo, ReferendumInfoTo239, Vote, Voting, VotingDirectVote, VotingDelegating } from '@polkadot/types/interfaces'; +import type { DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types'; import BN from 'bn.js'; -import { Observable, of, combineLatest } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option, Vec } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/sqrtElectorate.ts b/packages/api-derive/src/democracy/sqrtElectorate.ts index a8e06fb97b..c4cd8e27e9 100644 --- a/packages/api-derive/src/democracy/sqrtElectorate.ts +++ b/packages/api-derive/src/democracy/sqrtElectorate.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Observable } from 'rxjs'; import { ApiInterfaceRx } from '@polkadot/api/types'; import BN from 'bn.js'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { bnSqrt } from '@polkadot/util'; diff --git a/packages/api-derive/src/democracy/types.ts b/packages/api-derive/src/democracy/types.ts index 278b8b43e2..3a1d07bd37 100644 --- a/packages/api-derive/src/democracy/types.ts +++ b/packages/api-derive/src/democracy/types.ts @@ -2,9 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import { AccountId, Balance, BlockNumber, Hash, Proposal, PropIndex, ReferendumInfoTo239, ReferendumStatus, Vote, ReferendumIndex, VoteThreshold } from '@polkadot/types/interfaces'; - -import { Vec } from '@polkadot/types'; +import type { Vec } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, Hash, Proposal, PropIndex, ReferendumInfoTo239, ReferendumStatus, Vote, ReferendumIndex, VoteThreshold } from '@polkadot/types/interfaces'; export interface DeriveDemocracyLock { balance: Balance; diff --git a/packages/api-derive/src/democracy/util.ts b/packages/api-derive/src/democracy/util.ts index b4922f0a14..fc5c80e7d1 100644 --- a/packages/api-derive/src/democracy/util.ts +++ b/packages/api-derive/src/democracy/util.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, Balance, BlockNumber, PreimageStatus, Proposal, ReferendumInfo, ReferendumInfoTo239, ReferendumStatus, Tally, VoteThreshold } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveProposalImage, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Bytes, Option } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, PreimageStatus, Proposal, ReferendumInfo, ReferendumInfoTo239, ReferendumStatus, Tally, VoteThreshold } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveProposalImage, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types'; import BN from 'bn.js'; -import { Bytes, Option } from '@polkadot/types'; import { bnSqrt } from '@polkadot/util'; type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber]; diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 19e7c47c90..8695dedad2 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveElectionsInfo } from './types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Vec, u32 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveElectionsInfo } from './types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Vec, u32 } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/elections/types.ts b/packages/api-derive/src/elections/types.ts index 49b316ff05..68fc05bf44 100644 --- a/packages/api-derive/src/elections/types.ts +++ b/packages/api-derive/src/elections/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Balance, BlockNumber, SetIndex, VoteIndex } from '@polkadot/types/interfaces'; - -import { u32 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, SetIndex, VoteIndex } from '@polkadot/types/interfaces'; +import type { u32 } from '@polkadot/types'; export interface DeriveElectionsInfo { candidates: AccountId[]; diff --git a/packages/api-derive/src/imOnline/receivedHeartbeats.ts b/packages/api-derive/src/imOnline/receivedHeartbeats.ts index 85f00fbb54..ad29e6f084 100644 --- a/packages/api-derive/src/imOnline/receivedHeartbeats.ts +++ b/packages/api-derive/src/imOnline/receivedHeartbeats.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId } from '@polkadot/types/interfaces'; -import { DeriveHeartbeats } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Bytes, Option, u32 } from '@polkadot/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { DeriveHeartbeats } from '../types'; -import { Observable, of, combineLatest } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Bytes, Option, u32 } from '@polkadot/types'; import { BN_ZERO } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/index.ts b/packages/api-derive/src/index.ts index 52c8abc67a..f8c2c33ff1 100644 --- a/packages/api-derive/src/index.ts +++ b/packages/api-derive/src/index.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AnyFunction } from '@polkadot/types/types'; - -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AnyFunction } from '@polkadot/types/types'; import * as accounts from './accounts'; import * as balances from './balances'; diff --git a/packages/api-derive/src/parachains/info.ts b/packages/api-derive/src/parachains/info.ts index 2c19c40ffc..aff05f18bc 100644 --- a/packages/api-derive/src/parachains/info.ts +++ b/packages/api-derive/src/parachains/info.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CollatorId, ParaId } from '@polkadot/types/interfaces'; -import { DeriveParachainInfo, DeriveParachainFull, DeriveParachainActive } from '../types'; -import { Active, DidUpdate, Heads, ParaInfoResult, PendingSwap, RelayDispatchQueue, RetryQueue, SelectedThreads } from './types'; +import type { Observable } from 'rxjs'; +import type { CollatorId, ParaId } from '@polkadot/types/interfaces'; +import type { DeriveParachainInfo, DeriveParachainFull, DeriveParachainActive } from '../types'; +import type { Active, DidUpdate, Heads, ParaInfoResult, PendingSwap, RelayDispatchQueue, RetryQueue, SelectedThreads } from './types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/parachains/overview.ts b/packages/api-derive/src/parachains/overview.ts index 5c7adbb015..9fc5920102 100644 --- a/packages/api-derive/src/parachains/overview.ts +++ b/packages/api-derive/src/parachains/overview.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ParaId } from '@polkadot/types/interfaces'; -import { DeriveParachain, DeriveParachainInfo } from '../types'; -import { DidUpdate, ParaInfoResult, PendingSwap, RelayDispatchQueueSize } from './types'; +import type { Observable } from 'rxjs'; +import type { ParaId } from '@polkadot/types/interfaces'; +import type { DeriveParachain, DeriveParachainInfo } from '../types'; +import type { DidUpdate, ParaInfoResult, PendingSwap, RelayDispatchQueueSize } from './types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/parachains/types.ts b/packages/api-derive/src/parachains/types.ts index 0d2150b7d9..8bbdf1585b 100644 --- a/packages/api-derive/src/parachains/types.ts +++ b/packages/api-derive/src/parachains/types.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CollatorId, ParaId, ParaInfo, Retriable, UpwardMessage } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; - -import { Bytes, Option, u32, Vec } from '@polkadot/types'; +import type { CollatorId, ParaId, ParaInfo, Retriable, UpwardMessage } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { Bytes, Option, u32, Vec } from '@polkadot/types'; export type ParaInfoResult = Option; export type PendingSwap = Option; diff --git a/packages/api-derive/src/parachains/util.ts b/packages/api-derive/src/parachains/util.ts index 107fe6041b..1ec17fbb9d 100644 --- a/packages/api-derive/src/parachains/util.ts +++ b/packages/api-derive/src/parachains/util.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ParaId } from '@polkadot/types/interfaces'; -import { DidUpdate } from './types'; +import type { ParaId } from '@polkadot/types/interfaces'; +import type { DidUpdate } from './types'; export function didUpdateToBool (didUpdate: DidUpdate, id: ParaId): boolean { return didUpdate.isSome diff --git a/packages/api-derive/src/session/eraLength.ts b/packages/api-derive/src/session/eraLength.ts index 29596d5ab2..27cc04a407 100644 --- a/packages/api-derive/src/session/eraLength.ts +++ b/packages/api-derive/src/session/eraLength.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/session/eraProgress.ts b/packages/api-derive/src/session/eraProgress.ts index 0faee140da..eb02939a87 100644 --- a/packages/api-derive/src/session/eraProgress.ts +++ b/packages/api-derive/src/session/eraProgress.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/session/indexes.ts b/packages/api-derive/src/session/indexes.ts index 09a00ff521..e445b24d0d 100644 --- a/packages/api-derive/src/session/indexes.ts +++ b/packages/api-derive/src/session/indexes.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { ActiveEraInfo, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; -import { DeriveSessionIndexes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, u32 } from '@polkadot/types'; +import type { ActiveEraInfo, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; +import type { DeriveSessionIndexes } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Option, u32 } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/info.ts b/packages/api-derive/src/session/info.ts index 2830dc993c..5c170b1d85 100644 --- a/packages/api-derive/src/session/info.ts +++ b/packages/api-derive/src/session/info.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SessionIndex } from '@polkadot/types/interfaces'; -import { DeriveSessionInfo, DeriveSessionIndexes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { u64 } from '@polkadot/types'; +import type { SessionIndex } from '@polkadot/types/interfaces'; +import type { DeriveSessionInfo, DeriveSessionIndexes } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { u64 } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/progress.ts b/packages/api-derive/src/session/progress.ts index 73ea7bdf1e..07f0aae31c 100644 --- a/packages/api-derive/src/session/progress.ts +++ b/packages/api-derive/src/session/progress.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SessionIndex } from '@polkadot/types/interfaces'; -import { DeriveSessionInfo, DeriveSessionProgress } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, u64 } from '@polkadot/types'; +import type { SessionIndex } from '@polkadot/types/interfaces'; +import type { DeriveSessionInfo, DeriveSessionProgress } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Option, u64 } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/sessionProgress.ts b/packages/api-derive/src/session/sessionProgress.ts index 7d21becc26..9f05dd62a5 100644 --- a/packages/api-derive/src/session/sessionProgress.ts +++ b/packages/api-derive/src/session/sessionProgress.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { BlockNumber } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/session/types.ts b/packages/api-derive/src/session/types.ts index 624991c15a..bde4fdd328 100644 --- a/packages/api-derive/src/session/types.ts +++ b/packages/api-derive/src/session/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BlockNumber, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; - -import { Option, u32 } from '@polkadot/types'; +import type { BlockNumber, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; +import type { Option, u32 } from '@polkadot/types'; export interface DeriveSessionIndexes { activeEra: EraIndex; diff --git a/packages/api-derive/src/society/candidates.ts b/packages/api-derive/src/society/candidates.ts index fa25edb64f..692227368c 100644 --- a/packages/api-derive/src/society/candidates.ts +++ b/packages/api-derive/src/society/candidates.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, BalanceOf, Bid, BidKind } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveSocietyCandidate } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, BalanceOf, Bid, BidKind } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveSocietyCandidate } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option, Vec } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/society/info.ts b/packages/api-derive/src/society/info.ts index ca46719687..3408bf75f6 100644 --- a/packages/api-derive/src/society/info.ts +++ b/packages/api-derive/src/society/info.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, BalanceOf, Bid } from '@polkadot/types/interfaces'; -import { DeriveSociety } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec, u32 } from '@polkadot/types'; +import type { AccountId, BalanceOf, Bid } from '@polkadot/types/interfaces'; +import type { DeriveSociety } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Option, Vec, u32 } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/society/member.ts b/packages/api-derive/src/society/member.ts index 8534356fe6..0d73125a95 100644 --- a/packages/api-derive/src/society/member.ts +++ b/packages/api-derive/src/society/member.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveSocietyMember } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { bool, Option, Vec } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveSocietyMember } from '../types'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { bool, Option, Vec } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/society/members.ts b/packages/api-derive/src/society/members.ts index 46a7d5405a..96a83337a5 100644 --- a/packages/api-derive/src/society/members.ts +++ b/packages/api-derive/src/society/members.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId } from '@polkadot/types/interfaces'; -import { DeriveSocietyMember } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { DeriveSocietyMember } from '../types'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/account.ts b/packages/api-derive/src/staking/account.ts index 2baf8f8cae..cc535f6e3a 100644 --- a/packages/api-derive/src/staking/account.ts +++ b/packages/api-derive/src/staking/account.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Balance, StakingLedger, UnlockChunk } from '@polkadot/types/interfaces'; -import { DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, DeriveStakingQuery, DeriveUnlocking } from '../types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Balance, StakingLedger, UnlockChunk } from '@polkadot/types/interfaces'; +import type { DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, DeriveStakingQuery, DeriveUnlocking } from '../types'; import BN from 'bn.js'; import { combineLatest, Observable } from 'rxjs'; diff --git a/packages/api-derive/src/staking/currentPoints.ts b/packages/api-derive/src/staking/currentPoints.ts index b9d869b2ad..ec49ec887f 100644 --- a/packages/api-derive/src/staking/currentPoints.ts +++ b/packages/api-derive/src/staking/currentPoints.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, EraPoints, EraRewardPoints, RewardPoint } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Observable } from 'rxjs'; +import type { AccountId, EraPoints, EraRewardPoints, RewardPoint } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/electedInfo.ts b/packages/api-derive/src/staking/electedInfo.ts index 3d225ba369..81ec805b15 100644 --- a/packages/api-derive/src/staking/electedInfo.ts +++ b/packages/api-derive/src/staking/electedInfo.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId } from '@polkadot/types/interfaces'; -import { DeriveStakingElected } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { DeriveStakingElected } from '../types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/erasExposure.ts b/packages/api-derive/src/staking/erasExposure.ts index 6468b2c7bb..5186273b73 100644 --- a/packages/api-derive/src/staking/erasExposure.ts +++ b/packages/api-derive/src/staking/erasExposure.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex, Exposure } from '@polkadot/types/interfaces'; -import { DeriveEraExposure, DeriveEraNominatorExposure, DeriveEraValidatorExposure } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { StorageKey } from '@polkadot/types'; +import type { EraIndex, Exposure } from '@polkadot/types/interfaces'; +import type { DeriveEraExposure, DeriveEraNominatorExposure, DeriveEraValidatorExposure } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { StorageKey } from '@polkadot/types'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/erasHistoric.ts b/packages/api-derive/src/staking/erasHistoric.ts index c114142ae3..1abe3c1323 100644 --- a/packages/api-derive/src/staking/erasHistoric.ts +++ b/packages/api-derive/src/staking/erasHistoric.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { ActiveEraInfo, EraIndex } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, u32 } from '@polkadot/types'; +import type { ActiveEraInfo, EraIndex } from '@polkadot/types/interfaces'; import BN from 'bn.js'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Option, u32 } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/erasPoints.ts b/packages/api-derive/src/staking/erasPoints.ts index 702e7639de..29c5e88797 100644 --- a/packages/api-derive/src/staking/erasPoints.ts +++ b/packages/api-derive/src/staking/erasPoints.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex, EraRewardPoints } from '@polkadot/types/interfaces'; -import { DeriveEraPoints, DeriveEraValPoints } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex, EraRewardPoints } from '@polkadot/types/interfaces'; +import type { DeriveEraPoints, DeriveEraValPoints } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/api-derive/src/staking/erasPrefs.ts b/packages/api-derive/src/staking/erasPrefs.ts index 1b0c15f629..3e8f3936d2 100644 --- a/packages/api-derive/src/staking/erasPrefs.ts +++ b/packages/api-derive/src/staking/erasPrefs.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex, ValidatorPrefs } from '@polkadot/types/interfaces'; -import { DeriveEraPrefs, DeriveEraValPrefs } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { StorageKey } from '@polkadot/types'; +import type { EraIndex, ValidatorPrefs } from '@polkadot/types/interfaces'; +import type { DeriveEraPrefs, DeriveEraValPrefs } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { StorageKey } from '@polkadot/types'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/erasRewards.ts b/packages/api-derive/src/staking/erasRewards.ts index e8fd783963..4fbcdbb49d 100644 --- a/packages/api-derive/src/staking/erasRewards.ts +++ b/packages/api-derive/src/staking/erasRewards.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { Balance, EraIndex } from '@polkadot/types/interfaces'; -import { DeriveEraRewards } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { Balance, EraIndex } from '@polkadot/types/interfaces'; +import type { DeriveEraRewards } from '../types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { deriveCache, memo } from '../util'; import { filterEras } from './util'; diff --git a/packages/api-derive/src/staking/erasSlashes.ts b/packages/api-derive/src/staking/erasSlashes.ts index 6e293c628a..0b8c3f63b3 100644 --- a/packages/api-derive/src/staking/erasSlashes.ts +++ b/packages/api-derive/src/staking/erasSlashes.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveEraSlashes, DeriveEraValSlash } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, StorageKey } from '@polkadot/types'; +import type { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveEraSlashes, DeriveEraValSlash } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option, StorageKey } from '@polkadot/types'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/keys.ts b/packages/api-derive/src/staking/keys.ts index 305ee46d13..fac91acf5c 100644 --- a/packages/api-derive/src/staking/keys.ts +++ b/packages/api-derive/src/staking/keys.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, Keys } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveStakingKeys } from './types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, Keys } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveStakingKeys } from './types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option, Vec } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/overview.ts b/packages/api-derive/src/staking/overview.ts index eeb54d710f..8df9114253 100644 --- a/packages/api-derive/src/staking/overview.ts +++ b/packages/api-derive/src/staking/overview.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveStakingOverview } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveStakingOverview } from '../types'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/ownExposure.ts b/packages/api-derive/src/staking/ownExposure.ts index 6b49457066..9ce332e5c4 100644 --- a/packages/api-derive/src/staking/ownExposure.ts +++ b/packages/api-derive/src/staking/ownExposure.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EraIndex, Exposure } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveOwnExposure } from '../types'; +import type { Observable } from 'rxjs'; +import type { EraIndex, Exposure } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveOwnExposure } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/ownSlashes.ts b/packages/api-derive/src/staking/ownSlashes.ts index e07ed2c4bc..7d9e59312f 100644 --- a/packages/api-derive/src/staking/ownSlashes.ts +++ b/packages/api-derive/src/staking/ownSlashes.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveStakerSlashes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveStakerSlashes } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/query.ts b/packages/api-derive/src/staking/query.ts index fccce44cc7..be49ca2925 100644 --- a/packages/api-derive/src/staking/query.ts +++ b/packages/api-derive/src/staking/query.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, EraIndex, Exposure, Nominations, RewardDestination, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; -import { ITuple } from '@polkadot/types/types'; -import { DeriveStakingQuery } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { AccountId, EraIndex, Exposure, Nominations, RewardDestination, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { DeriveStakingQuery } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/stakerExposure.ts b/packages/api-derive/src/staking/stakerExposure.ts index 50dae7d6ff..fad3291fe4 100644 --- a/packages/api-derive/src/staking/stakerExposure.ts +++ b/packages/api-derive/src/staking/stakerExposure.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex } from '@polkadot/types/interfaces'; -import { DeriveStakerExposure, DeriveEraValidatorExposure } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; +import type { DeriveStakerExposure, DeriveEraValidatorExposure } from '../types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/stakerPoints.ts b/packages/api-derive/src/staking/stakerPoints.ts index b85046a332..904341e53e 100644 --- a/packages/api-derive/src/staking/stakerPoints.ts +++ b/packages/api-derive/src/staking/stakerPoints.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex } from '@polkadot/types/interfaces'; -import { DeriveStakerPoints } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; +import type { DeriveStakerPoints } from '../types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/stakerPrefs.ts b/packages/api-derive/src/staking/stakerPrefs.ts index eb13bae878..a0fdc0b0e7 100644 --- a/packages/api-derive/src/staking/stakerPrefs.ts +++ b/packages/api-derive/src/staking/stakerPrefs.ts @@ -1,27 +1,27 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex, ValidatorPrefs } from '@polkadot/types/interfaces'; -import { DeriveStakerPrefs } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex, ValidatorPrefs } from '@polkadot/types/interfaces'; +import type { DeriveStakerPrefs } from '../types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; export function _stakerPrefs (instanceId: string, api: ApiInterfaceRx): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { // eslint-disable-next-line @typescript-eslint/no-unused-vars - return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable => { - return api.query.staking.erasValidatorPrefs.multi(eras.map((era) => [era, accountId])).pipe( + return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable => + api.query.staking.erasValidatorPrefs.multi(eras.map((era) => [era, accountId])).pipe( map((all): DeriveStakerPrefs[] => all.map((validatorPrefs, index): DeriveStakerPrefs => ({ era: eras[index], validatorPrefs })) ) - ); - }); + ) + ); } export function stakerPrefs (instanceId: string, api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable { diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index f02f853c99..bf90ca7537 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -1,18 +1,19 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, EraIndex, StakingLedger, StakingLedgerTo240 } from '@polkadot/types/interfaces'; -import { DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { AccountId, EraIndex, StakingLedger, StakingLedgerTo240 } from '@polkadot/types/interfaces'; +import type { DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types'; +import type { DeriveStakingQuery } from './types'; import BN from 'bn.js'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { isFunction } from '@polkadot/util'; import { memo } from '../util'; -import { DeriveStakingQuery } from './types'; type ErasResult = [{ unwrapOr: (value: BN) => BN }, DeriveEraPoints[], DeriveEraPrefs[], DeriveEraRewards[]]; diff --git a/packages/api-derive/src/staking/stakerSlashes.ts b/packages/api-derive/src/staking/stakerSlashes.ts index 30f6256b3f..d33dab9b9d 100644 --- a/packages/api-derive/src/staking/stakerSlashes.ts +++ b/packages/api-derive/src/staking/stakerSlashes.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { EraIndex } from '@polkadot/types/interfaces'; -import { DeriveStakerSlashes } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; +import type { DeriveStakerSlashes } from '../types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/stashes.ts b/packages/api-derive/src/staking/stashes.ts index a6c61d9be6..baed329c85 100644 --- a/packages/api-derive/src/staking/stashes.ts +++ b/packages/api-derive/src/staking/stashes.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId } from '@polkadot/types/interfaces'; -import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/types.ts b/packages/api-derive/src/staking/types.ts index 13274c8965..b8483e11fe 100644 --- a/packages/api-derive/src/staking/types.ts +++ b/packages/api-derive/src/staking/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import { AccountId, Balance, EraIndex, Exposure, RewardDestination, RewardPoint, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; -import { DeriveSessionIndexes } from '../session/types'; +import type { AccountId, Balance, EraIndex, Exposure, RewardDestination, RewardPoint, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; +import type { DeriveSessionIndexes } from '../session/types'; export type DeriveEraValPoints = Record; diff --git a/packages/api-derive/src/staking/util.ts b/packages/api-derive/src/staking/util.ts index 69c38128df..5241627485 100644 --- a/packages/api-derive/src/staking/util.ts +++ b/packages/api-derive/src/staking/util.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EraIndex } from '@polkadot/types/interfaces'; +import type { EraIndex } from '@polkadot/types/interfaces'; export function filterEras (eras: EraIndex[], list: T[]): EraIndex[] { return eras.filter((era) => !list.some((entry) => era.eq(entry.era))); diff --git a/packages/api-derive/src/staking/validators.ts b/packages/api-derive/src/staking/validators.ts index 70298075bd..13a1deb4c2 100644 --- a/packages/api-derive/src/staking/validators.ts +++ b/packages/api-derive/src/staking/validators.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId } from '@polkadot/types/interfaces'; -import { DeriveStakingValidators } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId } from '@polkadot/types/interfaces'; +import type { DeriveStakingValidators } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/validatorsFrom.ts b/packages/api-derive/src/staking/validatorsFrom.ts index b7bbbd6f98..51f21cb752 100644 --- a/packages/api-derive/src/staking/validatorsFrom.ts +++ b/packages/api-derive/src/staking/validatorsFrom.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { AccountId, Nominations } from '@polkadot/types/interfaces'; -import { DeriveStakingQuery } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { AccountId, Nominations } from '@polkadot/types/interfaces'; +import type { DeriveStakingQuery } from '../types'; -import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/waitingInfo.ts b/packages/api-derive/src/staking/waitingInfo.ts index 4716d47500..4a3b853d46 100644 --- a/packages/api-derive/src/staking/waitingInfo.ts +++ b/packages/api-derive/src/staking/waitingInfo.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveStakingWaiting } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveStakingWaiting } from '../types'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { memo } from '../util'; diff --git a/packages/api-derive/src/technicalCommittee/proposals.ts b/packages/api-derive/src/technicalCommittee/proposals.ts index 490a0f3160..5ab9cf16ad 100644 --- a/packages/api-derive/src/technicalCommittee/proposals.ts +++ b/packages/api-derive/src/technicalCommittee/proposals.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { DeriveCollectiveProposal } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { DeriveCollectiveProposal } from '../types'; -import { Observable } from 'rxjs'; import { proposals as collectiveProposals } from '../collective'; import { memo } from '../util'; diff --git a/packages/api-derive/src/treasury/proposals.ts b/packages/api-derive/src/treasury/proposals.ts index 0df38133fd..6eb0f16210 100644 --- a/packages/api-derive/src/treasury/proposals.ts +++ b/packages/api-derive/src/treasury/proposals.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces'; -import { DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types'; +import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { Option } from '@polkadot/types'; +import type { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces'; +import type { DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Option } from '@polkadot/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/tx/events.ts b/packages/api-derive/src/tx/events.ts index 070e816401..f49e872a0d 100644 --- a/packages/api-derive/src/tx/events.ts +++ b/packages/api-derive/src/tx/events.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; +import type { Observable } from 'rxjs'; +import type { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; -import { Observable, combineLatest } from 'rxjs'; +import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index a77dcf478b..08cfd2222b 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Header, Index } from '@polkadot/types/interfaces'; -import { AnyNumber, Codec, IExtrinsicEra } from '@polkadot/types/types'; +import type { Observable } from 'rxjs'; +import type { Header, Index } from '@polkadot/types/interfaces'; +import type { AnyNumber, Codec, IExtrinsicEra } from '@polkadot/types/types'; -import { Observable, combineLatest, of } from 'rxjs'; +import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { ApiInterfaceRx } from '@polkadot/api/types'; import { isNumber, isUndefined } from '@polkadot/util'; diff --git a/packages/api-derive/src/type/HeaderExtended.ts b/packages/api-derive/src/type/HeaderExtended.ts index 326fb88eaa..1c5887516b 100644 --- a/packages/api-derive/src/type/HeaderExtended.ts +++ b/packages/api-derive/src/type/HeaderExtended.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Header } from '@polkadot/types/interfaces'; -import { AnyJson, Constructor, Registry } from '@polkadot/types/types'; +import type { AccountId, Header } from '@polkadot/types/interfaces'; +import type { AnyJson, Constructor, Registry } from '@polkadot/types/types'; import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { Struct } from '@polkadot/types'; diff --git a/packages/api-derive/src/type/SignedBlockExtended.ts b/packages/api-derive/src/type/SignedBlockExtended.ts index 43d3f341f8..d1bd0be0f3 100644 --- a/packages/api-derive/src/type/SignedBlockExtended.ts +++ b/packages/api-derive/src/type/SignedBlockExtended.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, SignedBlock } from '@polkadot/types/interfaces'; -import { AnyJson, Constructor, Registry } from '@polkadot/types/types'; +import type { AccountId, SignedBlock } from '@polkadot/types/interfaces'; +import type { AnyJson, Constructor, Registry } from '@polkadot/types/types'; import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { Struct } from '@polkadot/types'; diff --git a/packages/api-derive/src/type/util.ts b/packages/api-derive/src/type/util.ts index ad4861de5b..81ef7d1613 100644 --- a/packages/api-derive/src/type/util.ts +++ b/packages/api-derive/src/type/util.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Digest } from '@polkadot/types/interfaces'; +import type { AccountId, Digest } from '@polkadot/types/interfaces'; export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined { const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime'); diff --git a/packages/api-derive/src/types.ts b/packages/api-derive/src/types.ts index 2519f5b9e8..a6459f1d71 100644 --- a/packages/api-derive/src/types.ts +++ b/packages/api-derive/src/types.ts @@ -2,9 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import { AccountId, Balance, BalanceLock, BalanceLockTo212, BalanceOf, Bid, BidKind, BlockNumber, Hash, Index, Proposal, ProposalIndex, SetIndex, SocietyVote, StrikeCount, TreasuryProposal, Votes, VouchingStatus } from '@polkadot/types/interfaces'; - -import { u32 } from '@polkadot/types'; +import type { AccountId, Balance, BalanceLock, BalanceLockTo212, BalanceOf, Bid, BidKind, BlockNumber, Hash, Index, Proposal, ProposalIndex, SetIndex, SocietyVote, StrikeCount, TreasuryProposal, Votes, VouchingStatus } from '@polkadot/types/interfaces'; +import type { u32 } from '@polkadot/types'; export * from './accounts/types'; export * from './chain/types'; diff --git a/packages/api-derive/src/util/approvalFlagToBools.spec.ts b/packages/api-derive/src/util/approvalFlagToBools.spec.ts index 9b1db87823..5d0d882ffa 100644 --- a/packages/api-derive/src/util/approvalFlagToBools.spec.ts +++ b/packages/api-derive/src/util/approvalFlagToBools.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApprovalFlag } from '@polkadot/types/interfaces'; +import type { ApprovalFlag } from '@polkadot/types/interfaces'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/api-derive/src/util/approvalFlagsToBools.ts b/packages/api-derive/src/util/approvalFlagsToBools.ts index 6211817bad..bee881f16a 100644 --- a/packages/api-derive/src/util/approvalFlagsToBools.ts +++ b/packages/api-derive/src/util/approvalFlagsToBools.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApprovalFlag } from '@polkadot/types/interfaces/elections'; - -import { Vec } from '@polkadot/types'; +import type { ApprovalFlag } from '@polkadot/types/interfaces/elections'; +import type { Vec } from '@polkadot/types'; /** @internal */ export function approvalFlagsToBools (flags: Vec | ApprovalFlag[]): boolean[] { @@ -19,7 +18,9 @@ export function approvalFlagsToBools (flags: Vec | ApprovalFlag[]) }); // slice off trailing "false" values, as in substrate - const lastApproval: number = bools.lastIndexOf(true); + const lastApproval = bools.lastIndexOf(true); - return lastApproval >= 0 ? bools.slice(0, lastApproval + 1) : []; + return lastApproval >= 0 + ? bools.slice(0, lastApproval + 1) + : []; } diff --git a/packages/api-derive/src/util/cache.ts b/packages/api-derive/src/util/cache.ts index 43c325374c..093d31e16d 100644 --- a/packages/api-derive/src/util/cache.ts +++ b/packages/api-derive/src/util/cache.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DeriveCache } from './types'; +import type { DeriveCache } from './types'; import { deriveNoopCache } from './cacheImpl'; diff --git a/packages/api-derive/src/util/cacheImpl.ts b/packages/api-derive/src/util/cacheImpl.ts index 02fc7bbfc8..2c763b0360 100644 --- a/packages/api-derive/src/util/cacheImpl.ts +++ b/packages/api-derive/src/util/cacheImpl.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DeriveCache } from './types'; +import type { DeriveCache } from './types'; const mapCache = new Map(); diff --git a/packages/api-derive/src/util/memo.ts b/packages/api-derive/src/util/memo.ts index b2fe57c83e..daaf5743fb 100644 --- a/packages/api-derive/src/util/memo.ts +++ b/packages/api-derive/src/util/memo.ts @@ -1,8 +1,10 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Observer, TeardownLogic } from 'rxjs'; + import createMemo from 'memoizee'; -import { Observable, Observer, TeardownLogic } from 'rxjs'; +import { Observable } from 'rxjs'; import { drr, normalizer } from '@polkadot/rpc-core/util'; type ObsFn = (...params: any[]) => Observable; diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 5bebb55241..90ad046320 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constants, DecoratedMeta } from '@polkadot/metadata/decorate/types'; -import { RpcInterface } from '@polkadot/rpc-core/types'; -import { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces'; -import { StorageEntry } from '@polkadot/types/primitive/types'; -import { AnyFunction, CallFunction, Codec, CodecArg as Arg, InterfaceTypes, Registry, RegistryTypes } from '@polkadot/types/types'; -import { SubmittableExtrinsic } from '../submittable/types'; -import { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; +import type { Constants, DecoratedMeta } from '@polkadot/metadata/decorate/types'; +import type { RpcInterface } from '@polkadot/rpc-core/types'; +import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types'; +import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { AnyFunction, CallFunction, Codec, CodecArg as Arg, InterfaceTypes, Registry, RegistryTypes } from '@polkadot/types/types'; +import type { SubmittableExtrinsic } from '../submittable/types'; +import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; import BN from 'bn.js'; import { BehaviorSubject, Observable, combineLatest, of } from 'rxjs'; @@ -17,7 +18,6 @@ import { memo } from '@polkadot/api-derive/util'; import { Metadata, expandMetadata } from '@polkadot/metadata'; import { RpcCore } from '@polkadot/rpc-core'; import { WsProvider } from '@polkadot/rpc-provider'; -import { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types'; import { DEFAULT_VERSION as EXTRINSIC_DEFAULT_VERSION } from '@polkadot/types/extrinsic/constants'; import { TypeRegistry } from '@polkadot/types/create'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; diff --git a/packages/api/src/base/Events.ts b/packages/api/src/base/Events.ts index 9cefd63dc2..f117995d51 100644 --- a/packages/api/src/base/Events.ts +++ b/packages/api/src/base/Events.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiInterfaceEvents } from '../types'; +import type { ApiInterfaceEvents } from '../types'; import EventEmitter from 'eventemitter3'; diff --git a/packages/api/src/base/Getters.ts b/packages/api/src/base/Getters.ts index 120dc47701..9168520959 100644 --- a/packages/api/src/base/Getters.ts +++ b/packages/api/src/base/Getters.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { RpcInterface } from '@polkadot/rpc-core/types'; -import { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx, ApiTypes, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; +import type { Metadata } from '@polkadot/metadata'; +import type { RpcInterface } from '@polkadot/rpc-core/types'; +import type { Text } from '@polkadot/types'; +import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx, ApiTypes, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; -import { Metadata } from '@polkadot/metadata'; -import { Text } from '@polkadot/types'; import { assertReturn } from '@polkadot/util'; import { Init } from './Init'; diff --git a/packages/api/src/base/Init.ts b/packages/api/src/base/Init.ts index f134272777..3a0dda5cab 100644 --- a/packages/api/src/base/Init.ts +++ b/packages/api/src/base/Init.ts @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ChainProperties, SignedBlock, RuntimeVersion } from '@polkadot/types/interfaces'; -import { Registry } from '@polkadot/types/types'; -import { ApiBase, ApiOptions, ApiTypes, DecorateMethod } from '../types'; -import { VersionedRegistry } from './types'; +import type { Observable, Subscription } from 'rxjs'; +import type { Text } from '@polkadot/types'; +import type { ChainProperties, SignedBlock, RuntimeVersion } from '@polkadot/types/interfaces'; +import type { Registry } from '@polkadot/types/types'; +import type { ApiBase, ApiOptions, ApiTypes, DecorateMethod } from '../types'; +import type { VersionedRegistry } from './types'; import BN from 'bn.js'; -import { Observable, Subscription, of } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { Metadata } from '@polkadot/metadata'; -import { Text } from '@polkadot/types'; import { TypeRegistry } from '@polkadot/types/create'; import { LATEST_EXTRINSIC_VERSION } from '@polkadot/types/extrinsic/Extrinsic'; import { getSpecAlias, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known'; diff --git a/packages/api/src/base/index.ts b/packages/api/src/base/index.ts index 73db884472..e5ee762150 100644 --- a/packages/api/src/base/index.ts +++ b/packages/api/src/base/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CallFunction, RegistryError, SignerPayloadRawBase } from '@polkadot/types/types'; -import { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types'; +import type { CallFunction, RegistryError, SignerPayloadRawBase } from '@polkadot/types/types'; +import type { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types'; import { assert, isString, u8aToHex, u8aToU8a } from '@polkadot/util'; diff --git a/packages/api/src/base/types.ts b/packages/api/src/base/types.ts index 227edda5a7..7f765db345 100644 --- a/packages/api/src/base/types.ts +++ b/packages/api/src/base/types.ts @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constants } from '@polkadot/metadata/decorate/types'; -import { Metadata } from '@polkadot/metadata'; -import { Registry } from '@polkadot/types/types'; - -import BN from 'bn.js'; +import type BN from 'bn.js'; +import type { Constants } from '@polkadot/metadata/decorate/types'; +import type { Metadata } from '@polkadot/metadata'; +import type { Registry } from '@polkadot/types/types'; export interface VersionedRegistry { isDefault: boolean; diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index fcc804055a..768c773b7a 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -3,8 +3,8 @@ // Simple non-runnable checks to test type definitions in the editor itself -import { AccountId, Balance, Header, Index } from '@polkadot/types/interfaces'; -import { IExtrinsic, IMethod } from '@polkadot/types/types'; +import type { AccountId, Balance, Header, Index } from '@polkadot/types/interfaces'; +import type { IExtrinsic, IMethod } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; import { HeaderExtended } from '@polkadot/api-derive'; diff --git a/packages/api/src/promise/Combinator.ts b/packages/api/src/promise/Combinator.ts index a22b6a0845..e5e62dd030 100644 --- a/packages/api/src/promise/Combinator.ts +++ b/packages/api/src/promise/Combinator.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Callback } from '@polkadot/types/types'; -import { UnsubscribePromise } from '../types'; +import type { Callback } from '@polkadot/types/types'; +import type { UnsubscribePromise } from '../types'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api/src/promise/Combinators.spec.ts b/packages/api/src/promise/Combinators.spec.ts index 2d35593b91..71d5aa9aa3 100644 --- a/packages/api/src/promise/Combinators.spec.ts +++ b/packages/api/src/promise/Combinators.spec.ts @@ -1,7 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UnsubscribePromise } from '../types'; +import type { UnsubscribePromise } from '../types'; + import { Combinator } from './Combinator'; describe('Combinator', (): void => { diff --git a/packages/api/src/promise/index.spec.ts b/packages/api/src/promise/index.spec.ts index bc58417b48..266dc20db0 100644 --- a/packages/api/src/promise/index.spec.ts +++ b/packages/api/src/promise/index.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiOptions, SubmittableExtrinsic } from '../types'; +import type { ApiOptions, SubmittableExtrinsic } from '../types'; import { createPair } from '@polkadot/keyring/pair'; import { createTestKeyring } from '@polkadot/keyring/testing'; diff --git a/packages/api/src/promise/index.ts b/packages/api/src/promise/index.ts index d602af4444..c03c5de882 100644 --- a/packages/api/src/promise/index.ts +++ b/packages/api/src/promise/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Callback, Codec } from '@polkadot/types/types'; -import { ApiOptions, DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types'; +import type { Callback, Codec } from '@polkadot/types/types'; +import type { ApiOptions, DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types'; import { EMPTY, Observable, Subscription } from 'rxjs'; import { catchError, tap } from 'rxjs/operators'; diff --git a/packages/api/src/promise/types.ts b/packages/api/src/promise/types.ts index 9bc1574fe6..2105a6d1bf 100644 --- a/packages/api/src/promise/types.ts +++ b/packages/api/src/promise/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { QueryableStorageEntry as QueryableStorageEntryBase, SubmittableExtrinsicFunction as SubmittableExtrinsicFunctionBase } from '../types'; - -import { SubmittableExtrinsic as SubmittableExtrinsicBase } from '../submittable/types'; +import type { SubmittableExtrinsic as SubmittableExtrinsicBase } from '../submittable/types'; +import type { QueryableStorageEntry as QueryableStorageEntryBase, SubmittableExtrinsicFunction as SubmittableExtrinsicFunctionBase } from '../types'; export type QueryableStorageEntry = QueryableStorageEntryBase<'promise'>; export type SubmittableExtrinsic = SubmittableExtrinsicBase<'promise'>; diff --git a/packages/api/src/rx/index.spec.ts b/packages/api/src/rx/index.spec.ts index dd7d9214a3..7f25734fcd 100644 --- a/packages/api/src/rx/index.spec.ts +++ b/packages/api/src/rx/index.spec.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SubmittableExtrinsic } from '../submittable/types'; +import type { Observable } from 'rxjs'; +import type { SubmittableExtrinsic } from '../submittable/types'; -import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { MockProvider } from '@polkadot/rpc-provider/mock'; diff --git a/packages/api/src/rx/index.ts b/packages/api/src/rx/index.ts index f5e4a48cc0..5b99f0b14c 100644 --- a/packages/api/src/rx/index.ts +++ b/packages/api/src/rx/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from '@polkadot/types/types'; -import { ApiOptions, DecorateFn } from '../types'; +import type { Codec } from '@polkadot/types/types'; +import type { ApiOptions, DecorateFn } from '../types'; import { from, Observable } from 'rxjs'; diff --git a/packages/api/src/submittable/Result.ts b/packages/api/src/submittable/Result.ts index 2e94e09cf9..76375539ec 100644 --- a/packages/api/src/submittable/Result.ts +++ b/packages/api/src/submittable/Result.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DispatchError, DispatchInfo, ExtrinsicStatus, EventRecord } from '@polkadot/types/interfaces'; -import { AnyJson, ISubmittableResult } from '@polkadot/types/types'; -import { SubmittableResultValue } from './types'; +import type { DispatchError, DispatchInfo, ExtrinsicStatus, EventRecord } from '@polkadot/types/interfaces'; +import type { AnyJson, ISubmittableResult } from '@polkadot/types/types'; +import type { SubmittableResultValue } from './types'; const recordIdentity = (record: EventRecord) => record; diff --git a/packages/api/src/submittable/createClass.ts b/packages/api/src/submittable/createClass.ts index 635cfd3676..357eca7db4 100644 --- a/packages/api/src/submittable/createClass.ts +++ b/packages/api/src/submittable/createClass.ts @@ -3,12 +3,13 @@ /* eslint-disable no-dupe-class-members */ -import { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; -import { Callback, Codec, Constructor, IKeyringPair, Registry, SignatureOptions, ISubmittableResult } from '@polkadot/types/types'; -import { ApiInterfaceRx, ApiTypes, SignerResult } from '../types'; -import { AddressOrPair, SignerOptions, SubmittableExtrinsic, SubmittableDryRunResult, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription, SubmittableThis } from './types'; +import type { Observable } from 'rxjs'; +import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; +import type { Callback, Codec, Constructor, IKeyringPair, Registry, SignatureOptions, ISubmittableResult } from '@polkadot/types/types'; +import type { ApiInterfaceRx, ApiTypes, SignerResult } from '../types'; +import type { AddressOrPair, SignerOptions, SubmittableExtrinsic, SubmittableDryRunResult, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription, SubmittableThis } from './types'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { first, map, mapTo, mergeMap, switchMap, tap } from 'rxjs/operators'; import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util'; diff --git a/packages/api/src/submittable/createSubmittable.ts b/packages/api/src/submittable/createSubmittable.ts index 5e80afb262..5c0b4acae1 100644 --- a/packages/api/src/submittable/createSubmittable.ts +++ b/packages/api/src/submittable/createSubmittable.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Call, Extrinsic } from '@polkadot/types/interfaces'; -import { ApiInterfaceRx, ApiTypes } from '../types'; -import { SubmittableExtrinsic } from './types'; +import type { Call, Extrinsic } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx, ApiTypes } from '../types'; +import type { SubmittableExtrinsic } from './types'; import { ApiBase } from '../base'; import { createClass } from './createClass'; diff --git a/packages/api/src/submittable/types.ts b/packages/api/src/submittable/types.ts index cd9f86c6ed..aa6ed33d84 100644 --- a/packages/api/src/submittable/types.ts +++ b/packages/api/src/submittable/types.ts @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Address, ApplyExtrinsicResult, DispatchError, DispatchInfo, Extrinsic, ExtrinsicStatus, EventRecord, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; -import { AnyNumber, Callback, Codec, IExtrinsicEra, IKeyringPair, Signer, ISubmittableResult } from '@polkadot/types/types'; -import { ApiTypes } from '../types'; - -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; +import type { AccountId, Address, ApplyExtrinsicResult, DispatchError, DispatchInfo, Extrinsic, ExtrinsicStatus, EventRecord, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; +import type { AnyNumber, Callback, Codec, IExtrinsicEra, IKeyringPair, Signer, ISubmittableResult } from '@polkadot/types/types'; +import type { ApiTypes } from '../types'; export interface SubmittableResultValue { dispatchError?: DispatchError; diff --git a/packages/api/src/types/base.ts b/packages/api/src/types/base.ts index 65a0e0268d..188a889156 100644 --- a/packages/api/src/types/base.ts +++ b/packages/api/src/types/base.ts @@ -3,7 +3,7 @@ import type { Observable } from 'rxjs'; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; +import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; // Prepend an element V onto the beginning of a tuple T. // Cons<1, [2,3,4]> is [1,2,3,4] diff --git a/packages/api/src/types/consts.ts b/packages/api/src/types/consts.ts index 6ee1cfe04c..b24df8050d 100644 --- a/packages/api/src/types/consts.ts +++ b/packages/api/src/types/consts.ts @@ -1,19 +1,15 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -// import { Hash } from '@polkadot/types/interfaces'; -import { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces'; -import { Codec } from '@polkadot/types/types'; - -import { ApiTypes } from './base'; -// import { ApiTypes, PromiseOrObs } from './base'; +import type { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces'; +import type { Codec } from '@polkadot/types/types'; +import type { ApiTypes } from './base'; // eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars export interface AugmentedConsts { } // eslint-disable-next-line @typescript-eslint/no-unused-vars export interface AugmentedConst { - // at: (hash: Hash | Uint8Array | string) => PromiseOrObs; meta: ModuleConstantMetadataLatest; } diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index 268bbe5dbf..e50fc716f7 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -5,19 +5,18 @@ import '@polkadot/api/augment'; import type BN from 'bn.js'; -import { DeriveCustom, ExactDerive } from '@polkadot/api-derive'; -import { RpcInterface } from '@polkadot/rpc-core/types'; -import { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types'; -import { Metadata } from '@polkadot/metadata'; -import { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; -import { DefinitionRpc, DefinitionRpcSub, Signer, SignatureOptions, Registry, RegisteredTypes } from '@polkadot/types/types'; - -import { DeriveAllSections } from '../util/decorate'; -import { ApiBase } from '../base'; -import { QueryableConsts } from './consts'; -import { DecoratedRpc } from './rpc'; -import { QueryableStorage, QueryableStorageMulti } from './storage'; -import { SubmittableExtrinsics } from './submittable'; +import type { DeriveCustom, ExactDerive } from '@polkadot/api-derive'; +import type { RpcInterface } from '@polkadot/rpc-core/types'; +import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types'; +import type { Metadata } from '@polkadot/metadata'; +import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; +import type { DefinitionRpc, DefinitionRpcSub, Signer, SignatureOptions, Registry, RegisteredTypes } from '@polkadot/types/types'; +import type { DeriveAllSections } from '../util/decorate'; +import type { ApiBase } from '../base'; +import type { QueryableConsts } from './consts'; +import type { DecoratedRpc } from './rpc'; +import type { QueryableStorage, QueryableStorageMulti } from './storage'; +import type { SubmittableExtrinsics } from './submittable'; export { Signer, SignerResult } from '@polkadot/types/types'; export { ApiBase } from '../base'; diff --git a/packages/api/src/types/rpc.ts b/packages/api/src/types/rpc.ts index 08044a56ff..4a989c8fe2 100644 --- a/packages/api/src/types/rpc.ts +++ b/packages/api/src/types/rpc.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyFunction, Callback } from '@polkadot/types/types'; - -import { Observable } from 'rxjs'; -import { Json, Raw } from '@polkadot/types/codec'; +import type { Observable } from 'rxjs'; +import type { Json, Raw } from '@polkadot/types/codec'; +import type { AnyFunction, Callback } from '@polkadot/types/types'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ApiTypes, Push, PromiseResult, RxResult, UnsubscribePromise } from './base'; diff --git a/packages/api/src/types/storage.ts b/packages/api/src/types/storage.ts index 2a85f30004..c876d6f087 100644 --- a/packages/api/src/types/storage.ts +++ b/packages/api/src/types/storage.ts @@ -1,14 +1,12 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Hash } from '@polkadot/types/interfaces'; -import { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; -import { StorageEntry } from '@polkadot/types/primitive/types'; - -import { Observable } from 'rxjs'; -import { StorageKey, u64 } from '@polkadot/types'; - -import { ApiTypes, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base'; +import type { Observable } from 'rxjs'; +import type { StorageKey, u64 } from '@polkadot/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { ApiTypes, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base'; interface StorageEntryObservableMulti { (args: (CodecArg[] | CodecArg)[]): Observable; diff --git a/packages/api/src/types/submittable.ts b/packages/api/src/types/submittable.ts index b4230dbcb9..9ff26b3d12 100644 --- a/packages/api/src/types/submittable.ts +++ b/packages/api/src/types/submittable.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyFunction, CallBase } from '@polkadot/types/types'; - -import { SubmittableExtrinsic } from '../submittable/types'; -import { ApiTypes } from './base'; +import type { AnyFunction, CallBase } from '@polkadot/types/types'; +import type { SubmittableExtrinsic } from '../submittable/types'; +import type { ApiTypes } from './base'; // eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars export interface AugmentedSubmittables { } diff --git a/packages/api/src/util/decorate.ts b/packages/api/src/util/decorate.ts index fd28e11c53..00cea2b4dc 100644 --- a/packages/api/src/util/decorate.ts +++ b/packages/api/src/util/decorate.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyFunction } from '@polkadot/types/types'; -import { ApiTypes, DecorateMethod, MethodResult } from '../types'; +import type { AnyFunction } from '@polkadot/types/types'; +import type { ApiTypes, DecorateMethod, MethodResult } from '../types'; // Most generic typings for `api.derive.*.*` type AnyDerive = Record>; diff --git a/packages/api/src/util/filterEvents.ts b/packages/api/src/util/filterEvents.ts index 980fccdeb3..35957a3072 100644 --- a/packages/api/src/util/filterEvents.ts +++ b/packages/api/src/util/filterEvents.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@polkadot/types/interfaces'; +import type { EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@polkadot/types/interfaces'; import { l } from './logging'; diff --git a/packages/api/src/util/isKeyringPair.ts b/packages/api/src/util/isKeyringPair.ts index d0dfa89260..0f05db31cd 100644 --- a/packages/api/src/util/isKeyringPair.ts +++ b/packages/api/src/util/isKeyringPair.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId, Address } from '@polkadot/types/interfaces'; -import { IKeyringPair } from '@polkadot/types/types'; +import type { AccountId, Address } from '@polkadot/types/interfaces'; +import type { IKeyringPair } from '@polkadot/types/types'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api/src/util/validate.ts b/packages/api/src/util/validate.ts index 74ff6f58eb..f997da4f9b 100644 --- a/packages/api/src/util/validate.ts +++ b/packages/api/src/util/validate.ts @@ -1,8 +1,8 @@ // Copyright 2017-2019 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntry } from '@polkadot/types/primitive/types'; -import { Type } from '@polkadot/types'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { Type } from '@polkadot/types'; import { assert, isUndefined } from '@polkadot/util'; diff --git a/packages/api/test/util/SingleAccountSigner.ts b/packages/api/test/util/SingleAccountSigner.ts index 0d92fc5e19..aaa93d5a52 100644 --- a/packages/api/test/util/SingleAccountSigner.ts +++ b/packages/api/test/util/SingleAccountSigner.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Signer, SignerResult } from '@polkadot/api/types'; -import { KeyringPair } from '@polkadot/keyring/types'; -import { Registry, SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types'; +import type { Signer, SignerResult } from '@polkadot/api/types'; +import type { KeyringPair } from '@polkadot/keyring/types'; +import type { Registry, SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types'; import { assert, hexToU8a, u8aToHex } from '@polkadot/util'; diff --git a/packages/api/test/util/logEvents.ts b/packages/api/test/util/logEvents.ts index 6c5266f97b..e0a9f14f2c 100644 --- a/packages/api/test/util/logEvents.ts +++ b/packages/api/test/util/logEvents.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EventRecord } from '@polkadot/types/interfaces'; +import type { EventRecord } from '@polkadot/types/interfaces'; import { SubmittableResult } from '../../src'; diff --git a/packages/metadata/src/MagicNumber.ts b/packages/metadata/src/MagicNumber.ts index e6f91ad8c8..fd71530b74 100644 --- a/packages/metadata/src/MagicNumber.ts +++ b/packages/metadata/src/MagicNumber.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber, Registry } from '@polkadot/types/types'; +import type { AnyNumber, Registry } from '@polkadot/types/types'; import { assert } from '@polkadot/util'; diff --git a/packages/metadata/src/Metadata.ts b/packages/metadata/src/Metadata.ts index 79b246466c..b055d1ba99 100644 --- a/packages/metadata/src/Metadata.ts +++ b/packages/metadata/src/Metadata.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '@polkadot/types/types'; +import type { Registry } from '@polkadot/types/types'; import { isString, u8aConcat, u8aToU8a } from '@polkadot/util'; diff --git a/packages/metadata/src/MetadataVersioned.ts b/packages/metadata/src/MetadataVersioned.ts index dd42403ccb..ecc5f90fc6 100644 --- a/packages/metadata/src/MetadataVersioned.ts +++ b/packages/metadata/src/MetadataVersioned.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12 } from '@polkadot/types/interfaces/metadata'; -import { Registry } from '@polkadot/types/types'; +import type { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12 } from '@polkadot/types/interfaces/metadata'; +import type { Registry } from '@polkadot/types/types'; import { Struct } from '@polkadot/types/codec'; import { assert } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/consts/fromMetadata.spec.ts b/packages/metadata/src/decorate/consts/fromMetadata.spec.ts index 51dbce44f5..b3856af73d 100644 --- a/packages/metadata/src/decorate/consts/fromMetadata.spec.ts +++ b/packages/metadata/src/decorate/consts/fromMetadata.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constants } from '../types'; +import type { Constants } from '../types'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/metadata/src/decorate/consts/fromMetadata.ts b/packages/metadata/src/decorate/consts/fromMetadata.ts index cb6e50f28e..537637b6ad 100644 --- a/packages/metadata/src/decorate/consts/fromMetadata.ts +++ b/packages/metadata/src/decorate/consts/fromMetadata.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '@polkadot/types/types'; -import { Constants, ConstantCodec, ModuleConstants } from '../types'; +import type { Registry } from '@polkadot/types/types'; +import type { Constants, ConstantCodec, ModuleConstants } from '../types'; import { hexToU8a, stringCamelCase } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts index dc72ffe67b..e20a3717cf 100644 --- a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts +++ b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Call } from '@polkadot/types/interfaces'; -import { AnyJson, CallFunction, Registry, RegistryMetadataCall } from '@polkadot/types/types'; +import type { Call } from '@polkadot/types/interfaces'; +import type { AnyJson, CallFunction, Registry, RegistryMetadataCall } from '@polkadot/types/types'; import { assert, stringCamelCase } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/extrinsics/fromMetadata.ts b/packages/metadata/src/decorate/extrinsics/fromMetadata.ts index 664b90eb53..725863e34a 100644 --- a/packages/metadata/src/decorate/extrinsics/fromMetadata.ts +++ b/packages/metadata/src/decorate/extrinsics/fromMetadata.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Calls, ModulesWithCalls, Registry, RegistryMetadata, RegistryMetadataModule } from '@polkadot/types/types'; +import type { Calls, ModulesWithCalls, Registry, RegistryMetadata, RegistryMetadataModule } from '@polkadot/types/types'; import { stringCamelCase } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/extrinsics/index.ts b/packages/metadata/src/decorate/extrinsics/index.ts index 1dbc1eb511..6bcce967e7 100644 --- a/packages/metadata/src/decorate/extrinsics/index.ts +++ b/packages/metadata/src/decorate/extrinsics/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ModulesWithCalls } from '@polkadot/types/types'; +import type { ModulesWithCalls } from '@polkadot/types/types'; const extrinsics: ModulesWithCalls = {}; diff --git a/packages/metadata/src/decorate/index.ts b/packages/metadata/src/decorate/index.ts index dad4e545fc..030a0be8b8 100644 --- a/packages/metadata/src/decorate/index.ts +++ b/packages/metadata/src/decorate/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '@polkadot/types/types'; -import { DecoratedMeta } from './types'; +import type { Registry } from '@polkadot/types/types'; +import type { DecoratedMeta } from './types'; import { assert } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/storage/createFunction.ts b/packages/metadata/src/decorate/storage/createFunction.ts index ebb82a2b86..93c12d983a 100644 --- a/packages/metadata/src/decorate/storage/createFunction.ts +++ b/packages/metadata/src/decorate/storage/createFunction.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; -import { StorageEntry } from '@polkadot/types/primitive/types'; -import { Codec, Registry } from '@polkadot/types/types'; +import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { Codec, Registry } from '@polkadot/types/types'; import BN from 'bn.js'; import { Raw } from '@polkadot/types/codec'; diff --git a/packages/metadata/src/decorate/storage/fromMetadata.ts b/packages/metadata/src/decorate/storage/fromMetadata.ts index ea3470e45e..9b5c0e3a00 100644 --- a/packages/metadata/src/decorate/storage/fromMetadata.ts +++ b/packages/metadata/src/decorate/storage/fromMetadata.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '@polkadot/types/types'; -import { ModuleStorage, Storage } from '../types'; +import type { Registry } from '@polkadot/types/types'; +import type { ModuleStorage, Storage } from '../types'; import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/storage/getHasher.ts b/packages/metadata/src/decorate/storage/getHasher.ts index c4152c42a2..27ca39013b 100644 --- a/packages/metadata/src/decorate/storage/getHasher.ts +++ b/packages/metadata/src/decorate/storage/getHasher.ts @@ -1,8 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; -import { StorageHasher } from '@polkadot/types/interfaces'; +import type { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; +import type { StorageHasher } from '@polkadot/types/interfaces'; + import { u8aConcat, u8aToU8a } from '@polkadot/util'; import { blake2AsU8a, xxhashAsU8a } from '@polkadot/util-crypto'; diff --git a/packages/metadata/src/decorate/storage/storage.ts b/packages/metadata/src/decorate/storage/storage.ts index b3356c634e..2dfbcfd297 100644 --- a/packages/metadata/src/decorate/storage/storage.ts +++ b/packages/metadata/src/decorate/storage/storage.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntry } from '@polkadot/types/primitive/types'; -import { Registry } from '@polkadot/types/types'; -import { Storage } from '../types'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { Registry } from '@polkadot/types/types'; +import type { Storage } from '../types'; import * as substrate from './substrate'; diff --git a/packages/metadata/src/decorate/storage/substrate.ts b/packages/metadata/src/decorate/storage/substrate.ts index 967904e4ff..0599e0adee 100644 --- a/packages/metadata/src/decorate/storage/substrate.ts +++ b/packages/metadata/src/decorate/storage/substrate.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces'; -import { StorageEntry } from '@polkadot/types/primitive/types'; -import { Registry } from '@polkadot/types/types'; +import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { Registry } from '@polkadot/types/types'; import { createFunction } from './createFunction'; diff --git a/packages/metadata/src/decorate/types.ts b/packages/metadata/src/decorate/types.ts index af5ff9921d..1caf895c15 100644 --- a/packages/metadata/src/decorate/types.ts +++ b/packages/metadata/src/decorate/types.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AugmentedConst, QueryableConsts, QueryableModuleConsts } from '@polkadot/api/types/consts'; -import { Codec, ModulesWithCalls } from '@polkadot/types/types'; -import { StorageEntry } from '@polkadot/types/primitive/types'; +import type { AugmentedConst, QueryableConsts, QueryableModuleConsts } from '@polkadot/api/types/consts'; +import type { Codec, ModulesWithCalls } from '@polkadot/types/types'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; export interface ModuleStorage { [key: string]: StorageEntry; diff --git a/packages/metadata/src/types.ts b/packages/metadata/src/types.ts index 2f1aed3a89..c91cc87f90 100644 --- a/packages/metadata/src/types.ts +++ b/packages/metadata/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from '@polkadot/types/types'; -import { Vec } from '@polkadot/types/codec'; +import type { Codec } from '@polkadot/types/types'; +import type { Vec } from '@polkadot/types/codec'; export interface MetadataInterface extends Codec { modules: Vec; diff --git a/packages/metadata/src/util/extractTypes.ts b/packages/metadata/src/util/extractTypes.ts index 3ccad291a3..ec178f8577 100644 --- a/packages/metadata/src/util/extractTypes.ts +++ b/packages/metadata/src/util/extractTypes.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef, TypeDefInfo } from '@polkadot/types/types'; +import type { TypeDef } from '@polkadot/types/types'; import { getTypeDef } from '@polkadot/types/create'; +import { TypeDefInfo } from '@polkadot/types/types'; type Extracted = string | Extracted[]; diff --git a/packages/metadata/src/util/getUniqTypes.ts b/packages/metadata/src/util/getUniqTypes.ts index af334d5c1e..479f954b8b 100644 --- a/packages/metadata/src/util/getUniqTypes.ts +++ b/packages/metadata/src/util/getUniqTypes.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Registry } from '@polkadot/types/types'; - -import { Option, Vec } from '@polkadot/types/codec'; -import { Text, Type } from '@polkadot/types/primitive'; +import type { Codec, Registry } from '@polkadot/types/types'; +import type { Option, Vec } from '@polkadot/types/codec'; +import type { Text, Type } from '@polkadot/types/primitive'; import { flattenUniq } from './flattenUniq'; import { validateTypes } from './validateTypes'; diff --git a/packages/metadata/src/util/testUtil.ts b/packages/metadata/src/util/testUtil.ts index 8ded17194b..3e89e2fb2b 100644 --- a/packages/metadata/src/util/testUtil.ts +++ b/packages/metadata/src/util/testUtil.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Registry } from '@polkadot/types/types'; -import { MetadataInterface } from '../types'; +import type { Codec, Registry } from '@polkadot/types/types'; +import type { MetadataInterface } from '../types'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; diff --git a/packages/metadata/src/util/toCallsOnly.ts b/packages/metadata/src/util/toCallsOnly.ts index e66b1e1e21..d4ef0c9dc6 100644 --- a/packages/metadata/src/util/toCallsOnly.ts +++ b/packages/metadata/src/util/toCallsOnly.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { FunctionMetadataLatest, MetadataLatest } from '@polkadot/types/interfaces/metadata'; -import { AnyJson, Registry } from '@polkadot/types/types'; +import type { FunctionMetadataLatest, MetadataLatest } from '@polkadot/types/interfaces/metadata'; +import type { AnyJson, Registry } from '@polkadot/types/types'; import { Option, Vec } from '@polkadot/types/codec'; import { Text, u8 } from '@polkadot/types/primitive'; diff --git a/packages/metadata/src/util/validateTypes.ts b/packages/metadata/src/util/validateTypes.ts index 5ab4993365..24f4a2058d 100644 --- a/packages/metadata/src/util/validateTypes.ts +++ b/packages/metadata/src/util/validateTypes.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '@polkadot/types/types'; +import type { Registry } from '@polkadot/types/types'; import { logger } from '@polkadot/util'; diff --git a/packages/metadata/src/v10/toV11.ts b/packages/metadata/src/v10/toV11.ts index 0a9461fd6f..df736d5acf 100644 --- a/packages/metadata/src/v10/toV11.ts +++ b/packages/metadata/src/v10/toV11.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { MetadataV10, MetadataV11 } from '@polkadot/types/interfaces/metadata'; -import { Registry } from '@polkadot/types/types'; +import type { MetadataV10, MetadataV11 } from '@polkadot/types/interfaces/metadata'; +import type { Registry } from '@polkadot/types/types'; /** @internal */ export function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 { diff --git a/packages/metadata/src/v11/toV12.ts b/packages/metadata/src/v11/toV12.ts index 2ddf1c5545..458548d92f 100644 --- a/packages/metadata/src/v11/toV12.ts +++ b/packages/metadata/src/v11/toV12.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { MetadataV11, MetadataV12, ModuleMetadataV12 } from '@polkadot/types/interfaces/metadata'; -import { Registry } from '@polkadot/types/types'; +import type { MetadataV11, MetadataV12, ModuleMetadataV12 } from '@polkadot/types/interfaces/metadata'; +import type { Registry } from '@polkadot/types/types'; /** * @internal diff --git a/packages/metadata/src/v12/toLatest.ts b/packages/metadata/src/v12/toLatest.ts index 9a8bbde324..5c12edb54d 100644 --- a/packages/metadata/src/v12/toLatest.ts +++ b/packages/metadata/src/v12/toLatest.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EventMetadataV12, EventMetadataLatest, FunctionMetadataV12, FunctionMetadataLatest, MetadataV12, MetadataLatest, ModuleMetadataLatest, ModuleMetadataV12, StorageMetadataV12, StorageMetadataLatest, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; -import { Registry, OverrideModuleType } from '@polkadot/types/types'; +import type { EventMetadataV12, EventMetadataLatest, FunctionMetadataV12, FunctionMetadataLatest, MetadataV12, MetadataLatest, ModuleMetadataLatest, ModuleMetadataV12, StorageMetadataV12, StorageMetadataLatest, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; +import type { Registry, OverrideModuleType } from '@polkadot/types/types'; import { getModuleTypes } from '@polkadot/types-known'; import { Type } from '@polkadot/types/primitive'; diff --git a/packages/metadata/src/v9/toV10.ts b/packages/metadata/src/v9/toV10.ts index 9b965b9e32..936660a219 100644 --- a/packages/metadata/src/v9/toV10.ts +++ b/packages/metadata/src/v9/toV10.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '@polkadot/types/interfaces/metadata'; -import { Registry } from '@polkadot/types/types'; +import type { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '@polkadot/types/interfaces/metadata'; +import type { Registry } from '@polkadot/types/types'; // migrate a storage hasher type // see https://github.com/paritytech/substrate/pull/4462 diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 67a52e0d37..6b9f55c70c 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -1,16 +1,18 @@ // Copyright 2017-2020 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ProviderInterface, ProviderInterfaceCallback } from '@polkadot/rpc-provider/types'; -import { Hash } from '@polkadot/types/interfaces'; -import { AnyJson, Codec, DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types'; -import { RpcInterface, RpcInterfaceMethod } from './types'; +import type { Observer } from 'rxjs'; +import type { ProviderInterface, ProviderInterfaceCallback } from '@polkadot/rpc-provider/types'; +import type { StorageKey, Vec } from '@polkadot/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { AnyJson, Codec, DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types'; +import type { RpcInterface, RpcInterfaceMethod } from './types'; import memoizee from 'memoizee'; -import { Observable, Observer } from 'rxjs'; +import { Observable } from 'rxjs'; import { publishReplay, refCount } from 'rxjs/operators'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; -import { Option, StorageKey, Vec } from '@polkadot/types'; +import { Option } from '@polkadot/types'; import { createClass, createTypeUnsafe } from '@polkadot/types/create'; import { assert, hexToU8a, isFunction, isNull, isUndefined, logger, u8aToU8a } from '@polkadot/util'; diff --git a/packages/rpc-core/src/methodSend.spec.ts b/packages/rpc-core/src/methodSend.spec.ts index 6113ec9ce3..d4ce7f482d 100644 --- a/packages/rpc-core/src/methodSend.spec.ts +++ b/packages/rpc-core/src/methodSend.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DefinitionRpc } from '@polkadot/types/types'; +import type { DefinitionRpc } from '@polkadot/types/types'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/rpc-core/src/replay.spec.ts b/packages/rpc-core/src/replay.spec.ts index e8074c588b..bf1be9008e 100644 --- a/packages/rpc-core/src/replay.spec.ts +++ b/packages/rpc-core/src/replay.spec.ts @@ -1,7 +1,9 @@ // Copyright 2017-2020 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Observable, of } from 'rxjs'; +import type { Observable } from 'rxjs'; + +import { of } from 'rxjs'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/rpc-core/src/types.jsonrpc.ts b/packages/rpc-core/src/types.jsonrpc.ts index 346b7c38dc..6fbb94edac 100644 --- a/packages/rpc-core/src/types.jsonrpc.ts +++ b/packages/rpc-core/src/types.jsonrpc.ts @@ -3,7 +3,7 @@ // FIXME, this whole file needs to move to API -import { AnyFunction } from '@polkadot/types/types'; +import type { AnyFunction } from '@polkadot/types/types'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface RpcInterface {} diff --git a/packages/rpc-core/src/types.ts b/packages/rpc-core/src/types.ts index 34f5544608..d3dfcb89e9 100644 --- a/packages/rpc-core/src/types.ts +++ b/packages/rpc-core/src/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; export * from './types.jsonrpc'; diff --git a/packages/rpc-core/src/util/drr.ts b/packages/rpc-core/src/util/drr.ts index 06076aba96..69ba79b3c9 100644 --- a/packages/rpc-core/src/util/drr.ts +++ b/packages/rpc-core/src/util/drr.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Observable } from 'rxjs'; +import type { Observable } from 'rxjs'; import { catchError, distinctUntilChanged, publishReplay, tap, refCount } from 'rxjs/operators'; import { logger } from '@polkadot/util'; diff --git a/packages/rpc-provider/src/coder/decodeResponse.spec.ts b/packages/rpc-provider/src/coder/decodeResponse.spec.ts index 4355124d06..42a71ab266 100644 --- a/packages/rpc-provider/src/coder/decodeResponse.spec.ts +++ b/packages/rpc-provider/src/coder/decodeResponse.spec.ts @@ -1,7 +1,8 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { JsonRpcResponse } from '../types'; +import type { JsonRpcResponse } from '../types'; + import { RpcCoder } from '.'; describe('decodeResponse', (): void => { diff --git a/packages/rpc-provider/src/coder/index.ts b/packages/rpc-provider/src/coder/index.ts index f7dd72b012..cce1f83ead 100644 --- a/packages/rpc-provider/src/coder/index.ts +++ b/packages/rpc-provider/src/coder/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types'; +import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types'; import { assert, isUndefined, isNumber, isString } from '@polkadot/util'; diff --git a/packages/rpc-provider/src/http/index.ts b/packages/rpc-provider/src/http/index.ts index c3aadf2618..95bcee935e 100644 --- a/packages/rpc-provider/src/http/index.ts +++ b/packages/rpc-provider/src/http/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; +import type { ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; import { assert, logger } from '@polkadot/util'; import fetch from '@polkadot/x-fetch'; diff --git a/packages/rpc-provider/src/http/types.ts b/packages/rpc-provider/src/http/types.ts index 8c166df912..634c27d255 100644 --- a/packages/rpc-provider/src/http/types.ts +++ b/packages/rpc-provider/src/http/types.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Logger } from '@polkadot/util/types'; +import type { Logger } from '@polkadot/util/types'; -import { RpcCoder } from '../coder'; +import type { RpcCoder } from '../coder'; export interface HttpState { coder: RpcCoder; diff --git a/packages/rpc-provider/src/mock/index.ts b/packages/rpc-provider/src/mock/index.ts index 0fc67693d0..be71f5caf9 100644 --- a/packages/rpc-provider/src/mock/index.ts +++ b/packages/rpc-provider/src/mock/index.ts @@ -3,10 +3,10 @@ /* eslint-disable camelcase */ -import { Header } from '@polkadot/types/interfaces'; -import { Codec, Registry } from '@polkadot/types/types'; -import { ProviderInterface, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; -import { MockStateSubscriptions, MockStateSubscriptionCallback, MockStateDb } from './types'; +import type { Header } from '@polkadot/types/interfaces'; +import type { Codec, Registry } from '@polkadot/types/types'; +import type { ProviderInterface, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; +import type { MockStateSubscriptions, MockStateSubscriptionCallback, MockStateDb } from './types'; import BN from 'bn.js'; import EventEmitter from 'eventemitter3'; diff --git a/packages/rpc-provider/src/mock/on.spec.ts b/packages/rpc-provider/src/mock/on.spec.ts index cf464af439..5cb6e7981f 100644 --- a/packages/rpc-provider/src/mock/on.spec.ts +++ b/packages/rpc-provider/src/mock/on.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ProviderInterfaceEmitted } from '../types'; +import type { ProviderInterfaceEmitted } from '../types'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/rpc-provider/src/mock/types.ts b/packages/rpc-provider/src/mock/types.ts index 9c3912ac4b..7eaca90af2 100644 --- a/packages/rpc-provider/src/mock/types.ts +++ b/packages/rpc-provider/src/mock/types.ts @@ -1,8 +1,9 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Server } from 'mock-socket'; -import { Constructor } from '@polkadot/types/types'; +import type { Constructor } from '@polkadot/types/types'; + +import type { Server } from 'mock-socket'; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access export interface Global extends NodeJS.Global { diff --git a/packages/rpc-provider/src/ws/index.ts b/packages/rpc-provider/src/ws/index.ts index cd72917bf1..e287cdd257 100644 --- a/packages/rpc-provider/src/ws/index.ts +++ b/packages/rpc-provider/src/ws/index.ts @@ -3,7 +3,7 @@ /* eslint-disable camelcase */ -import { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; +import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; import EventEmitter from 'eventemitter3'; import { assert, isChildClass, isNull, isUndefined, logger } from '@polkadot/util'; diff --git a/packages/rpc-provider/src/ws/send.spec.ts b/packages/rpc-provider/src/ws/send.spec.ts index 694d44b428..d8ccbc0a21 100644 --- a/packages/rpc-provider/src/ws/send.spec.ts +++ b/packages/rpc-provider/src/ws/send.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor } from '@polkadot/types/types'; +import type { Constructor } from '@polkadot/types/types'; import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; diff --git a/packages/rpc-provider/src/ws/subscribe.spec.ts b/packages/rpc-provider/src/ws/subscribe.spec.ts index 0c6ea28b1f..544220c042 100644 --- a/packages/rpc-provider/src/ws/subscribe.spec.ts +++ b/packages/rpc-provider/src/ws/subscribe.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor } from '@polkadot/types/types'; +import type { Constructor } from '@polkadot/types/types'; import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; diff --git a/packages/rpc-provider/src/ws/unsubscribe.spec.ts b/packages/rpc-provider/src/ws/unsubscribe.spec.ts index bbae0cbba0..f3e85cacca 100644 --- a/packages/rpc-provider/src/ws/unsubscribe.spec.ts +++ b/packages/rpc-provider/src/ws/unsubscribe.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor } from '@polkadot/types/types'; +import type { Constructor } from '@polkadot/types/types'; import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index 9533c39f80..b8ef1071e7 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import Handlebars from 'handlebars'; +import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; +import type { Registry } from '@polkadot/types/types'; -import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; -import { Registry } from '@polkadot/types/types'; +import Handlebars from 'handlebars'; import staticData from '@polkadot/metadata/static'; import { Metadata } from '@polkadot/metadata'; diff --git a/packages/typegen/src/generate/rpc.ts b/packages/typegen/src/generate/rpc.ts index 40e3951dda..5f225d8fce 100644 --- a/packages/typegen/src/generate/rpc.ts +++ b/packages/typegen/src/generate/rpc.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import Handlebars from 'handlebars'; +import type { Definitions } from '@polkadot/types/types'; +import Handlebars from 'handlebars'; import { TypeRegistry } from '@polkadot/types/create'; -import { Definitions } from '@polkadot/types/types'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import { createImports, getSimilarTypes, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; diff --git a/packages/typegen/src/generate/tsDef.ts b/packages/typegen/src/generate/tsDef.ts index 7f910c7f1c..e9bfb3b33d 100644 --- a/packages/typegen/src/generate/tsDef.ts +++ b/packages/typegen/src/generate/tsDef.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef, TypeDefInfo } from '@polkadot/types/create/types'; -import { ModuleTypes } from '../util/imports'; +import type { TypeDef } from '@polkadot/types/create/types'; +import type { ModuleTypes } from '../util/imports'; import Handlebars from 'handlebars'; import path from 'path'; import { getTypeDef } from '@polkadot/types/create'; +import { TypeDefInfo } from '@polkadot/types/create/types'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import { isString, stringCamelCase, stringUpperFirst, assert } from '@polkadot/util'; diff --git a/packages/typegen/src/generate/tx.ts b/packages/typegen/src/generate/tx.ts index dbcc7d2f2b..bc95b96904 100644 --- a/packages/typegen/src/generate/tx.ts +++ b/packages/typegen/src/generate/tx.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Registry } from '@polkadot/types/types'; + import Handlebars from 'handlebars'; - -import { Registry } from '@polkadot/types/types'; - import staticData from '@polkadot/metadata/static'; import { Metadata } from '@polkadot/metadata'; import * as defaultDefs from '@polkadot/types/interfaces/definitions'; diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index 291a4df02b..c5e4d69a1d 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { MetadataLatest } from '@polkadot/types/interfaces/metadata'; -import { Codec, DefinitionRpcParam } from '@polkadot/types/types'; +import type { MetadataLatest } from '@polkadot/types/interfaces/metadata'; +import type { Codec, DefinitionRpcParam } from '@polkadot/types/types'; import fs from 'fs'; import { Metadata } from '@polkadot/metadata'; diff --git a/packages/typegen/src/util/class.ts b/packages/typegen/src/util/class.ts index 4d239ceb0d..e3d13279d0 100644 --- a/packages/typegen/src/util/class.ts +++ b/packages/typegen/src/util/class.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor } from '@polkadot/types/types'; +import type { Constructor } from '@polkadot/types/types'; import { UInt } from '@polkadot/types/codec'; import { isChildClass } from '@polkadot/util'; diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index 8cd66fbb44..90145808ae 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef, TypeDefInfo } from '@polkadot/types/create/types'; -import { Constructor, Registry } from '@polkadot/types/types'; +import type { TypeDef } from '@polkadot/types/create/types'; +import type { Constructor, Registry } from '@polkadot/types/types'; import { ClassOfUnsafe, getTypeDef } from '@polkadot/types/create'; import { Compact, Enum, Option, Struct, UInt, Vec, Tuple } from '@polkadot/types/codec'; import { AbstractInt } from '@polkadot/types/codec/AbstractInt'; import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions'; import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic'; +import { TypeDefInfo } from '@polkadot/types/create/types'; import { Null } from '@polkadot/types/primitive'; import * as primitiveClasses from '@polkadot/types/primitive'; import { isChildClass } from '@polkadot/util'; diff --git a/packages/typegen/src/util/formatting.ts b/packages/typegen/src/util/formatting.ts index c0ab05e5a7..3d6b070947 100644 --- a/packages/typegen/src/util/formatting.ts +++ b/packages/typegen/src/util/formatting.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TypeDef } from '@polkadot/types/create/types'; + import Handlebars from 'handlebars'; -import { TypeDef, TypeDefInfo } from '@polkadot/types/create/types'; - import { getTypeDef, paramsNotation } from '@polkadot/types/create'; +import { TypeDefInfo } from '@polkadot/types/create/types'; import { isString } from '@polkadot/util'; import { setImports, ModuleTypes, TypeImports } from './imports'; diff --git a/packages/types-known/src/chain/index.ts b/packages/types-known/src/chain/index.ts index 0f17d67604..8225d7f003 100644 --- a/packages/types-known/src/chain/index.ts +++ b/packages/types-known/src/chain/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; // Type overrides based on specific nodes const typesChain: Record = { diff --git a/packages/types-known/src/index.ts b/packages/types-known/src/index.ts index 4848883f0a..b64bf89d15 100644 --- a/packages/types-known/src/index.ts +++ b/packages/types-known/src/index.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import { Hash } from '@polkadot/types/interfaces'; -import { ChainUpgradeVersion, DefinitionRpc, DefinitionRpcSub, Registry, RegistryTypes, OverrideModuleType, OverrideVersionedType } from '@polkadot/types/types'; +import type { Text } from '@polkadot/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import type { ChainUpgradeVersion, DefinitionRpc, DefinitionRpcSub, Registry, RegistryTypes, OverrideModuleType, OverrideVersionedType } from '@polkadot/types/types'; -import { Text } from '@polkadot/types'; import { bnToBn, isUndefined } from '@polkadot/util'; import typesChain from './chain'; diff --git a/packages/types-known/src/modules.ts b/packages/types-known/src/modules.ts index 28c2a05bea..67e9531716 100644 --- a/packages/types-known/src/modules.ts +++ b/packages/types-known/src/modules.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { OverrideModuleType } from '@polkadot/types/types'; +import type { OverrideModuleType } from '@polkadot/types/types'; // type overrides for modules (where duplication between modules exist) const typesModules: Record = { diff --git a/packages/types-known/src/spec/centrifuge-chain.ts b/packages/types-known/src/spec/centrifuge-chain.ts index f2bdff5d35..4d97715f51 100644 --- a/packages/types-known/src/spec/centrifuge-chain.ts +++ b/packages/types-known/src/spec/centrifuge-chain.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { // substrate diff --git a/packages/types-known/src/spec/index.ts b/packages/types-known/src/spec/index.ts index cdf9e3c4d5..d70b593a92 100644 --- a/packages/types-known/src/spec/index.ts +++ b/packages/types-known/src/spec/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; import centrifugeChain from './centrifuge-chain'; import kusama from './kusama'; diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index f65f7cb944..c5f0406b69 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { Address: 'AccountId', diff --git a/packages/types-known/src/spec/node-template.ts b/packages/types-known/src/spec/node-template.ts index 98d7858daa..e8daed2ad9 100644 --- a/packages/types-known/src/spec/node-template.ts +++ b/packages/types-known/src/spec/node-template.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; const versioned: OverrideVersionedType[] = [ { diff --git a/packages/types-known/src/spec/node.ts b/packages/types-known/src/spec/node.ts index f820d28349..cc3cda4918 100644 --- a/packages/types-known/src/spec/node.ts +++ b/packages/types-known/src/spec/node.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; // these are override types for Polkadot const versioned: OverrideVersionedType[] = [ diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index c344f37470..dc839e6a6e 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { Address: 'AccountId', diff --git a/packages/types-known/src/spec/rococo.ts b/packages/types-known/src/spec/rococo.ts index 72fda6b40f..f145e13a64 100644 --- a/packages/types-known/src/spec/rococo.ts +++ b/packages/types-known/src/spec/rococo.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; // structs need to be in order /* eslint-disable sort-keys */ diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index ece9c06e63..ccddebd2dc 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { OverrideVersionedType } from '@polkadot/types/types'; +import type { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { Address: 'AccountId', diff --git a/packages/types-known/src/upgrades/index.ts b/packages/types-known/src/upgrades/index.ts index 73f1fe4bcd..bd26425fb7 100644 --- a/packages/types-known/src/upgrades/index.ts +++ b/packages/types-known/src/upgrades/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ChainUpgrades } from '@polkadot/types/types'; -import { ChainUpgradesRaw } from './types'; +import type { ChainUpgrades } from '@polkadot/types/types'; +import type { ChainUpgradesRaw } from './types'; import BN from 'bn.js'; import { assert, hexToU8a } from '@polkadot/util'; diff --git a/packages/types-known/src/upgrades/kusama.ts b/packages/types-known/src/upgrades/kusama.ts index 93858de7a9..72415ee6fe 100644 --- a/packages/types-known/src/upgrades/kusama.ts +++ b/packages/types-known/src/upgrades/kusama.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ChainUpgradesRaw } from './types'; +import type { ChainUpgradesRaw } from './types'; const upgrades: ChainUpgradesRaw = { genesisHash: '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe', diff --git a/packages/types-known/src/upgrades/polkadot.ts b/packages/types-known/src/upgrades/polkadot.ts index 6b8169769b..64061ac0dd 100644 --- a/packages/types-known/src/upgrades/polkadot.ts +++ b/packages/types-known/src/upgrades/polkadot.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ChainUpgradesRaw } from './types'; +import type { ChainUpgradesRaw } from './types'; const upgrades: ChainUpgradesRaw = { genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', diff --git a/packages/types-known/src/upgrades/westend.ts b/packages/types-known/src/upgrades/westend.ts index 62452a377a..f87ae6a292 100644 --- a/packages/types-known/src/upgrades/westend.ts +++ b/packages/types-known/src/upgrades/westend.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ChainUpgradesRaw } from './types'; +import type { ChainUpgradesRaw } from './types'; const upgrades: ChainUpgradesRaw = { genesisHash: '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e', diff --git a/packages/types/src/codec/AbstractArray.ts b/packages/types/src/codec/AbstractArray.ts index 32c0f92996..8646e2ef71 100644 --- a/packages/types/src/codec/AbstractArray.ts +++ b/packages/types/src/codec/AbstractArray.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, Codec, Registry } from '../types'; import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/codec/AbstractInt.ts b/packages/types/src/codec/AbstractInt.ts index 3a3d8940ce..5138e4a02c 100644 --- a/packages/types/src/codec/AbstractInt.ts +++ b/packages/types/src/codec/AbstractInt.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyNumber, Codec, Registry } from '../types'; -import { UIntBitLength } from './types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyNumber, Codec, Registry } from '../types'; +import type { UIntBitLength } from './types'; import BN from 'bn.js'; import { BN_ZERO, assert, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util'; diff --git a/packages/types/src/codec/BTreeMap.ts b/packages/types/src/codec/BTreeMap.ts index dc651b04f9..26959b5940 100644 --- a/packages/types/src/codec/BTreeMap.ts +++ b/packages/types/src/codec/BTreeMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; import { CodecMap } from './Map'; diff --git a/packages/types/src/codec/BTreeSet.spec.ts b/packages/types/src/codec/BTreeSet.spec.ts index 0e5f7c4c5f..a4803055fc 100644 --- a/packages/types/src/codec/BTreeSet.spec.ts +++ b/packages/types/src/codec/BTreeSet.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/BTreeSet.ts b/packages/types/src/codec/BTreeSet.ts index 2784cedd6c..71bcdc2e90 100644 --- a/packages/types/src/codec/BTreeSet.ts +++ b/packages/types/src/codec/BTreeSet.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; import { isHex, hexToU8a, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/Base.ts b/packages/types/src/codec/Base.ts index d06ed16095..dd8254288a 100644 --- a/packages/types/src/codec/Base.ts +++ b/packages/types/src/codec/Base.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, BareOpts, Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, BareOpts, Codec, Registry } from '../types'; /** * @name Base diff --git a/packages/types/src/codec/Compact.ts b/packages/types/src/codec/Compact.ts index 0776963281..222594b790 100644 --- a/packages/types/src/codec/Compact.ts +++ b/packages/types/src/codec/Compact.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '@polkadot/types/interfaces'; -import { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; -import { CompactEncodable, UIntBitLength } from './types'; +import type { H256 } from '../interfaces'; +import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; +import type { CompactEncodable, UIntBitLength } from './types'; import BN from 'bn.js'; import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util'; diff --git a/packages/types/src/codec/Date.spec.ts b/packages/types/src/codec/Date.spec.ts index 7c68fdbb24..358596a1f0 100644 --- a/packages/types/src/codec/Date.spec.ts +++ b/packages/types/src/codec/Date.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import BN from 'bn.js'; diff --git a/packages/types/src/codec/Date.ts b/packages/types/src/codec/Date.ts index bea5a1db77..e428680b55 100644 --- a/packages/types/src/codec/Date.ts +++ b/packages/types/src/codec/Date.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyNumber, Codec, Registry } from '../types'; -import { UIntBitLength } from './types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyNumber, Codec, Registry } from '../types'; +import type { UIntBitLength } from './types'; import BN from 'bn.js'; import { bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util'; diff --git a/packages/types/src/codec/Enum.spec.ts b/packages/types/src/codec/Enum.spec.ts index ad8ef6a881..4cb332c456 100644 --- a/packages/types/src/codec/Enum.spec.ts +++ b/packages/types/src/codec/Enum.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/codec/Enum.ts b/packages/types/src/codec/Enum.ts index 03695795e3..15a8587f0f 100644 --- a/packages/types/src/codec/Enum.ts +++ b/packages/types/src/codec/Enum.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '@polkadot/types/interfaces'; -import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { H256 } from '../interfaces'; +import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/codec/HashMap.ts b/packages/types/src/codec/HashMap.ts index efa5efa44b..2985ff7d24 100644 --- a/packages/types/src/codec/HashMap.ts +++ b/packages/types/src/codec/HashMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; import { CodecMap } from './Map'; diff --git a/packages/types/src/codec/Int.ts b/packages/types/src/codec/Int.ts index 274f4a375e..0325392186 100644 --- a/packages/types/src/codec/Int.ts +++ b/packages/types/src/codec/Int.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber, Constructor, Registry } from '../types'; -import { UIntBitLength } from './types'; +import type { AnyNumber, Constructor, Registry } from '../types'; +import type { UIntBitLength } from './types'; import { AbstractInt } from './AbstractInt'; diff --git a/packages/types/src/codec/Json.ts b/packages/types/src/codec/Json.ts index 9aade533bc..0b6808699f 100644 --- a/packages/types/src/codec/Json.ts +++ b/packages/types/src/codec/Json.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, Codec, Registry } from '../types'; import { isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/codec/Linkage.ts b/packages/types/src/codec/Linkage.ts index b17d5afce9..9ff3f59589 100644 --- a/packages/types/src/codec/Linkage.ts +++ b/packages/types/src/codec/Linkage.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; import { Option } from './Option'; import { Struct } from './Struct'; diff --git a/packages/types/src/codec/Map.spec.ts b/packages/types/src/codec/Map.spec.ts index 927c91481c..440df5983d 100644 --- a/packages/types/src/codec/Map.spec.ts +++ b/packages/types/src/codec/Map.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/Map.ts b/packages/types/src/codec/Map.ts index 384f641176..5718aae2b2 100644 --- a/packages/types/src/codec/Map.ts +++ b/packages/types/src/codec/Map.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; import { isHex, hexToU8a, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/Option.ts b/packages/types/src/codec/Option.ts index e16b710199..353f5c1421 100644 --- a/packages/types/src/codec/Option.ts +++ b/packages/types/src/codec/Option.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '@polkadot/types/interfaces'; -import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { H256 } from '../interfaces'; +import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/codec/Raw.spec.ts b/packages/types/src/codec/Raw.spec.ts index 1cf174f663..d5dd129802 100644 --- a/packages/types/src/codec/Raw.spec.ts +++ b/packages/types/src/codec/Raw.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Raw } from '.'; diff --git a/packages/types/src/codec/Raw.ts b/packages/types/src/codec/Raw.ts index f82349448e..22444f09dc 100644 --- a/packages/types/src/codec/Raw.ts +++ b/packages/types/src/codec/Raw.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, AnyU8a, IU8a, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, AnyU8a, IU8a, Registry } from '../types'; import { assert, isAscii, isU8a, isUndefined, isUtf8, u8aToHex, u8aToString, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/Result.ts b/packages/types/src/codec/Result.ts index 74d0af263c..fe3f3b05e5 100644 --- a/packages/types/src/codec/Result.ts +++ b/packages/types/src/codec/Result.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert } from '@polkadot/util'; diff --git a/packages/types/src/codec/Set.ts b/packages/types/src/codec/Set.ts index 5669d97c0f..ca0f081234 100644 --- a/packages/types/src/codec/Set.ts +++ b/packages/types/src/codec/Set.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { Codec, Constructor, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { Codec, Constructor, Registry } from '../types'; import BN from 'bn.js'; import { assert, bnToBn, bnToU8a, isBn, isU8a, isNumber, isString, isUndefined, stringCamelCase, stringUpperFirst, u8aToHex, u8aToBn, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/Struct.spec.ts b/packages/types/src/codec/Struct.spec.ts index be959f71fb..887162613a 100644 --- a/packages/types/src/codec/Struct.spec.ts +++ b/packages/types/src/codec/Struct.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/Struct.ts b/packages/types/src/codec/Struct.ts index 152d194913..0c71a5bace 100644 --- a/packages/types/src/codec/Struct.ts +++ b/packages/types/src/codec/Struct.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types'; import { hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/codec/Tuple.spec.ts b/packages/types/src/codec/Tuple.spec.ts index e82319d52e..c712699d07 100644 --- a/packages/types/src/codec/Tuple.spec.ts +++ b/packages/types/src/codec/Tuple.spec.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { VoteThreshold } from '../interfaces/elections'; -import { BlockNumber } from '../interfaces/runtime'; -import { CodecTo } from '../types'; +import type { VoteThreshold } from '../interfaces/elections'; +import type { BlockNumber } from '../interfaces/runtime'; +import type { CodecTo } from '../types'; import { Metadata } from '@polkadot/metadata'; import rpcMetadata from '@polkadot/metadata/static'; diff --git a/packages/types/src/codec/Tuple.ts b/packages/types/src/codec/Tuple.ts index a9552b9807..70dda6440c 100644 --- a/packages/types/src/codec/Tuple.ts +++ b/packages/types/src/codec/Tuple.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber, AnyU8a, AnyString, Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { AnyNumber, AnyU8a, AnyString, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { isU8a, isHex, hexToU8a, u8aConcat } from '@polkadot/util'; diff --git a/packages/types/src/codec/U8aFixed.ts b/packages/types/src/codec/U8aFixed.ts index 2efe0fc6eb..596aceb154 100644 --- a/packages/types/src/codec/U8aFixed.ts +++ b/packages/types/src/codec/U8aFixed.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyU8a, Constructor, Registry } from '../types'; -import { U8aBitLength } from './types'; +import type { AnyU8a, Constructor, Registry } from '../types'; +import type { U8aBitLength } from './types'; import { isString, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/UInt.ts b/packages/types/src/codec/UInt.ts index 3009437ea1..6c91b4b567 100644 --- a/packages/types/src/codec/UInt.ts +++ b/packages/types/src/codec/UInt.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber, Constructor, Registry } from '../types'; -import { UIntBitLength } from './types'; +import type { AnyNumber, Constructor, Registry } from '../types'; +import type { UIntBitLength } from './types'; import { AbstractInt } from './AbstractInt'; diff --git a/packages/types/src/codec/Vec.spec.ts b/packages/types/src/codec/Vec.spec.ts index 99910319fd..c3d16a8b6d 100644 --- a/packages/types/src/codec/Vec.spec.ts +++ b/packages/types/src/codec/Vec.spec.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { PropIndex } from '../interfaces/democracy'; -import { Codec, CodecTo } from '../types'; +import type { PropIndex } from '../interfaces/democracy'; +import type { Codec, CodecTo } from '../types'; import { Metadata } from '@polkadot/metadata'; import rpcMetadata from '@polkadot/metadata/static'; diff --git a/packages/types/src/codec/Vec.ts b/packages/types/src/codec/Vec.ts index b3bb099ae9..ffc6e4bde7 100644 --- a/packages/types/src/codec/Vec.ts +++ b/packages/types/src/codec/Vec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/VecAny.ts b/packages/types/src/codec/VecAny.ts index 6892e52777..ce4ee77e84 100644 --- a/packages/types/src/codec/VecAny.ts +++ b/packages/types/src/codec/VecAny.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from '../types'; +import type { Codec } from '../types'; import { AbstractArray } from './AbstractArray'; diff --git a/packages/types/src/codec/VecFixed.ts b/packages/types/src/codec/VecFixed.ts index cabc654748..0fdc162479 100644 --- a/packages/types/src/codec/VecFixed.ts +++ b/packages/types/src/codec/VecFixed.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, isU8a, u8aConcat, compactToU8a } from '@polkadot/util'; diff --git a/packages/types/src/codec/types.ts b/packages/types/src/codec/types.ts index 2610047c7e..d7fdf0cb74 100644 --- a/packages/types/src/codec/types.ts +++ b/packages/types/src/codec/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from '../types'; - import type BN from 'bn.js'; +import type { Codec } from '../types'; export interface CompactEncodable extends Codec { bitLength (): number; diff --git a/packages/types/src/codec/utils/compareMap.spec.ts b/packages/types/src/codec/utils/compareMap.spec.ts index c510c16635..2b8664793f 100644 --- a/packages/types/src/codec/utils/compareMap.spec.ts +++ b/packages/types/src/codec/utils/compareMap.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from '../../types'; +import type { Codec } from '../../types'; import { TypeRegistry } from '../../create'; import { U32 } from '../../primitive'; import { compareMap } from '.'; diff --git a/packages/types/src/codec/utils/decodeU8a.ts b/packages/types/src/codec/utils/decodeU8a.ts index 2895c1f676..85cedf39b6 100644 --- a/packages/types/src/codec/utils/decodeU8a.ts +++ b/packages/types/src/codec/utils/decodeU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, Registry } from '../../types'; +import type { Codec, Constructor, Registry } from '../../types'; /** * Given an u8a, and an array of Type constructors, decode the u8a against the diff --git a/packages/types/src/codec/utils/mapToTypeMap.ts b/packages/types/src/codec/utils/mapToTypeMap.ts index ddf5afec81..f9c1a97a6f 100644 --- a/packages/types/src/codec/utils/mapToTypeMap.ts +++ b/packages/types/src/codec/utils/mapToTypeMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor, InterfaceTypes, Registry } from '../../types'; +import type { Constructor, InterfaceTypes, Registry } from '../../types'; import { typeToConstructor } from './typeToConstructor'; diff --git a/packages/types/src/codec/utils/typeToConstructor.ts b/packages/types/src/codec/utils/typeToConstructor.ts index 0e5631fb2d..1819eeb4ea 100644 --- a/packages/types/src/codec/utils/typeToConstructor.ts +++ b/packages/types/src/codec/utils/typeToConstructor.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, InterfaceTypes, Registry } from '../../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../../types'; import { isString } from '@polkadot/util'; diff --git a/packages/types/src/create/createClass.spec.ts b/packages/types/src/create/createClass.spec.ts index b9819a64c7..eb5bda3521 100644 --- a/packages/types/src/create/createClass.spec.ts +++ b/packages/types/src/create/createClass.spec.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { TypeDefInfo } from '../types'; - import { createClass, getTypeClass, TypeRegistry } from '.'; describe('createClass', (): void => { diff --git a/packages/types/src/create/createClass.ts b/packages/types/src/create/createClass.ts index 31bde96b7d..f29c60721d 100644 --- a/packages/types/src/create/createClass.ts +++ b/packages/types/src/create/createClass.ts @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UIntBitLength, U8aBitLength } from '../codec/types'; -import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { FromReg, TypeDef, TypeDefInfo } from './types'; +import type { UIntBitLength, U8aBitLength } from '../codec/types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { FromReg, TypeDef } from './types'; import { assert, isNumber, isUndefined } from '@polkadot/util'; import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec'; import { DoNotConstruct } from '../primitive'; - import { getTypeDef } from './getTypeDef'; +import { TypeDefInfo } from './types'; export function createClass (registry: Registry, type: K): Constructor> { // eslint-disable-next-line @typescript-eslint/no-use-before-define diff --git a/packages/types/src/create/createType.ts b/packages/types/src/create/createType.ts index 8b0cbe39c8..99d5f54937 100644 --- a/packages/types/src/create/createType.ts +++ b/packages/types/src/create/createType.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { FromReg } from './types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { FromReg } from './types'; import { isU8a, logger, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/create/encodeTypes.ts b/packages/types/src/create/encodeTypes.ts index b549c9ff10..7226db594e 100644 --- a/packages/types/src/create/encodeTypes.ts +++ b/packages/types/src/create/encodeTypes.ts @@ -1,10 +1,12 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef, TypeDefInfo } from './types'; +import type { TypeDef } from './types'; import { assert, isNumber, isUndefined } from '@polkadot/util'; +import { TypeDefInfo } from './types'; + const stringIdentity = string }> (value: T): string => value.toString(); const INFO_WRAP = ['BTreeMap', 'BTreeSet', 'Compact', 'HashMap', 'Option', 'Result', 'Vec']; diff --git a/packages/types/src/create/getTypeDef.spec.ts b/packages/types/src/create/getTypeDef.spec.ts index eaff24a1ad..c0cfc76fe8 100644 --- a/packages/types/src/create/getTypeDef.spec.ts +++ b/packages/types/src/create/getTypeDef.spec.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { TypeDefInfo } from './types'; - import { TypeRegistry, getTypeDef } from '.'; describe('getTypeDef', (): void => { diff --git a/packages/types/src/create/getTypeDef.ts b/packages/types/src/create/getTypeDef.ts index cc31d61243..c5a68de675 100644 --- a/packages/types/src/create/getTypeDef.ts +++ b/packages/types/src/create/getTypeDef.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef, TypeDefInfo } from './types'; +import type { TypeDef } from './types'; import { assert } from '@polkadot/util'; import { sanitize } from './sanitize'; +import { TypeDefInfo } from './types'; import { typeSplit } from './typeSplit'; interface TypeDefOptions { diff --git a/packages/types/src/create/registry.spec.ts b/packages/types/src/create/registry.spec.ts index a5b48a69b6..1f472a08e0 100644 --- a/packages/types/src/create/registry.spec.ts +++ b/packages/types/src/create/registry.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { Codec, Constructor } from '../types'; +import type { Codec, Constructor } from '../types'; import { isChildClass, u8aToU8a } from '@polkadot/util'; import { keccakAsU8a } from '@polkadot/util-crypto'; diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index a73c967b3f..45b8547832 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-var-requires */ -import { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types'; -import { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types'; +import type { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types'; +import type { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types'; import { Metadata, extrinsicsFromMeta } from '@polkadot/metadata'; import { BN_ZERO, assert, assertReturn, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/create/types.ts b/packages/types/src/create/types.ts index e593dc335e..c2521288d0 100644 --- a/packages/types/src/create/types.ts +++ b/packages/types/src/create/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec, InterfaceTypes } from '../types'; +import type { Codec, InterfaceTypes } from '../types'; // Type which says: if `K` is in the InterfaceTypes, then return InterfaceTypes[K], else fallback to T export type FromReg = K extends keyof InterfaceTypes diff --git a/packages/types/src/ethereum/AccountId.ts b/packages/types/src/ethereum/AccountId.ts index ee0aa4bb73..9432eafb05 100644 --- a/packages/types/src/ethereum/AccountId.ts +++ b/packages/types/src/ethereum/AccountId.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyString, AnyU8a, Registry } from '../types'; +import type { AnyString, AnyU8a, Registry } from '../types'; import { hexToU8a, isHex, isString, isU8a, u8aToU8a } from '@polkadot/util'; import { ethereumEncode, isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/types/src/ethereum/LookupSource.ts b/packages/types/src/ethereum/LookupSource.ts index a5c21bda46..62b96c19e4 100644 --- a/packages/types/src/ethereum/LookupSource.ts +++ b/packages/types/src/ethereum/LookupSource.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import BN from 'bn.js'; import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index ebcce58659..d4c50995df 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { FunctionMetadataLatest } from '../interfaces/metadata/types'; -import { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; -import { Address, Balance, Call, Index } from '../interfaces/runtime'; -import { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types'; +import type { FunctionMetadataLatest } from '../interfaces/metadata/types'; +import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; +import type { Address, Balance, Call, Index } from '../interfaces/runtime'; +import type { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types'; import { assert, compactAddLength, compactFromU8a, isHex, isU8a, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/ExtrinsicEra.ts b/packages/types/src/extrinsic/ExtrinsicEra.ts index aae16beb88..bbfe45d8e1 100644 --- a/packages/types/src/extrinsic/ExtrinsicEra.ts +++ b/packages/types/src/extrinsic/ExtrinsicEra.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyU8a, IExtrinsicEra, Registry } from '../types'; +import type { AnyU8a, IExtrinsicEra, Registry } from '../types'; import BN from 'bn.js'; import { assert, bnToBn, formatNumber, hexToU8a, isHex, isU8a, isObject, u8aToBn, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.ts b/packages/types/src/extrinsic/ExtrinsicPayload.ts index 2deac4cb29..ebb1ad97a9 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ExtrinsicPayloadV4 } from '../interfaces/extrinsics'; -import { Balance, Hash, Index } from '../interfaces/runtime'; -import { AnyJson, BareOpts, ExtrinsicPayloadValue, IKeyringPair, InterfaceTypes, Registry } from '../types'; +import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics'; +import type { Balance, Hash, Index } from '../interfaces/runtime'; +import type { AnyJson, BareOpts, ExtrinsicPayloadValue, IKeyringPair, InterfaceTypes, Registry } from '../types'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts b/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts index 5655fb739c..cbf66db237 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; -import { ExtrinsicPayloadOptions } from './types'; +import type { Registry } from '../types'; +import type { ExtrinsicPayloadOptions } from './types'; import { Struct } from '../codec/Struct'; diff --git a/packages/types/src/extrinsic/ExtrinsicUnknown.ts b/packages/types/src/extrinsic/ExtrinsicUnknown.ts index 53624ecc37..6519687cdb 100644 --- a/packages/types/src/extrinsic/ExtrinsicUnknown.ts +++ b/packages/types/src/extrinsic/ExtrinsicUnknown.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; -import { ExtrinsicOptions } from './types'; +import type { Registry } from '../types'; +import type { ExtrinsicOptions } from './types'; import { Struct } from '../codec/Struct'; import { UNMASK_VERSION } from './constants'; diff --git a/packages/types/src/extrinsic/SignerPayload.ts b/packages/types/src/extrinsic/SignerPayload.ts index 244fc554fb..2d891125b8 100644 --- a/packages/types/src/extrinsic/SignerPayload.ts +++ b/packages/types/src/extrinsic/SignerPayload.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces'; -import { Codec, Constructor, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types'; +import type { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces'; +import type { Codec, Constructor, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/signedExtensions/index.ts b/packages/types/src/extrinsic/signedExtensions/index.ts index 924caec534..1e281a2e31 100644 --- a/packages/types/src/extrinsic/signedExtensions/index.ts +++ b/packages/types/src/extrinsic/signedExtensions/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ExtDef, ExtInfo, ExtTypes } from './types'; +import type { ExtDef, ExtInfo, ExtTypes } from './types'; import polkadotExtensions from './polkadot'; import substrateExtensions from './substrate'; diff --git a/packages/types/src/extrinsic/signedExtensions/polkadot.ts b/packages/types/src/extrinsic/signedExtensions/polkadot.ts index da2284a179..69587a8ad0 100644 --- a/packages/types/src/extrinsic/signedExtensions/polkadot.ts +++ b/packages/types/src/extrinsic/signedExtensions/polkadot.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ExtDef } from './types'; +import type { ExtDef } from './types'; import { emptyCheck } from './emptyCheck'; diff --git a/packages/types/src/extrinsic/signedExtensions/substrate.ts b/packages/types/src/extrinsic/signedExtensions/substrate.ts index 5f2cce9c42..dd33928ff6 100644 --- a/packages/types/src/extrinsic/signedExtensions/substrate.ts +++ b/packages/types/src/extrinsic/signedExtensions/substrate.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ExtDef } from './types'; +import type { ExtDef } from './types'; import { emptyCheck } from './emptyCheck'; diff --git a/packages/types/src/extrinsic/signedExtensions/types.ts b/packages/types/src/extrinsic/signedExtensions/types.ts index 470b9d338e..8774aaa8e4 100644 --- a/packages/types/src/extrinsic/signedExtensions/types.ts +++ b/packages/types/src/extrinsic/signedExtensions/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { InterfaceTypes } from '../../types'; +import type { InterfaceTypes } from '../../types'; export type ExtTypes = Record; diff --git a/packages/types/src/extrinsic/types.ts b/packages/types/src/extrinsic/types.ts index b2fdc83683..24878c0a8a 100644 --- a/packages/types/src/extrinsic/types.ts +++ b/packages/types/src/extrinsic/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber } from '../types'; +import type { AnyNumber } from '../types'; export interface ExtrinsicOptions { isSigned: boolean; diff --git a/packages/types/src/extrinsic/util.ts b/packages/types/src/extrinsic/util.ts index 795fdd27cc..922ab06975 100644 --- a/packages/types/src/extrinsic/util.ts +++ b/packages/types/src/extrinsic/util.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SignOptions } from '@polkadot/keyring/types'; -import { IKeyringPair, Registry } from '../types'; +import type { SignOptions } from '@polkadot/keyring/types'; +import type { IKeyringPair, Registry } from '../types'; // a helper function for both types of payloads, Raw and metadata-known export function sign (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array { diff --git a/packages/types/src/extrinsic/v4/Extrinsic.ts b/packages/types/src/extrinsic/v4/Extrinsic.ts index d66df92813..656b28ba8e 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics'; -import { Address, Call } from '../../interfaces/runtime'; -import { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types'; -import { ExtrinsicOptions } from '../types'; +import type { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics'; +import type { Address, Call } from '../../interfaces/runtime'; +import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types'; +import type { ExtrinsicOptions } from '../types'; import { isU8a } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts index 9c1fde3fb4..6bf717e386 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SignOptions } from '@polkadot/keyring/types'; -import { ExtrinsicEra } from '../../interfaces/extrinsics'; -import { Balance, Hash, Index } from '../../interfaces/runtime'; -import { ExtrinsicPayloadValue, IKeyringPair, Registry } from '../../types'; +import type { SignOptions } from '@polkadot/keyring/types'; +import type { ExtrinsicEra } from '../../interfaces/extrinsics'; +import type { Balance, Hash, Index } from '../../interfaces/runtime'; +import type { ExtrinsicPayloadValue, IKeyringPair, Registry } from '../../types'; import { Compact } from '../../codec/Compact'; import { Enum } from '../../codec/Enum'; diff --git a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts index d868769d36..76bafba640 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics'; -import { Address, Balance, Call, Index } from '../../interfaces/runtime'; -import { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types'; -import { ExtrinsicSignatureOptions } from '../types'; +import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics'; +import type { Address, Balance, Call, Index } from '../../interfaces/runtime'; +import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types'; +import type { ExtrinsicSignatureOptions } from '../types'; import { u8aConcat } from '@polkadot/util'; diff --git a/packages/types/src/generic/AccountId.ts b/packages/types/src/generic/AccountId.ts index 29bec71be6..63baa38ff8 100644 --- a/packages/types/src/generic/AccountId.ts +++ b/packages/types/src/generic/AccountId.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyString, AnyU8a, Registry } from '../types'; +import type { AnyString, AnyU8a, Registry } from '../types'; import { hexToU8a, isHex, isString, isU8a, u8aToU8a, assert } from '@polkadot/util'; import { decodeAddress, encodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/types/src/generic/AccountIndex.ts b/packages/types/src/generic/AccountIndex.ts index f071ee024f..3e9cba2207 100644 --- a/packages/types/src/generic/AccountIndex.ts +++ b/packages/types/src/generic/AccountIndex.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyNumber, Registry } from '../types'; +import type { AnyNumber, Registry } from '../types'; import BN from 'bn.js'; import { bnToBn, isBn, isBigInt, isNumber, isU8a, isHex } from '@polkadot/util'; diff --git a/packages/types/src/generic/Block.ts b/packages/types/src/generic/Block.ts index 6f89ec8588..16a0540b5f 100644 --- a/packages/types/src/generic/Block.ts +++ b/packages/types/src/generic/Block.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Digest, DigestItem, H256, Header } from '../interfaces/runtime'; -import { AnyNumber, AnyU8a, Registry } from '../types'; +import type { Digest, DigestItem, H256, Header } from '../interfaces/runtime'; +import type { AnyNumber, AnyU8a, Registry } from '../types'; import { GenericExtrinsic } from '../extrinsic/Extrinsic'; import { Struct } from '../codec/Struct'; diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index 477528ac28..e6d0be27e1 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { FunctionArgumentMetadataLatest, FunctionMetadataLatest } from '../interfaces/metadata'; -import { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } from '../types'; +import type { FunctionArgumentMetadataLatest, FunctionMetadataLatest } from '../interfaces/metadata'; +import type { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } from '../types'; import { isHex, isObject, isU8a, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/generic/Event.ts b/packages/types/src/generic/Event.ts index 4a56137258..64bb07d143 100644 --- a/packages/types/src/generic/Event.ts +++ b/packages/types/src/generic/Event.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDef } from '../create/types'; -import { EventMetadataLatest } from '../interfaces/metadata'; -import { EventId } from '../interfaces/system'; -import { AnyJson, Constructor, Registry, RegistryMetadataEvent } from '../types'; +import type { TypeDef } from '../create/types'; +import type { EventMetadataLatest } from '../interfaces/metadata'; +import type { EventId } from '../interfaces/system'; +import type { AnyJson, Constructor, Registry, RegistryMetadataEvent } from '../types'; import { Struct } from '../codec/Struct'; import { Tuple } from '../codec/Tuple'; diff --git a/packages/types/src/generic/LookupSource.ts b/packages/types/src/generic/LookupSource.ts index f9970267b0..69d80e4a3c 100644 --- a/packages/types/src/generic/LookupSource.ts +++ b/packages/types/src/generic/LookupSource.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import BN from 'bn.js'; import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util'; diff --git a/packages/types/src/generic/MultiAddress.ts b/packages/types/src/generic/MultiAddress.ts index d0ca654b27..dd83a6c1fc 100644 --- a/packages/types/src/generic/MultiAddress.ts +++ b/packages/types/src/generic/MultiAddress.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import { isBn, isNumber, isString, isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/types/src/generic/Vote.ts b/packages/types/src/generic/Vote.ts index 9df2b80210..9ff9c9b89e 100644 --- a/packages/types/src/generic/Vote.ts +++ b/packages/types/src/generic/Vote.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyJson, ArrayElementType, Registry } from '../types'; -import { AllConvictions } from '../interfaces/democracy/definitions'; -import { Conviction } from '../interfaces/democracy'; +import type { AnyJson, ArrayElementType, Registry } from '../types'; +import type { AllConvictions } from '../interfaces/democracy/definitions'; +import type { Conviction } from '../interfaces/democracy'; import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/index.spec.ts b/packages/types/src/index.spec.ts index b07d10556e..93cc4b7b11 100644 --- a/packages/types/src/index.spec.ts +++ b/packages/types/src/index.spec.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Codec } from './types'; + import { Metadata } from '@polkadot/metadata'; import metadataStatic from '@polkadot/metadata/static'; import { createTypeUnsafe, TypeRegistry } from './create'; -import { Codec } from './types'; import * as exported from './index.types'; import * as definitions from './interfaces/definitions'; diff --git a/packages/types/src/interfaces/attestations/definitions.ts b/packages/types/src/interfaces/attestations/definitions.ts index 4bd05729ce..554884c61d 100644 --- a/packages/types/src/interfaces/attestations/definitions.ts +++ b/packages/types/src/interfaces/attestations/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/aura/definitions.ts b/packages/types/src/interfaces/aura/definitions.ts index 46f041d2ea..47a77a9ef9 100644 --- a/packages/types/src/interfaces/aura/definitions.ts +++ b/packages/types/src/interfaces/aura/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/author/definitions.ts b/packages/types/src/interfaces/author/definitions.ts index 9faba330b1..92604ce972 100644 --- a/packages/types/src/interfaces/author/definitions.ts +++ b/packages/types/src/interfaces/author/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/authorship/definitions.ts b/packages/types/src/interfaces/authorship/definitions.ts index 6367255b05..2a2866feb4 100644 --- a/packages/types/src/interfaces/authorship/definitions.ts +++ b/packages/types/src/interfaces/authorship/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/babe/definitions.ts b/packages/types/src/interfaces/babe/definitions.ts index 14af1794b3..3998d7e3f4 100644 --- a/packages/types/src/interfaces/babe/definitions.ts +++ b/packages/types/src/interfaces/babe/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/balances/definitions.ts b/packages/types/src/interfaces/balances/definitions.ts index 5e8a3f9870..817f9862e8 100644 --- a/packages/types/src/interfaces/balances/definitions.ts +++ b/packages/types/src/interfaces/balances/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/chain/definitions.ts b/packages/types/src/interfaces/chain/definitions.ts index dec29b1ae6..f0e876fe03 100644 --- a/packages/types/src/interfaces/chain/definitions.ts +++ b/packages/types/src/interfaces/chain/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/childstate/definitions.ts b/packages/types/src/interfaces/childstate/definitions.ts index ef73bb9dc2..7b19e1c8f8 100644 --- a/packages/types/src/interfaces/childstate/definitions.ts +++ b/packages/types/src/interfaces/childstate/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/claims/definitions.ts b/packages/types/src/interfaces/claims/definitions.ts index 8e3b3e06f6..246ce1fef6 100644 --- a/packages/types/src/interfaces/claims/definitions.ts +++ b/packages/types/src/interfaces/claims/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/collective/definitions.ts b/packages/types/src/interfaces/collective/definitions.ts index aa2dd49261..5634d93e7b 100644 --- a/packages/types/src/interfaces/collective/definitions.ts +++ b/packages/types/src/interfaces/collective/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/consensus/definitions.ts b/packages/types/src/interfaces/consensus/definitions.ts index cdf6f92f70..1adfc0e7f9 100644 --- a/packages/types/src/interfaces/consensus/definitions.ts +++ b/packages/types/src/interfaces/consensus/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/contracts/definitions.ts b/packages/types/src/interfaces/contracts/definitions.ts index 021eac0912..e448ab39d7 100644 --- a/packages/types/src/interfaces/contracts/definitions.ts +++ b/packages/types/src/interfaces/contracts/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/contractsAbi/definitions.ts b/packages/types/src/interfaces/contractsAbi/definitions.ts index b9381a72df..29e7ebb7d7 100644 --- a/packages/types/src/interfaces/contractsAbi/definitions.ts +++ b/packages/types/src/interfaces/contractsAbi/definitions.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; // order important in structs... :) /* eslint-disable sort-keys */ diff --git a/packages/types/src/interfaces/democracy/definitions.ts b/packages/types/src/interfaces/democracy/definitions.ts index d17b509df0..4e0f5c84fe 100644 --- a/packages/types/src/interfaces/democracy/definitions.ts +++ b/packages/types/src/interfaces/democracy/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; const AllConvictions = [ // 0.1x votes, unlocked. diff --git a/packages/types/src/interfaces/elections/definitions.ts b/packages/types/src/interfaces/elections/definitions.ts index c419139dad..ad3bbcd3b3 100644 --- a/packages/types/src/interfaces/elections/definitions.ts +++ b/packages/types/src/interfaces/elections/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/engine/definitions.ts b/packages/types/src/interfaces/engine/definitions.ts index 395addc3a4..77ecbb09e8 100644 --- a/packages/types/src/interfaces/engine/definitions.ts +++ b/packages/types/src/interfaces/engine/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/ethereum/definitions.ts b/packages/types/src/interfaces/ethereum/definitions.ts index 4a97f4ae4d..6ced443030 100644 --- a/packages/types/src/interfaces/ethereum/definitions.ts +++ b/packages/types/src/interfaces/ethereum/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/evm/definitions.ts b/packages/types/src/interfaces/evm/definitions.ts index c1ffa2e67a..20569834a7 100644 --- a/packages/types/src/interfaces/evm/definitions.ts +++ b/packages/types/src/interfaces/evm/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/extrinsics/definitions.ts b/packages/types/src/interfaces/extrinsics/definitions.ts index 76cfcf5c89..d0101470e2 100644 --- a/packages/types/src/interfaces/extrinsics/definitions.ts +++ b/packages/types/src/interfaces/extrinsics/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/genericAsset/definitions.ts b/packages/types/src/interfaces/genericAsset/definitions.ts index 4530eaa1a4..96408a9afb 100644 --- a/packages/types/src/interfaces/genericAsset/definitions.ts +++ b/packages/types/src/interfaces/genericAsset/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/grandpa/definitions.ts b/packages/types/src/interfaces/grandpa/definitions.ts index e75e7782fa..33cf0f50e8 100644 --- a/packages/types/src/interfaces/grandpa/definitions.ts +++ b/packages/types/src/interfaces/grandpa/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/identity/definitions.ts b/packages/types/src/interfaces/identity/definitions.ts index 88f93d7271..c898698250 100644 --- a/packages/types/src/interfaces/identity/definitions.ts +++ b/packages/types/src/interfaces/identity/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/imOnline/definitions.ts b/packages/types/src/interfaces/imOnline/definitions.ts index 79f453db3c..7dc69a5469 100644 --- a/packages/types/src/interfaces/imOnline/definitions.ts +++ b/packages/types/src/interfaces/imOnline/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/jsonrpc.ts b/packages/types/src/interfaces/jsonrpc.ts index 2f1bf892c9..ed4ec5efac 100644 --- a/packages/types/src/interfaces/jsonrpc.ts +++ b/packages/types/src/interfaces/jsonrpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DefinitionRpcExt, DefinitionRpcSub } from '../types'; +import type { DefinitionRpcExt, DefinitionRpcSub } from '../types'; import * as definitions from './definitions'; diff --git a/packages/types/src/interfaces/metadata/definitions.ts b/packages/types/src/interfaces/metadata/definitions.ts index c4ddf445a2..f3a57e4840 100644 --- a/packages/types/src/interfaces/metadata/definitions.ts +++ b/packages/types/src/interfaces/metadata/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; const AllHashers = { Blake2_128: null, // eslint-disable-line camelcase diff --git a/packages/types/src/interfaces/offchain/definitions.ts b/packages/types/src/interfaces/offchain/definitions.ts index ae98a47401..b57c2f33f5 100644 --- a/packages/types/src/interfaces/offchain/definitions.ts +++ b/packages/types/src/interfaces/offchain/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/offences/definitions.ts b/packages/types/src/interfaces/offences/definitions.ts index 977c988a74..cb2f2b470f 100644 --- a/packages/types/src/interfaces/offences/definitions.ts +++ b/packages/types/src/interfaces/offences/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index 584cee4ce1..796be67680 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; const SLOT_RANGE_COUNT = 10; diff --git a/packages/types/src/interfaces/payment/definitions.ts b/packages/types/src/interfaces/payment/definitions.ts index fe3a3801a2..082889c22a 100644 --- a/packages/types/src/interfaces/payment/definitions.ts +++ b/packages/types/src/interfaces/payment/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/poll/definitions.ts b/packages/types/src/interfaces/poll/definitions.ts index 1b6a426469..8446d94299 100644 --- a/packages/types/src/interfaces/poll/definitions.ts +++ b/packages/types/src/interfaces/poll/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/proxy/definitions.ts b/packages/types/src/interfaces/proxy/definitions.ts index 0aed0b9ec6..404eca4b86 100644 --- a/packages/types/src/interfaces/proxy/definitions.ts +++ b/packages/types/src/interfaces/proxy/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/purchase/definitions.ts b/packages/types/src/interfaces/purchase/definitions.ts index fef5ada1bd..0a636df003 100644 --- a/packages/types/src/interfaces/purchase/definitions.ts +++ b/packages/types/src/interfaces/purchase/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/recovery/definitions.ts b/packages/types/src/interfaces/recovery/definitions.ts index 27a71a26e7..3d856b056d 100644 --- a/packages/types/src/interfaces/recovery/definitions.ts +++ b/packages/types/src/interfaces/recovery/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/rpc/definitions.ts b/packages/types/src/interfaces/rpc/definitions.ts index 69831cd2e4..298cdeca9b 100644 --- a/packages/types/src/interfaces/rpc/definitions.ts +++ b/packages/types/src/interfaces/rpc/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 46db59f966..bba6904d6f 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; const numberTypes = { Fixed64: 'Int<64, Fixed64>', diff --git a/packages/types/src/interfaces/scaleInfo/definitions.ts b/packages/types/src/interfaces/scaleInfo/definitions.ts index fc20c1f8fd..bb2b5b0bdd 100644 --- a/packages/types/src/interfaces/scaleInfo/definitions.ts +++ b/packages/types/src/interfaces/scaleInfo/definitions.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; // order important in structs... :) /* eslint-disable sort-keys */ diff --git a/packages/types/src/interfaces/scheduler/definitions.ts b/packages/types/src/interfaces/scheduler/definitions.ts index 7f88269ecb..75f6a5a6a4 100644 --- a/packages/types/src/interfaces/scheduler/definitions.ts +++ b/packages/types/src/interfaces/scheduler/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/session/definitions.ts b/packages/types/src/interfaces/session/definitions.ts index 710b8beed7..132e39fb56 100644 --- a/packages/types/src/interfaces/session/definitions.ts +++ b/packages/types/src/interfaces/session/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; // The runtime definition of SessionKeys are passed as a Trait to session // Defined in `node/runtime/src/lib.rs` as follow diff --git a/packages/types/src/interfaces/society/definitions.ts b/packages/types/src/interfaces/society/definitions.ts index 9644575740..a960ede662 100644 --- a/packages/types/src/interfaces/society/definitions.ts +++ b/packages/types/src/interfaces/society/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/staking/definitions.ts b/packages/types/src/interfaces/staking/definitions.ts index ef29884e10..f20a90cc6d 100644 --- a/packages/types/src/interfaces/staking/definitions.ts +++ b/packages/types/src/interfaces/staking/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; const deprecated = { Points: 'u32', diff --git a/packages/types/src/interfaces/state/RuntimeVersion.spec.ts b/packages/types/src/interfaces/state/RuntimeVersion.spec.ts index b62aaff7a8..cd9734a9fb 100644 --- a/packages/types/src/interfaces/state/RuntimeVersion.spec.ts +++ b/packages/types/src/interfaces/state/RuntimeVersion.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { RuntimeVersion } from './types'; +import type { RuntimeVersion } from './types'; import { TypeRegistry } from '../../create'; import rpc from '../../json/RuntimeVersion.002.json'; diff --git a/packages/types/src/interfaces/state/definitions.ts b/packages/types/src/interfaces/state/definitions.ts index bd87c419fc..10682d4d7e 100644 --- a/packages/types/src/interfaces/state/definitions.ts +++ b/packages/types/src/interfaces/state/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/support/definitions.ts b/packages/types/src/interfaces/support/definitions.ts index 4f0a124e2f..f4921dc6de 100644 --- a/packages/types/src/interfaces/support/definitions.ts +++ b/packages/types/src/interfaces/support/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/syncstate/definitions.ts b/packages/types/src/interfaces/syncstate/definitions.ts index 58e36a3604..8649978f1b 100644 --- a/packages/types/src/interfaces/syncstate/definitions.ts +++ b/packages/types/src/interfaces/syncstate/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/system/definitions.ts b/packages/types/src/interfaces/system/definitions.ts index d38d5a8e90..c9793a779b 100644 --- a/packages/types/src/interfaces/system/definitions.ts +++ b/packages/types/src/interfaces/system/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: { diff --git a/packages/types/src/interfaces/treasury/definitions.ts b/packages/types/src/interfaces/treasury/definitions.ts index 342142a7d5..a975c772ce 100644 --- a/packages/types/src/interfaces/treasury/definitions.ts +++ b/packages/types/src/interfaces/treasury/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/txpayment/definitions.ts b/packages/types/src/interfaces/txpayment/definitions.ts index 415904fb6c..0347d9834d 100644 --- a/packages/types/src/interfaces/txpayment/definitions.ts +++ b/packages/types/src/interfaces/txpayment/definitions.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/utility/definitions.ts b/packages/types/src/interfaces/utility/definitions.ts index c9c0293ae1..52a4996f77 100644 --- a/packages/types/src/interfaces/utility/definitions.ts +++ b/packages/types/src/interfaces/utility/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/vesting/definitions.ts b/packages/types/src/interfaces/vesting/definitions.ts index bb9299a574..acdb1d93d5 100644 --- a/packages/types/src/interfaces/vesting/definitions.ts +++ b/packages/types/src/interfaces/vesting/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import { Definitions } from '../../types'; +import type { Definitions } from '../../types'; export default { rpc: {}, diff --git a/packages/types/src/primitive/BitVec.ts b/packages/types/src/primitive/BitVec.ts index 7531a54ec4..72cc0dc491 100644 --- a/packages/types/src/primitive/BitVec.ts +++ b/packages/types/src/primitive/BitVec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyU8a, Registry } from '../types'; +import type { AnyU8a, Registry } from '../types'; import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/primitive/Bool.spec.ts b/packages/types/src/primitive/Bool.spec.ts index ca2fdd6c33..85a4fa40e7 100644 --- a/packages/types/src/primitive/Bool.spec.ts +++ b/packages/types/src/primitive/Bool.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Bool } from '.'; diff --git a/packages/types/src/primitive/Bool.ts b/packages/types/src/primitive/Bool.ts index 4f245210e8..1d6cabaacb 100644 --- a/packages/types/src/primitive/Bool.ts +++ b/packages/types/src/primitive/Bool.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { Codec, Registry } from '../types'; import { isU8a, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/primitive/Bytes.ts b/packages/types/src/primitive/Bytes.ts index 61f1713be5..7f0def64ee 100644 --- a/packages/types/src/primitive/Bytes.ts +++ b/packages/types/src/primitive/Bytes.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyU8a, Registry } from '../types'; +import type { AnyU8a, Registry } from '../types'; import { assert, compactAddLength, compactFromU8a, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/primitive/Data.ts b/packages/types/src/primitive/Data.ts index 9efac56f70..8186538b42 100644 --- a/packages/types/src/primitive/Data.ts +++ b/packages/types/src/primitive/Data.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { Registry } from '../types'; import { isString, isU8a, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/primitive/DoNotConstruct.ts b/packages/types/src/primitive/DoNotConstruct.ts index ef46b59905..caa5e0b9ac 100644 --- a/packages/types/src/primitive/DoNotConstruct.ts +++ b/packages/types/src/primitive/DoNotConstruct.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor, Registry } from '../types'; +import type { Constructor, Registry } from '../types'; import { Null } from './Null'; diff --git a/packages/types/src/primitive/Null.ts b/packages/types/src/primitive/Null.ts index 605aeac90c..24b3c2ac25 100644 --- a/packages/types/src/primitive/Null.ts +++ b/packages/types/src/primitive/Null.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { Codec, Registry } from '../types'; import { isNull } from '@polkadot/util'; diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index baee026c63..ef12766b62 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata'; -import { AnyJson, AnyU8a, Codec, InterfaceTypes, Registry } from '../types'; -import { StorageEntry } from './types'; +import type { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata'; +import type { AnyJson, AnyU8a, Codec, InterfaceTypes, Registry } from '../types'; +import type { StorageEntry } from './types'; import { assert, isFunction, isString, isU8a } from '@polkadot/util'; -import { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; +import { AllHashers } from '../interfaces/metadata/definitions'; import { Bytes } from './Bytes'; interface Decoded { diff --git a/packages/types/src/primitive/Text.spec.ts b/packages/types/src/primitive/Text.spec.ts index c1d5b6e1b1..1c5fdcdcaf 100644 --- a/packages/types/src/primitive/Text.spec.ts +++ b/packages/types/src/primitive/Text.spec.ts @@ -1,7 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { CodecTo } from '../types'; +import type { CodecTo } from '../types'; + import { TypeRegistry } from '../create'; import { Raw } from '../codec/Raw'; import { Text } from '.'; diff --git a/packages/types/src/primitive/Text.ts b/packages/types/src/primitive/Text.ts index b1bd60293d..20dcd43e98 100644 --- a/packages/types/src/primitive/Text.ts +++ b/packages/types/src/primitive/Text.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyU8a, Codec, Registry } from '../types'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyU8a, Codec, Registry } from '../types'; import { assert, hexToU8a, isHex, isString, stringToU8a, u8aToString, u8aToHex, compactFromU8a, compactAddLength } from '@polkadot/util'; diff --git a/packages/types/src/primitive/Type.ts b/packages/types/src/primitive/Type.ts index fed72fcfbf..45aee3bb12 100644 --- a/packages/types/src/primitive/Type.ts +++ b/packages/types/src/primitive/Type.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import { sanitize } from '../create/sanitize'; import { Text } from '.'; diff --git a/packages/types/src/primitive/USize.ts b/packages/types/src/primitive/USize.ts index cf0034e367..6cbdd9c1d2 100644 --- a/packages/types/src/primitive/USize.ts +++ b/packages/types/src/primitive/USize.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Registry } from '../types'; +import type { Registry } from '../types'; import { u32 } from './U32'; diff --git a/packages/types/src/primitive/types.ts b/packages/types/src/primitive/types.ts index b11ef91fa9..51655df37f 100644 --- a/packages/types/src/primitive/types.ts +++ b/packages/types/src/primitive/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntryMetadataLatest } from '../interfaces/metadata'; -import { Codec } from '../types'; +import type { StorageEntryMetadataLatest } from '../interfaces/metadata'; +import type { Codec } from '../types'; export interface StorageEntry { (arg?: any): Uint8Array;