UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

32 lines (31 loc) 778 B
import { API } from '../api'; import { APIRequest } from '../api/request'; import { IExecutesPayload } from './executes'; export interface IChainOptions { api: API; } export declare class Chain { started: boolean; protected api: API; protected queue: APIRequest[]; /** * Constructor */ constructor({ api }: IChainOptions); /** * Returns custom tag */ get [Symbol.toStringTag](): string; /** * Adds method to queue */ append<T = any>(method: string, params: object): Promise<T>; /** * Promise based */ then(thenFn: (value: IExecutesPayload) => unknown, catchFn: (reason: unknown) => unknown): Promise<unknown>; /** * Starts the chain */ run(): Promise<IExecutesPayload>; }