Make api.const.*.* typed (#1584)

* Make api.const.*.* typed

* Fix tsc errors

* Remove ConstantCodec

* as any as

* Remove as any
This commit is contained in:
Amaury Martiny
2019-11-18 17:21:54 +01:00
committed by GitHub
parent 20d8a31258
commit 0a27f63423
11 changed files with 208 additions and 19 deletions
@@ -34,8 +34,8 @@ export default function fromMetadata (metadata: Metadata): Constants {
newModule[stringCamelCase(meta.name.toString())] = codec;
return newModule;
}, {});
}, {} as ModuleConstants);
return result;
}, {});
}, {} as Constants);
}
+3 -1
View File
@@ -12,7 +12,9 @@ export interface ConstantCodec extends Codec {
export type ModuleConstants = Record<string, Codec>;
export type Constants = Record<string, ModuleConstants>;
export interface Constants {
[index: string]: ModuleConstants;
}
export interface ModuleStorage {
[key: string]: StorageEntry;