-
Notifications
You must be signed in to change notification settings - Fork 7
/
derive.ts
38 lines (33 loc) · 1.71 KB
/
derive.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type { AnyFunction } from 'https://deno.land/x/polkadot@0.2.45/types/types/index.ts';
import * as accounts from './accounts/index.ts';
import * as alliance from './alliance/index.ts';
import * as bagsList from './bagsList/index.ts';
import * as balances from './balances/index.ts';
import * as bounties from './bounties/index.ts';
import * as chain from './chain/index.ts';
import * as contracts from './contracts/index.ts';
import * as council from './council/index.ts';
import * as crowdloan from './crowdloan/index.ts';
import * as democracy from './democracy/index.ts';
import * as elections from './elections/index.ts';
import * as imOnline from './imOnline/index.ts';
import * as membership from './membership/index.ts';
import * as parachains from './parachains/index.ts';
import * as session from './session/index.ts';
import * as society from './society/index.ts';
import * as staking from './staking/index.ts';
import * as technicalCommittee from './technicalCommittee/index.ts';
import * as treasury from './treasury/index.ts';
import * as tx from './tx/index.ts';
export const derive = { accounts, alliance, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
type DeriveSection<Section> = {
[M in keyof Section]: Section[M] extends AnyFunction
? ReturnType<Section[M]> // ReturnType<Section[Method]> will be the inner function, i.e. without (api) argument
: never;
};
type DeriveAllSections<AllSections> = {
[S in keyof AllSections]: DeriveSection<AllSections[S]>
};
export interface ExactDerive extends DeriveAllSections<typeof derive> {
// keep empty, allows for augmentation
}