From af71673c7bf2658ff4469f4a10c090fb9df4aa1a Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 1 Dec 2020 13:24:37 +0100 Subject: [PATCH] import type (#782) --- packages/keyring/src/keyring.ts | 4 ++-- packages/keyring/src/pair/decode.ts | 4 ++-- packages/keyring/src/pair/defaults.ts | 2 +- packages/keyring/src/pair/encode.ts | 2 +- packages/keyring/src/pair/index.ts | 6 +++--- packages/keyring/src/pair/nobody.ts | 2 +- packages/keyring/src/pair/toJson.ts | 4 ++-- packages/keyring/src/pairs.ts | 2 +- packages/keyring/src/testing.ts | 2 +- packages/keyring/src/testingPairs.ts | 2 +- packages/keyring/src/types.ts | 4 ++-- packages/networks/src/crosscheck.spec.ts | 2 +- packages/networks/src/index.ts | 2 +- packages/util-crypto/src/address/check.ts | 2 +- packages/util-crypto/src/address/decode.ts | 2 +- packages/util-crypto/src/address/derive.ts | 2 +- packages/util-crypto/src/address/encode.ts | 2 +- packages/util-crypto/src/address/encodeDerived.ts | 2 +- packages/util-crypto/src/address/encodeMulti.ts | 2 +- packages/util-crypto/src/address/evmToAddress.ts | 4 ++-- packages/util-crypto/src/address/setSS58Format.ts | 2 +- packages/util-crypto/src/address/sort.ts | 2 +- packages/util-crypto/src/key/fromPath.ts | 2 +- packages/util-crypto/src/key/hdkdEcdsa.ts | 2 +- packages/util-crypto/src/key/hdkdEd25519.ts | 2 +- packages/util-crypto/src/key/hdkdSr25519.ts | 2 +- packages/util-crypto/src/nacl/box/fromSecret.ts | 2 +- packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts | 2 +- packages/util-crypto/src/nacl/keypair/fromRandom.ts | 2 +- packages/util-crypto/src/nacl/keypair/fromSecret.ts | 2 +- packages/util-crypto/src/nacl/keypair/fromSeed.ts | 2 +- packages/util-crypto/src/nacl/keypair/fromString.ts | 2 +- packages/util-crypto/src/nacl/sign.ts | 2 +- packages/util-crypto/src/schnorrkel/deriveHard.ts | 2 +- packages/util-crypto/src/schnorrkel/deriveSoft.ts | 2 +- packages/util-crypto/src/schnorrkel/keypair/fromSeed.ts | 2 +- packages/util-crypto/src/schnorrkel/keypair/fromU8a.ts | 2 +- packages/util-crypto/src/schnorrkel/keypair/toU8a.ts | 2 +- packages/util-crypto/src/schnorrkel/sign.ts | 2 +- packages/util-crypto/src/scrypt/encode.ts | 2 +- packages/util-crypto/src/scrypt/fromU8a.ts | 2 +- packages/util-crypto/src/scrypt/toU8a.ts | 2 +- packages/util-crypto/src/secp256k1/hasher.ts | 2 +- packages/util-crypto/src/secp256k1/keypair/fromSeed.ts | 2 +- packages/util-crypto/src/secp256k1/sign.ts | 4 ++-- packages/util-crypto/src/secp256k1/verify.ts | 2 +- packages/util-crypto/src/signature/verify.ts | 2 +- packages/util/src/bn/toBn.ts | 2 +- packages/util/src/bn/toHex.ts | 2 +- packages/util/src/bn/toU8a.ts | 2 +- packages/util/src/compact/defaults.ts | 2 +- packages/util/src/compact/fromU8a.ts | 2 +- packages/util/src/compact/stripLength.ts | 2 +- packages/util/src/extractTime.ts | 2 +- packages/util/src/format/formatBalance.ts | 2 +- packages/util/src/format/formatElapsed.ts | 2 +- packages/util/src/format/formatNumber.ts | 2 +- packages/util/src/format/si.ts | 2 +- packages/util/src/hex/toBn.ts | 3 ++- packages/util/src/is/childClass.ts | 2 +- packages/util/src/is/toBn.ts | 2 +- packages/util/src/logger.spec.ts | 2 +- packages/util/src/logger.ts | 2 +- packages/util/src/u8a/toBn.ts | 3 ++- 64 files changed, 74 insertions(+), 72 deletions(-) diff --git a/packages/keyring/src/keyring.ts b/packages/keyring/src/keyring.ts index 602019be0..d5e2a6e43 100644 --- a/packages/keyring/src/keyring.ts +++ b/packages/keyring/src/keyring.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeypairType, Keypair } from '@polkadot/util-crypto/types'; -import { KeyringInstance, KeyringPair, KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta, KeyringOptions } from './types'; +import type { KeypairType, Keypair } from '@polkadot/util-crypto/types'; +import type { KeyringInstance, KeyringPair, KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta, KeyringOptions } from './types'; import { assert, hexToU8a, isHex, isUndefined, stringToU8a } from '@polkadot/util'; import { base64Decode, decodeAddress, encodeAddress, keyExtractSuri, keyFromPath, naclKeypairFromSeed as naclFromSeed, schnorrkelKeypairFromSeed as schnorrkelFromSeed, secp256k1KeypairFromSeed as secp256k1FromSeed, mnemonicToLegacySeed, mnemonicToMiniSecret } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pair/decode.ts b/packages/keyring/src/pair/decode.ts index 56251bdb7..900c98a8a 100644 --- a/packages/keyring/src/pair/decode.ts +++ b/packages/keyring/src/pair/decode.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringPair$JsonEncodingTypes } from '../types'; -import { PairInfo } from './types'; +import type { KeyringPair$JsonEncodingTypes } from '../types'; +import type { PairInfo } from './types'; import { assert, stringToU8a, u8aFixLength } from '@polkadot/util'; import { naclDecrypt, scryptEncode, scryptFromU8a } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pair/defaults.ts b/packages/keyring/src/pair/defaults.ts index e7b47d38b..e0290dec0 100644 --- a/packages/keyring/src/pair/defaults.ts +++ b/packages/keyring/src/pair/defaults.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringPair$JsonEncodingTypes } from '../types'; +import type { KeyringPair$JsonEncodingTypes } from '../types'; const ENCODING: KeyringPair$JsonEncodingTypes[] = ['scrypt', 'xsalsa20-poly1305']; const NONCE_LENGTH = 24; diff --git a/packages/keyring/src/pair/encode.ts b/packages/keyring/src/pair/encode.ts index e60279dd9..172641995 100644 --- a/packages/keyring/src/pair/encode.ts +++ b/packages/keyring/src/pair/encode.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { PairInfo } from './types'; +import type { PairInfo } from './types'; import { u8aConcat, assert } from '@polkadot/util'; import { naclEncrypt, scryptEncode, scryptToU8a } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pair/index.ts b/packages/keyring/src/pair/index.ts index 35119c200..81268d677 100644 --- a/packages/keyring/src/pair/index.ts +++ b/packages/keyring/src/pair/index.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair, KeypairType } from '@polkadot/util-crypto/types'; -import { KeyringPair, KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta, SignOptions } from '../types'; -import { PairInfo } from './types'; +import type { Keypair, KeypairType } from '@polkadot/util-crypto/types'; +import type { KeyringPair, KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta, SignOptions } from '../types'; +import type { PairInfo } from './types'; import { assert, u8aConcat, u8aToHex } from '@polkadot/util'; import { blake2AsU8a, ethereumEncode, keccakAsU8a, keyExtractPath, keyFromPath, naclKeypairFromSeed as naclFromSeed, naclSign, schnorrkelKeypairFromSeed as schnorrkelFromSeed, schnorrkelSign, secp256k1Expand, secp256k1KeypairFromSeed as secp256k1FromSeed, secp256k1Sign, secp256k1Compress, signatureVerify } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pair/nobody.ts b/packages/keyring/src/pair/nobody.ts index 4ca904f06..4c0b89ede 100644 --- a/packages/keyring/src/pair/nobody.ts +++ b/packages/keyring/src/pair/nobody.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '../types'; +import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '../types'; import { encodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pair/toJson.ts b/packages/keyring/src/pair/toJson.ts index e518c512a..cff1148b7 100644 --- a/packages/keyring/src/pair/toJson.ts +++ b/packages/keyring/src/pair/toJson.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeypairType } from '@polkadot/util-crypto/types'; -import { KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta } from '../types'; +import type { KeypairType } from '@polkadot/util-crypto/types'; +import type { KeyringPair$Json, KeyringPair$JsonEncodingTypes, KeyringPair$Meta } from '../types'; import { base64Encode } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/pairs.ts b/packages/keyring/src/pairs.ts index 3b900f0dc..0b6dcd65a 100644 --- a/packages/keyring/src/pairs.ts +++ b/packages/keyring/src/pairs.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringPairs, KeyringPair } from './types'; +import type { KeyringPairs, KeyringPair } from './types'; import { assert, isHex, isU8a, u8aToHex, u8aToU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/keyring/src/testing.ts b/packages/keyring/src/testing.ts index bdccbd80e..5d090455e 100644 --- a/packages/keyring/src/testing.ts +++ b/packages/keyring/src/testing.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringInstance, KeyringOptions } from './types'; +import type { KeyringInstance, KeyringOptions } from './types'; import { hexToU8a } from '@polkadot/util'; diff --git a/packages/keyring/src/testingPairs.ts b/packages/keyring/src/testingPairs.ts index 1b9418c4f..49a699ecd 100644 --- a/packages/keyring/src/testingPairs.ts +++ b/packages/keyring/src/testingPairs.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeyringPair, KeyringOptions } from './types'; +import type { KeyringPair, KeyringOptions } from './types'; import { createTestKeyring } from './testing'; import { nobody } from './pair/nobody'; diff --git a/packages/keyring/src/types.ts b/packages/keyring/src/types.ts index 543fd60a2..e313edb2e 100644 --- a/packages/keyring/src/types.ts +++ b/packages/keyring/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from '@polkadot/util-crypto/address/types'; -import { KeypairType } from '@polkadot/util-crypto/types'; +import type { Prefix } from '@polkadot/util-crypto/address/types'; +import type { KeypairType } from '@polkadot/util-crypto/types'; export interface KeyringOptions { ss58Format?: Prefix; diff --git a/packages/networks/src/crosscheck.spec.ts b/packages/networks/src/crosscheck.spec.ts index d22a7659c..99dcb458e 100644 --- a/packages/networks/src/crosscheck.spec.ts +++ b/packages/networks/src/crosscheck.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/networks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Ss58Registry } from './types'; +import type { Ss58Registry } from './types'; import fs from 'fs'; import fetch from '@polkadot/x-fetch'; diff --git a/packages/networks/src/index.ts b/packages/networks/src/index.ts index 5e0a6e3a1..17f1620cd 100644 --- a/packages/networks/src/index.ts +++ b/packages/networks/src/index.ts @@ -6,7 +6,7 @@ // // Once the above is published as a package, the duplication here can be removed -import { Network, NetworkFromSubstrate } from './types'; +import type { Network, NetworkFromSubstrate } from './types'; // These are known prefixes that are not sorted const UNSORTED = [0, 2, 42]; diff --git a/packages/util-crypto/src/address/check.ts b/packages/util-crypto/src/address/check.ts index 29852d792..19a58d0b7 100644 --- a/packages/util-crypto/src/address/check.ts +++ b/packages/util-crypto/src/address/check.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import { base58Decode } from '../base58/decode'; import { checkAddressChecksum } from './checksum'; diff --git a/packages/util-crypto/src/address/decode.ts b/packages/util-crypto/src/address/decode.ts index bcd3b0668..ef3c24781 100644 --- a/packages/util-crypto/src/address/decode.ts +++ b/packages/util-crypto/src/address/decode.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; // Original implementation: https://github.com/paritytech/polka-ui/blob/4858c094684769080f5811f32b081dd7780b0880/src/polkadot.js#L6 diff --git a/packages/util-crypto/src/address/derive.ts b/packages/util-crypto/src/address/derive.ts index 95b034807..7352975ed 100644 --- a/packages/util-crypto/src/address/derive.ts +++ b/packages/util-crypto/src/address/derive.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import { assert } from '@polkadot/util'; diff --git a/packages/util-crypto/src/address/encode.ts b/packages/util-crypto/src/address/encode.ts index 6352df867..7117d1c9c 100644 --- a/packages/util-crypto/src/address/encode.ts +++ b/packages/util-crypto/src/address/encode.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; // Original implementation: https://github.com/paritytech/polka-ui/blob/4858c094684769080f5811f32b081dd7780b0880/src/polkadot.js#L34 diff --git a/packages/util-crypto/src/address/encodeDerived.ts b/packages/util-crypto/src/address/encodeDerived.ts index 572a71013..579315567 100644 --- a/packages/util-crypto/src/address/encodeDerived.ts +++ b/packages/util-crypto/src/address/encodeDerived.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import BN from 'bn.js'; diff --git a/packages/util-crypto/src/address/encodeMulti.ts b/packages/util-crypto/src/address/encodeMulti.ts index 174ae70a9..3c3490c64 100644 --- a/packages/util-crypto/src/address/encodeMulti.ts +++ b/packages/util-crypto/src/address/encodeMulti.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import BN from 'bn.js'; diff --git a/packages/util-crypto/src/address/evmToAddress.ts b/packages/util-crypto/src/address/evmToAddress.ts index ec768b72b..af2af921c 100644 --- a/packages/util-crypto/src/address/evmToAddress.ts +++ b/packages/util-crypto/src/address/evmToAddress.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { HashType } from '../secp256k1/types'; +import type { Prefix } from './types'; import { u8aConcat } from '@polkadot/util'; import { secp256k1Hasher } from '../secp256k1/hasher'; -import { HashType } from '../secp256k1/types'; import { encodeAddress } from './encode'; /** diff --git a/packages/util-crypto/src/address/setSS58Format.ts b/packages/util-crypto/src/address/setSS58Format.ts index c67461cea..fcbdc02a2 100644 --- a/packages/util-crypto/src/address/setSS58Format.ts +++ b/packages/util-crypto/src/address/setSS58Format.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import { defaults } from './defaults'; diff --git a/packages/util-crypto/src/address/sort.ts b/packages/util-crypto/src/address/sort.ts index a9eab1ff7..bb9f1ca9f 100644 --- a/packages/util-crypto/src/address/sort.ts +++ b/packages/util-crypto/src/address/sort.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Prefix } from './types'; +import type { Prefix } from './types'; import { u8aSorted } from '@polkadot/util'; diff --git a/packages/util-crypto/src/key/fromPath.ts b/packages/util-crypto/src/key/fromPath.ts index 88f60d16a..7fa718044 100644 --- a/packages/util-crypto/src/key/fromPath.ts +++ b/packages/util-crypto/src/key/fromPath.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeypairType, Keypair } from '../types'; +import type { KeypairType, Keypair } from '../types'; import { DeriveJunction } from './DeriveJunction'; import { keyHdkdEd25519 } from './hdkdEd25519'; diff --git a/packages/util-crypto/src/key/hdkdEcdsa.ts b/packages/util-crypto/src/key/hdkdEcdsa.ts index 4f90537b7..47a937abe 100644 --- a/packages/util-crypto/src/key/hdkdEcdsa.ts +++ b/packages/util-crypto/src/key/hdkdEcdsa.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { assert } from '@polkadot/util'; diff --git a/packages/util-crypto/src/key/hdkdEd25519.ts b/packages/util-crypto/src/key/hdkdEd25519.ts index d15de50be..7b0bef222 100644 --- a/packages/util-crypto/src/key/hdkdEd25519.ts +++ b/packages/util-crypto/src/key/hdkdEd25519.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { assert } from '@polkadot/util'; diff --git a/packages/util-crypto/src/key/hdkdSr25519.ts b/packages/util-crypto/src/key/hdkdSr25519.ts index 98c3a56e8..7adabc181 100644 --- a/packages/util-crypto/src/key/hdkdSr25519.ts +++ b/packages/util-crypto/src/key/hdkdSr25519.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { schnorrkelDeriveHard } from '../schnorrkel/deriveHard'; import { schnorrkelDeriveSoft } from '../schnorrkel/deriveSoft'; diff --git a/packages/util-crypto/src/nacl/box/fromSecret.ts b/packages/util-crypto/src/nacl/box/fromSecret.ts index 839676731..96ad842cc 100644 --- a/packages/util-crypto/src/nacl/box/fromSecret.ts +++ b/packages/util-crypto/src/nacl/box/fromSecret.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import * as nacl from 'tweetnacl'; diff --git a/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts b/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts index 0dec4e023..ccaa6f6f8 100644 --- a/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts +++ b/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import { naclKeypairFromRandom } from '..'; diff --git a/packages/util-crypto/src/nacl/keypair/fromRandom.ts b/packages/util-crypto/src/nacl/keypair/fromRandom.ts index c58c47d20..d2cfac09b 100644 --- a/packages/util-crypto/src/nacl/keypair/fromRandom.ts +++ b/packages/util-crypto/src/nacl/keypair/fromRandom.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import * as nacl from 'tweetnacl'; diff --git a/packages/util-crypto/src/nacl/keypair/fromSecret.ts b/packages/util-crypto/src/nacl/keypair/fromSecret.ts index 14c553249..f60977692 100644 --- a/packages/util-crypto/src/nacl/keypair/fromSecret.ts +++ b/packages/util-crypto/src/nacl/keypair/fromSecret.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import * as nacl from 'tweetnacl'; diff --git a/packages/util-crypto/src/nacl/keypair/fromSeed.ts b/packages/util-crypto/src/nacl/keypair/fromSeed.ts index f349e49f9..4fbabb342 100644 --- a/packages/util-crypto/src/nacl/keypair/fromSeed.ts +++ b/packages/util-crypto/src/nacl/keypair/fromSeed.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import * as nacl from 'tweetnacl'; import { isReady, ed25519KeypairFromSeed } from '@polkadot/wasm-crypto'; diff --git a/packages/util-crypto/src/nacl/keypair/fromString.ts b/packages/util-crypto/src/nacl/keypair/fromString.ts index 1f75dbeae..33556e837 100644 --- a/packages/util-crypto/src/nacl/keypair/fromString.ts +++ b/packages/util-crypto/src/nacl/keypair/fromString.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import { stringToU8a } from '@polkadot/util'; diff --git a/packages/util-crypto/src/nacl/sign.ts b/packages/util-crypto/src/nacl/sign.ts index e1292c742..a8a4e59bf 100644 --- a/packages/util-crypto/src/nacl/sign.ts +++ b/packages/util-crypto/src/nacl/sign.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import * as nacl from 'tweetnacl'; import { assert, u8aToU8a } from '@polkadot/util'; diff --git a/packages/util-crypto/src/schnorrkel/deriveHard.ts b/packages/util-crypto/src/schnorrkel/deriveHard.ts index 75b7e674e..bc7ee477c 100644 --- a/packages/util-crypto/src/schnorrkel/deriveHard.ts +++ b/packages/util-crypto/src/schnorrkel/deriveHard.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { sr25519DeriveKeypairHard } from '@polkadot/wasm-crypto'; diff --git a/packages/util-crypto/src/schnorrkel/deriveSoft.ts b/packages/util-crypto/src/schnorrkel/deriveSoft.ts index cb1c3e842..82af5f11e 100644 --- a/packages/util-crypto/src/schnorrkel/deriveSoft.ts +++ b/packages/util-crypto/src/schnorrkel/deriveSoft.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { sr25519DeriveKeypairSoft } from '@polkadot/wasm-crypto'; diff --git a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.ts b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.ts index 6bf998da7..50cec884f 100644 --- a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.ts +++ b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import { sr25519KeypairFromSeed } from '@polkadot/wasm-crypto'; diff --git a/packages/util-crypto/src/schnorrkel/keypair/fromU8a.ts b/packages/util-crypto/src/schnorrkel/keypair/fromU8a.ts index 54d7178b4..611ec32d5 100644 --- a/packages/util-crypto/src/schnorrkel/keypair/fromU8a.ts +++ b/packages/util-crypto/src/schnorrkel/keypair/fromU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; const SEC_LEN = 64; const PUB_LEN = 32; diff --git a/packages/util-crypto/src/schnorrkel/keypair/toU8a.ts b/packages/util-crypto/src/schnorrkel/keypair/toU8a.ts index 4aa12e0a3..1f8ac0d28 100644 --- a/packages/util-crypto/src/schnorrkel/keypair/toU8a.ts +++ b/packages/util-crypto/src/schnorrkel/keypair/toU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import { u8aConcat } from '@polkadot/util'; diff --git a/packages/util-crypto/src/schnorrkel/sign.ts b/packages/util-crypto/src/schnorrkel/sign.ts index 1defeeff6..fd8f90862 100644 --- a/packages/util-crypto/src/schnorrkel/sign.ts +++ b/packages/util-crypto/src/schnorrkel/sign.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; +import type { Keypair } from '../types'; import { assert, u8aToU8a } from '@polkadot/util'; import { sr25519Sign } from '@polkadot/wasm-crypto'; diff --git a/packages/util-crypto/src/scrypt/encode.ts b/packages/util-crypto/src/scrypt/encode.ts index ed0c753b2..b97818429 100644 --- a/packages/util-crypto/src/scrypt/encode.ts +++ b/packages/util-crypto/src/scrypt/encode.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Params } from './types'; +import type { Params } from './types'; import scryptsy from 'scryptsy'; import { bufferToU8a, u8aToBuffer, u8aToU8a } from '@polkadot/util'; diff --git a/packages/util-crypto/src/scrypt/fromU8a.ts b/packages/util-crypto/src/scrypt/fromU8a.ts index 3a970f186..9b31ce038 100644 --- a/packages/util-crypto/src/scrypt/fromU8a.ts +++ b/packages/util-crypto/src/scrypt/fromU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Params } from './types'; +import type { Params } from './types'; import { u8aToBn, assert } from '@polkadot/util'; diff --git a/packages/util-crypto/src/scrypt/toU8a.ts b/packages/util-crypto/src/scrypt/toU8a.ts index c73a58ebe..9bda79834 100644 --- a/packages/util-crypto/src/scrypt/toU8a.ts +++ b/packages/util-crypto/src/scrypt/toU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Params } from './types'; +import type { Params } from './types'; import { bnToU8a, u8aConcat } from '@polkadot/util'; diff --git a/packages/util-crypto/src/secp256k1/hasher.ts b/packages/util-crypto/src/secp256k1/hasher.ts index 4b258cef7..279b53623 100644 --- a/packages/util-crypto/src/secp256k1/hasher.ts +++ b/packages/util-crypto/src/secp256k1/hasher.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { HashType } from './types'; +import type { HashType } from './types'; import { blake2AsU8a } from '../blake2'; import { keccakAsU8a } from '../keccak'; diff --git a/packages/util-crypto/src/secp256k1/keypair/fromSeed.ts b/packages/util-crypto/src/secp256k1/keypair/fromSeed.ts index 34151370a..3dae9dee5 100644 --- a/packages/util-crypto/src/secp256k1/keypair/fromSeed.ts +++ b/packages/util-crypto/src/secp256k1/keypair/fromSeed.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../../types'; +import type { Keypair } from '../../types'; import { assert, bnToU8a } from '@polkadot/util'; diff --git a/packages/util-crypto/src/secp256k1/sign.ts b/packages/util-crypto/src/secp256k1/sign.ts index 31b369c41..6b2811c40 100644 --- a/packages/util-crypto/src/secp256k1/sign.ts +++ b/packages/util-crypto/src/secp256k1/sign.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Keypair } from '../types'; -import { HashType } from './types'; +import type { Keypair } from '../types'; +import type { HashType } from './types'; import { assert, bnToU8a, u8aConcat } from '@polkadot/util'; diff --git a/packages/util-crypto/src/secp256k1/verify.ts b/packages/util-crypto/src/secp256k1/verify.ts index ba072c74b..aa662b621 100644 --- a/packages/util-crypto/src/secp256k1/verify.ts +++ b/packages/util-crypto/src/secp256k1/verify.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { HashType } from './types'; +import type { HashType } from './types'; import { assert, u8aEq, u8aToU8a } from '@polkadot/util'; diff --git a/packages/util-crypto/src/signature/verify.ts b/packages/util-crypto/src/signature/verify.ts index b46d716e8..110ad0f08 100644 --- a/packages/util-crypto/src/signature/verify.ts +++ b/packages/util-crypto/src/signature/verify.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { KeypairType, VerifyResult } from '../types'; +import type { KeypairType, VerifyResult } from '../types'; import { assert, u8aToU8a } from '@polkadot/util'; diff --git a/packages/util/src/bn/toBn.ts b/packages/util/src/bn/toBn.ts index 7a1baf18e..ddf1aca10 100644 --- a/packages/util/src/bn/toBn.ts +++ b/packages/util/src/bn/toBn.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn } from '../types'; +import type { ToBn } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/bn/toHex.ts b/packages/util/src/bn/toHex.ts index f9b457c65..68d5b3a3a 100644 --- a/packages/util/src/bn/toHex.ts +++ b/packages/util/src/bn/toHex.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn, ToBnOptions } from '../types'; +import type { ToBn, ToBnOptions } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/bn/toU8a.ts b/packages/util/src/bn/toU8a.ts index dcedbf9fc..c997a8043 100644 --- a/packages/util/src/bn/toU8a.ts +++ b/packages/util/src/bn/toU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn, ToBnOptions } from '../types'; +import type { ToBn, ToBnOptions } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/compact/defaults.ts b/packages/util/src/compact/defaults.ts index 9e497aa12..0c118cd88 100644 --- a/packages/util/src/compact/defaults.ts +++ b/packages/util/src/compact/defaults.ts @@ -1,6 +1,6 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BitLength } from './types'; +import type { BitLength } from './types'; export const DEFAULT_BITLENGTH: BitLength = 32; diff --git a/packages/util/src/compact/fromU8a.ts b/packages/util/src/compact/fromU8a.ts index 1d498ff90..8421f6111 100644 --- a/packages/util/src/compact/fromU8a.ts +++ b/packages/util/src/compact/fromU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BitLength } from './types'; +import type { BitLength } from './types'; import BN from 'bn.js'; diff --git a/packages/util/src/compact/stripLength.ts b/packages/util/src/compact/stripLength.ts index 33fa8338c..ff9872389 100644 --- a/packages/util/src/compact/stripLength.ts +++ b/packages/util/src/compact/stripLength.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { BitLength } from './types'; +import type { BitLength } from './types'; import { DEFAULT_BITLENGTH } from './defaults'; import { compactFromU8a } from './fromU8a'; diff --git a/packages/util/src/extractTime.ts b/packages/util/src/extractTime.ts index b11de576f..456b66048 100644 --- a/packages/util/src/extractTime.ts +++ b/packages/util/src/extractTime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Time } from './types'; +import type { Time } from './types'; const HRS = 60 * 60; const DAY = HRS * 24; diff --git a/packages/util/src/format/formatBalance.ts b/packages/util/src/format/formatBalance.ts index 5e2135901..28e1573f3 100644 --- a/packages/util/src/format/formatBalance.ts +++ b/packages/util/src/format/formatBalance.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SiDef, ToBn } from '../types'; +import type { SiDef, ToBn } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/format/formatElapsed.ts b/packages/util/src/format/formatElapsed.ts index ccad65747..50264a671 100644 --- a/packages/util/src/format/formatElapsed.ts +++ b/packages/util/src/format/formatElapsed.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/ui-util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn } from '../types'; +import type { ToBn } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/format/formatNumber.ts b/packages/util/src/format/formatNumber.ts index 71b65e30f..3a991989a 100644 --- a/packages/util/src/format/formatNumber.ts +++ b/packages/util/src/format/formatNumber.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn } from '../types'; +import type { ToBn } from '../types'; import BN from 'bn.js'; diff --git a/packages/util/src/format/si.ts b/packages/util/src/format/si.ts index e16f30405..1862e2a6e 100644 --- a/packages/util/src/format/si.ts +++ b/packages/util/src/format/si.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SiDef } from '../types'; +import type { SiDef } from '../types'; export const SI_MID = 8; diff --git a/packages/util/src/hex/toBn.ts b/packages/util/src/hex/toBn.ts index 4c0eef7e1..732b9a8a7 100644 --- a/packages/util/src/hex/toBn.ts +++ b/packages/util/src/hex/toBn.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ToBnOptions } from '../types'; + import BN from 'bn.js'; import { isBoolean } from '../is/boolean'; import { hexStripPrefix } from './stripPrefix'; -import { ToBnOptions } from '../types'; function reverse (value: string): string { return (value.match(/.{1,2}/g) || []) diff --git a/packages/util/src/is/childClass.ts b/packages/util/src/is/childClass.ts index d03c78a2d..7e62070c3 100644 --- a/packages/util/src/is/childClass.ts +++ b/packages/util/src/is/childClass.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Constructor } from '../types'; +import type { Constructor } from '../types'; /** * @name isChildClass diff --git a/packages/util/src/is/toBn.ts b/packages/util/src/is/toBn.ts index b2ba8b94e..9eded75ef 100644 --- a/packages/util/src/is/toBn.ts +++ b/packages/util/src/is/toBn.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ToBn } from '../types'; +import type { ToBn } from '../types'; import { isFunction } from './function'; diff --git a/packages/util/src/logger.spec.ts b/packages/util/src/logger.spec.ts index 3a68a44ed..70ea3b6e1 100644 --- a/packages/util/src/logger.spec.ts +++ b/packages/util/src/logger.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Logger } from './types'; +import type { Logger } from './types'; import BN from 'bn.js'; diff --git a/packages/util/src/logger.ts b/packages/util/src/logger.ts index 0657996ea..f6c93e65c 100644 --- a/packages/util/src/logger.ts +++ b/packages/util/src/logger.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Logger, Logger$Data } from './types'; +import type { Logger, Logger$Data } from './types'; import { formatDate } from './format/formatDate'; import { isBn } from './is/bn'; diff --git a/packages/util/src/u8a/toBn.ts b/packages/util/src/u8a/toBn.ts index 95ab7a9d0..50b6d89e8 100644 --- a/packages/util/src/u8a/toBn.ts +++ b/packages/util/src/u8a/toBn.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/util authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ToBnOptions } from '../types'; + import BN from 'bn.js'; import { hexToBn } from '../hex/toBn'; import { u8aToHex } from './toHex'; -import { ToBnOptions } from '../types'; /** * @name u8aToBn