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:
Jaco Greeff
2019-01-31 14:15:59 +01:00
committed by GitHub
parent 4c563a7ca0
commit 661cb3c453
10 changed files with 296 additions and 214 deletions
+10
View File
@@ -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;