UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

35 lines (34 loc) 1.27 kB
import { Context, ContextFactoryOptions, ContextDefaultState } from './context'; import { kSerializeData } from '../../utils/constants'; export type VKAppPayloadContextType = 'vk_app_event'; export type VKAppPayloadContextSubType = 'app_payload'; export interface IVKAppPayloadPayload { user_id: number; app_id: number; payload: string; group_id: number; } export type VKAppPayloadContextOptions<S> = ContextFactoryOptions<IVKAppPayloadPayload, S>; export declare class VKAppPayloadContext<S = ContextDefaultState, P extends Record<string, any> = object> extends Context<IVKAppPayloadPayload, S, VKAppPayloadContextType, VKAppPayloadContextSubType> { constructor(options: VKAppPayloadContextOptions<S>); /** * Returns the identifier of the user whose action the event was sent to in the application */ get userId(): number; /** * Returns the identifier of the application from which the event was sent */ get appId(): number; /** * Returns the identifier of the community to which the notification was sent */ get groupId(): number; /** * Returns the transferred useful data */ get eventPayload(): P; /** * Returns the custom data */ [kSerializeData](): object; }