vk-io
Version:
Modern VK API SDK for Node.js
69 lines (68 loc) • 1.88 kB
TypeScript
import { Context, ContextFactoryOptions, ContextDefaultState } from './context';
import { kSerializeData } from '../../utils/constants';
export declare enum TypingState {
TYPING = "typing",
AUDIO_MESSAGE = "audiomessage",
PHOTO_MESSAGE = "photo",
VIDEO_MESSAGE = "video",
FILE_MESSAGE = "file"
}
export interface ITypingContextPayload {
from_id: number;
to_id: number;
state: TypingState;
}
export type TypingContextType = 'typing';
export type TypingContextSubType = 'typing_user' | 'typing_group' | 'message_typing_state';
export type TypingContextOptions<S> = ContextFactoryOptions<ITypingContextPayload, S>;
export declare class TypingContext<S = ContextDefaultState> extends Context<ITypingContextPayload, S, TypingContextType, TypingContextSubType> {
constructor(options: TypingContextOptions<S>);
/**
* Checks is typing
*/
get isTyping(): boolean;
/**
* Checks is record audio message
*/
get isAudioMessage(): boolean;
/**
* Checks is upload photo message
*/
get isPhotoMessage(): boolean;
/**
* Checks is upload video message
*/
get isVideoMessage(): boolean;
/**
* Checks is upload file message
*/
get isFileMessage(): boolean;
/**
* Checks that the message is typed in the dm
*/
get isUser(): boolean;
/**
* Checks that the message is typed in the chat
*/
get isGroup(): boolean;
/**
* Checks that the message is typed in the chat
*/
get isChat(): boolean;
/**
* Returns the identifier sender
*/
get fromId(): number;
/**
* Returns the identifier destination
*/
get toId(): number;
/**
* Returns the identifier chat
*/
get chatId(): number | undefined;
/**
* Returns the custom data
*/
[kSerializeData](): object;
}