Align costs typing with queries (#2564)
* Align costs typing with queries * better... * ... and better * ... progress * better, down to 8 * ... down to 3 * ... 2 * Down to 1 * It builds. * ... it really builds
This commit is contained in:
@@ -54,7 +54,11 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: Record<strin
|
||||
...Object.keys(imports.localTypes).sort().map((packagePath): { file: string; types: string[] } => ({
|
||||
file: packagePath,
|
||||
types: Object.keys(imports.localTypes[packagePath])
|
||||
}))
|
||||
})),
|
||||
{
|
||||
file: '@polkadot/api/types',
|
||||
types: ['ApiTypes']
|
||||
}
|
||||
];
|
||||
|
||||
return generateForMetaTemplate({
|
||||
|
||||
@@ -2,22 +2,25 @@
|
||||
|
||||
{{{ imports }}}
|
||||
|
||||
declare module '@polkadot/metadata/Decorated/consts/types' {
|
||||
export interface Constants {
|
||||
{{#unless isStrict}}
|
||||
[index: string]: ModuleConstants;
|
||||
{{/unless}}
|
||||
declare module '@polkadot/api/types/consts' {
|
||||
export interface AugmentedConsts<ApiType> {
|
||||
{{#each modules}}
|
||||
{{{name}}}: {
|
||||
{{#unless @root.isStrict}}
|
||||
[index: string]: AugmentedConst<object & Codec>;
|
||||
[key: string]: Codec;
|
||||
{{/unless}}
|
||||
{{~#each items}}
|
||||
{{> docs}}
|
||||
{{{name}}}: AugmentedConst<{{{type}}}>;
|
||||
{{{name}}}: {{{type}}} & AugmentedConst<ApiType>;
|
||||
{{/each}}
|
||||
};
|
||||
{{/each}}
|
||||
}
|
||||
|
||||
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
|
||||
{{#unless isStrict}}
|
||||
[key: string]: QueryableModuleConsts;
|
||||
{{/unless}}
|
||||
}
|
||||
}
|
||||
{{> footer }}
|
||||
|
||||
@@ -7,7 +7,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
{{#each modules}}
|
||||
{{{name}}}: {
|
||||
{{#unless @root.isStrict}}
|
||||
[index: string]: QueryableStorageEntry<ApiType>;
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
{{/unless}}
|
||||
{{~#each items}}
|
||||
{{> docs}}
|
||||
@@ -19,7 +19,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
|
||||
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
|
||||
{{#unless isStrict}}
|
||||
[index: string]: QueryableModuleStorage<ApiType>;
|
||||
[key: string]: QueryableModuleStorage<ApiType>;
|
||||
{{/unless}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
{{#each modules}}
|
||||
{{{name}}}: {
|
||||
{{#unless @root.isStrict}}
|
||||
[index: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
{{/unless}}
|
||||
{{~#each items}}
|
||||
{{> docs}}
|
||||
@@ -20,7 +20,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
|
||||
(extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
|
||||
{{#unless isStrict}}
|
||||
[index: string]: SubmittableModuleExtrinsics<ApiType>;
|
||||
[key: string]: SubmittableModuleExtrinsics<ApiType>;
|
||||
{{/unless}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user