Split interface creation (#50)
* Split interface creation * Lint fixes * Update @polkadot dependencies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-jsonrpc",
|
||||
"version": "0.6.12",
|
||||
"version": "0.7.0",
|
||||
"description": "Method definitions for the Polkadot RPC layer",
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
// @flow
|
||||
|
||||
import type { InterfaceDefinition } from './types';
|
||||
import type { InterfaceDefinitions } from './types';
|
||||
|
||||
const chain = require('./chain');
|
||||
const state = require('./state');
|
||||
@@ -14,4 +14,4 @@ const state = require('./state');
|
||||
module.exports = ({
|
||||
chain,
|
||||
state
|
||||
}: { [string]: InterfaceDefinition });
|
||||
}: InterfaceDefinitions);
|
||||
|
||||
@@ -22,8 +22,14 @@ export type InterfaceMethodDefinition = {
|
||||
output: InterfaceOutputType
|
||||
};
|
||||
|
||||
export type InterfaceTypes = 'chain' | 'state';
|
||||
|
||||
export type InterfaceDefinition = {
|
||||
methods: {
|
||||
[string]: InterfaceMethodDefinition
|
||||
}
|
||||
};
|
||||
|
||||
export type InterfaceDefinitions = {
|
||||
[InterfaceTypes]: InterfaceDefinition
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user