UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

33 lines (32 loc) 1.21 kB
import { Context, ContextFactoryOptions, ContextDefaultState } from './context'; import { kSerializeData } from '../../utils/constants'; export type MessageSubscriptionContextType = 'message_subscription'; export type MessageSubscriptionContextSubType = 'message_allow' | 'message_deny'; export interface IMessageSubscriptionContextPayload { user_id: number; key: string; } export type MessageSubscriptionContextOptions<S> = ContextFactoryOptions<IMessageSubscriptionContextPayload, S>; export declare class MessageSubscriptionContext<S = ContextDefaultState> extends Context<IMessageSubscriptionContextPayload, S, MessageSubscriptionContextType, MessageSubscriptionContextSubType> { constructor(options: MessageSubscriptionContextOptions<S>); /** * Checks that the user has subscribed to messages */ get isSubscribed(): boolean; /** * Checks that the user has unsubscribed from the messages */ get isUnsubscribed(): boolean; /** * Returns the identifier user */ get userId(): number; /** * Returns the key */ get key(): string | undefined; /** * Returns the custom data */ [kSerializeData](): object; }