UNPKG

836 BTypeScriptView Raw
1import type { ExactDerive } from '@polkadot/api-derive';
2import type { AnyFunction } from '@polkadot/types/types';
3import type { ApiTypes, DecorateMethod, MethodResult } from '../types';
4declare type AnyDeriveSection = Record<string, AnyFunction>;
5declare type AnyDerive = Record<string, AnyDeriveSection>;
6declare type DeriveSection<ApiType extends ApiTypes, Section extends AnyDeriveSection> = {
7 [M in keyof Section]: MethodResult<ApiType, Section[M]>;
8};
9export declare type AllDerives<ApiType extends ApiTypes> = {
10 [S in keyof ExactDerive]: DeriveSection<ApiType, ExactDerive[S]>;
11};
12/**
13 * This is a section decorator which keeps all type information.
14 */
15export declare function decorateDeriveSections<ApiType extends ApiTypes>(decorateMethod: DecorateMethod<ApiType>, derives: AnyDerive): AllDerives<ApiType>;
16export {};