UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

63 lines (62 loc) 1.98 kB
import { Context, ContextFactoryOptions, ContextDefaultState } from './context'; import { kSerializeData } from '../../utils/constants'; export type FriendActivityContextType = 'friend_activity'; export type FriendActivityContextSubType = 'friend_online' | 'friend_offline' | 'friend_invisible'; export interface IFriendActivityContextPayload { user_id: number; date: number; extra: number; app_id: number; } export type FriendActivityContextOptions<S> = ContextFactoryOptions<[number, number, number, number, number], S>; export declare class FriendActivityContext<S = ContextDefaultState> extends Context<IFriendActivityContextPayload, S, FriendActivityContextType, FriendActivityContextSubType> { constructor(options: FriendActivityContextOptions<S>); /** * Checks that the user is online */ get isOnline(): boolean; /** * Checks that the user is online */ get isOffline(): boolean; /** * Checks that the user is invisible */ get isInvisible(): boolean; /** * Checks that the user has logged out of the network himself */ get isSelfLeave(): boolean; /** * Checks that the user logged out a timeout */ get isTimeoutLeave(): boolean; /** * Returns the friend id */ get userId(): number | undefined; /** * Returns the identifier of the application from which the friend was online */ get applicationId(): number; /** * Returns the date when this event was created */ get eventAt(): number; /** * Returns the platform from which the user entered * * - `1` - m.vk.com or other unknown application * - `2` - iPhone * - `3` - iPad * - `4` - Android * - `5` - Windows Phone * - `6` - Windows * - `7` - vk.com or other unknown application */ get platform(): number | undefined; /** * Returns the custom data */ [kSerializeData](): object; }