import type { Observable } from 'rxjs'; import type { AnyFunction, Callback, Codec } from '@polkadot/types/types'; export type Push = [...T, V]; export type DropLast = T extends readonly [...infer U, any?] ? U : [...T]; export type ApiTypes = 'promise' | 'rxjs'; export type ObsInnerType> = O extends Observable ? U : never; export type VoidFn = () => void; export type UnsubscribePromise = Promise; export type PromiseOrObs = ApiType extends 'rxjs' ? Observable : Promise; export type MethodResult = ApiType extends 'rxjs' ? RxResult : PromiseResult; export interface RxResult { (...args: Parameters): Observable>>; (...args: Parameters): Observable; } export interface PromiseResult { (...args: Parameters): Promise>>; (...args: Push, Callback>>>): UnsubscribePromise; (...args: Parameters): Promise; (...args: Push, Callback>): UnsubscribePromise; } export interface DecorateMethodOptions { methodName?: string; overrideNoSub?: (...args: unknown[]) => Observable; } export type DecorateFn = (...args: any[]) => Observable; export interface PaginationOptions { args: A[]; pageSize: number; startKey?: string; } export type DecorateMethod<_ApiType extends ApiTypes, T = any> = Observable>(method: M, options?: DecorateMethodOptions) => T; type AsCodec = R extends Codec ? R : Codec; export type ReturnCodec = AsCodec>>; export interface EmptyBase<_> { } export {};