Fix TS import generation (#1226)

* Fix TS import generation

* Flatten
This commit is contained in:
Jaco
2021-11-22 06:51:49 +02:00
committed by GitHub
parent e6a0f1e2fd
commit bb73f7ae41
+12 -2
View File
@@ -1,10 +1,20 @@
// 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
//
// import("../../../util/src/types").U8aLike
//
// eslint-disable-next-line @typescript-eslint/ban-types
type U8aLike = number[] | Buffer | Uint8Array | string | String;
interface Coder {
decode: (value: string) => Uint8Array;
encode: (value: Uint8Array) => string;