Expand enum & struct defnitions, generator strict mode (#1798)

This commit is contained in:
Jaco Greeff
2020-02-03 11:56:06 +01:00
committed by GitHub
parent 328630fb17
commit 2ee3afcd61
14 changed files with 128 additions and 85 deletions
@@ -0,0 +1,19 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Codec } from '@polkadot/types/types';
import { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces';
export type AugmentedConst<T extends Codec> = T & ConstantCodec;
export type ModuleConstants = Record<string, Codec>;
export interface Constants {
[index: string]: ModuleConstants;
}
export interface ConstantCodec extends Codec {
meta: ModuleConstantMetadataLatest;
}
+1 -13
View File
@@ -3,20 +3,8 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { StorageEntry } from '@polkadot/types/primitive/StorageKey';
import { Codec } from '@polkadot/types/types';
import { ModuleConstantMetadataLatest } from '@polkadot/types/interfaces';
export type AugmentedConst<T extends Codec> = T & ConstantCodec;
export interface ConstantCodec extends Codec {
meta: ModuleConstantMetadataLatest;
}
export type ModuleConstants = Record<string, Codec>;
export interface Constants {
[index: string]: ModuleConstants;
}
export * from './consts/types';
export interface ModuleStorage {
[key: string]: StorageEntry;