Adjust AnyBool & AnyString typings (#4850)
* Adjust AnyBool & AnyString typings * Fix AnyString typing
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, Inspect, IU8a, Registry } from '../types';
|
||||
import type { AnyBool, Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { isU8a, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -17,8 +17,7 @@ export class bool extends Boolean implements Codec {
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
constructor (registry: Registry, value: bool | Boolean | Uint8Array | boolean | number = false) {
|
||||
constructor (registry: Registry, value: bool | AnyBool | Uint8Array | number = false) {
|
||||
super(
|
||||
isU8a(value)
|
||||
? value[0] === 1
|
||||
|
||||
@@ -10,7 +10,11 @@ export type AnyFunction = (...args: any[]) => any;
|
||||
|
||||
export type AnyNumber = BN | bigint | Uint8Array | number | string;
|
||||
|
||||
export type AnyString = string | string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type AnyString = String | string;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type AnyBool = Boolean | boolean;
|
||||
|
||||
export type AnyTuple = Codec[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user