UNPKG

813 BTypeScriptView Raw
1import type { ExactDerive } from '@polkadot/api-derive';
2import type { AnyFunction } from '@polkadot/types/types';
3import type { ApiTypes, DecorateMethod, MethodResult } from '../types/index.js';
4type AnyDeriveSection = Record<string, AnyFunction>;
5type AnyDerive = Record<string, AnyDeriveSection>;
6type DeriveSection<ApiType extends ApiTypes, Section extends AnyDeriveSection> = {
7 [M in keyof Section]: MethodResult<ApiType, Section[M]>;
8};
9export 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 {};