Type re-exports (#1310)

This commit is contained in:
Jaco
2021-12-11 09:45:49 +02:00
committed by GitHub
parent 5bf71dab41
commit 6f53068297
2 changed files with 7 additions and 11 deletions
+4 -11
View File
@@ -1,19 +1,12 @@
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { U8aLike } from '@polkadot/util/types';
import { assert, u8aToU8a } from '@polkadot/util';
// NOTE: Work around a TS issue. These are re-defined like in @polkadot/util/types
// since without it the import
//
// import type { U8aLike } from '@polkadot/util/types';
//
// ends up in the build-generated code as
//
// impor("../../../util/src/types").U8aLike
//
// eslint-disable-next-line @typescript-eslint/ban-types
type U8aLike = number[] | Buffer | Uint8Array | string | String;
// re-export the type so *.d.ts files don't have ../src imports
export type { U8aLike } from '@polkadot/util/types';
interface Coder {
decode: (value: string) => Uint8Array;
+3
View File
@@ -6,6 +6,9 @@ import type { HexString } from '@polkadot/util/types';
import { hasBigInt, u8aToHex, u8aToU8a } from '@polkadot/util';
import { isReady } from '@polkadot/wasm-crypto';
// re-export so TS *.d.ts generation is correct
export type { HexString } from '@polkadot/util/types';
interface DualHash {
256: (u8a: Uint8Array) => Uint8Array;
512: (u8a: Uint8Array) => Uint8Array;