UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

45 lines (44 loc) 1.47 kB
import { Context, ContextFactoryOptions, ContextDefaultState } from './context'; import { kSerializeData } from '../../utils/constants'; export type LikeContextType = 'like'; export type LikeContextSubType = 'like_add' | 'like_remove'; export interface ILikeContextPayload { liker_id: number; object_id: number; object_owner_id: number; object_type: 'video' | 'photo' | 'comment' | 'note' | 'topic_comment' | 'photo_comment' | 'video_comment' | 'market' | 'market_comment'; post_id: number; thread_reply_id: number; } export type LikeContextOptions<S> = ContextFactoryOptions<ILikeContextPayload, S>; export declare class LikeContext<S = ContextDefaultState> extends Context<ILikeContextPayload, S, LikeContextType, LikeContextSubType> { constructor(options: LikeContextOptions<S>); /** * Returns the id of the user who interacts with the like */ get likerId(): number; /** * Returns the material id */ get objectId(): number; /** * Returns the material owner id */ get objectOwnerId(): number; /** * Returns the material type */ get objectType(): ILikeContextPayload['object_type']; /** * Returns the post id (returned for a comment left under the post) */ get postId(): number; /** * Returns the parent comment / post id. */ get threadReplyId(): number; /** * Returns the custom data */ [kSerializeData](): object; }