UNPKG

nodevk-ts

Version:

Simple Node.js module that allows you to interact with the VKontakte API.

26 lines (25 loc) 942 B
import ConfigSession from './ConfigSession.js'; import { VKAPIError } from "../VKAPIException.js"; import MessagesAPI from "../API/messages.js"; import PhotosAPI from "../API/photos.js"; import UsersAPI from '../API/users.js'; import GroupsAPI from '../API/groups.js'; export interface IMethodParams { access_token?: string; version?: string; [key: string]: string | number | boolean | Array<string | number> | object; } export interface VKAPIResponse<T = any> { error?: VKAPIError; response: T; } export default abstract class Session { private config; constructor(config?: ConfigSession); protected request(url: string, params: IMethodParams): Promise<any>; invokeMethod<T = any>(method: string, params: IMethodParams): Promise<VKAPIResponse<T>>; readonly messages: MessagesAPI; readonly photos: PhotosAPI; readonly users: UsersAPI; readonly groups: GroupsAPI; }