UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

46 lines (45 loc) 1.55 kB
import { Context, ContextFactoryOptions, ContextDefaultState } from './context'; import { kSerializeData } from '../../utils/constants'; export type DonutSubscriptionContextType = 'donut_subscription'; export type DonutSubscriptionContextSubType = 'donut_subscription_create' | 'donut_subscription_prolonged' | 'donut_subscription_expired' | 'donut_subscription_cancelled'; export interface IDonutSubscriptionContextPayload { user_id: number; amount?: number; amount_without_fee?: number; } export type DonutSubscriptionContextOptions<S> = ContextFactoryOptions<IDonutSubscriptionContextPayload, S>; export declare class DonutSubscriptionContext<S = ContextDefaultState> extends Context<IDonutSubscriptionContextPayload, S, DonutSubscriptionContextType, DonutSubscriptionContextSubType> { constructor(options: DonutSubscriptionContextOptions<S>); /** * Checks if subscription created */ get isCreated(): boolean; /** * Checks if subscription prolonged */ get isProlonged(): boolean; /** * Checks if subscription expired */ get isExpired(): boolean; /** * Checks if subscription cancelled */ get isCancelled(): boolean; /** * Returns the id of the user who interacts with the vk donut */ get userId(): number; /** * Returns the amount */ get amount(): number; /** * Returns the amount without fee */ get amountWithoutFee(): number; /** * Returns the custom data */ [kSerializeData](): object; }