Codec types (call definitions in API) (#650)
* Codec types (call definitions) * Pass Codec & Subscription generic types * WIP typing * Typing seems ok * Linting * Queryable storage retuns Hash & U64 for .hash and .size * Better typing for SubmittableExtrinsic * Indentation. * Update with needsCallback * Update SubmittableExtrinsic.ts
This commit is contained in:
@@ -4,6 +4,16 @@
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
export type CodecArg = Codec | BN | Boolean | String | Uint8Array | boolean | number | string | undefined | CodecArgArray | CodecArgObject;
|
||||
|
||||
export type CodecCallback <T extends Codec = Codec> = (result: T) => any;
|
||||
|
||||
interface CodecArgObject {
|
||||
[index: string]: CodecArg;
|
||||
}
|
||||
|
||||
interface CodecArgArray extends Array<CodecArg> { }
|
||||
|
||||
export type AnyNumber = BN | Uint8Array | number | string;
|
||||
|
||||
export type AnyString = string | String;
|
||||
|
||||
Reference in New Issue
Block a user