vk-io
Version:
Modern VK API SDK for Node.js
145 lines (144 loc) • 3.96 kB
TypeScript
import { Attachment, AttachmentFactoryOptions } from './attachment';
import { AttachmentType, kSerializeData } from '../../utils/constants';
import { PhotoAttachment, IPhotoAttachmentPayload } from './photo';
import { VideoAttachment, IVideoAttachmentPayload } from './video';
export interface IStoryAttachmentPayload {
id: number;
owner_id: number;
access_key?: string;
type?: 'photo' | 'video';
photo?: IPhotoAttachmentPayload;
video?: IVideoAttachmentPayload;
date?: number;
expires_at?: number;
views?: number;
link?: {
text: string;
url: string;
};
replies?: {
count: number;
new: number;
};
parent_story_owner_id?: number;
parent_story_id?: number;
parent_story?: IStoryAttachmentPayload;
clickable_stickers?: {
original_width: number;
original_height: number;
style: string;
mention?: string;
hashtag?: string;
clickable_stickers: {
type: 'mention' | 'hashtag';
clickable_area: {
x: number;
y: number;
}[];
}[];
};
is_expired?: boolean;
is_deleted?: boolean;
seen?: number;
can_reply?: number;
can_share?: number;
can_comment?: number;
}
declare const kVideo: unique symbol;
declare const kPhoto: unique symbol;
declare const kParentStory: unique symbol;
export type StoryAttachmentOptions = AttachmentFactoryOptions<IStoryAttachmentPayload>;
export declare class StoryAttachment extends Attachment<IStoryAttachmentPayload, AttachmentType.STORY | 'story'> {
protected [kPhoto]: PhotoAttachment | undefined;
protected [kVideo]: VideoAttachment | undefined;
protected [kParentStory]: StoryAttachment | undefined;
/**
* Constructor
*/
constructor(options: StoryAttachmentOptions);
/**
* Load attachment payload
*/
loadAttachmentPayload(): Promise<void>;
/**
* Checks is story expired
*/
get isExpired(): boolean | undefined;
/**
* Checks is story deleted
*/
get isDeleted(): boolean | undefined;
/**
* Checks is story viewed by current user
*/
get isSeen(): boolean | undefined;
/**
* Checks can story reply
*/
get isCanReply(): boolean | undefined;
/**
* Checks can story share
*/
get isCanShare(): boolean | undefined;
/**
* Checks can story comment
*/
get isCanComment(): boolean | undefined;
/**
* Returns the type of story
*/
get storyType(): IStoryAttachmentPayload['type'] | undefined;
/**
* Returns the story photo
*/
get photo(): PhotoAttachment | undefined;
/**
* Returns the story video
*/
get video(): VideoAttachment | undefined;
/**
* Returns the date when this story was created
*/
get createdAt(): number | undefined;
/**
* Returns the date when this story was expires
*/
get expiresAt(): number | undefined;
/**
* Returns the story views count
*/
get viewsCount(): number | undefined;
/**
* Returns the story link
*/
get link(): IStoryAttachmentPayload['link'] | undefined;
/**
* Returns the story replies
*/
get replies(): IStoryAttachmentPayload['replies'] | undefined;
/**
* Returns the parent story id
*/
get parentStoryId(): number | undefined;
/**
* Returns the parent story owner id
*/
get parentStoryOwnerId(): number | undefined;
/**
* Returns the parent story
*/
get parentStory(): StoryAttachment | undefined;
/**
* Returns the parent story clickable stickers
*/
get clickableStickers(): IStoryAttachmentPayload['clickable_stickers'] | undefined;
/**
* Applies the payload
*/
private applyPayload;
/**
* Returns the custom data
*/
[kSerializeData](): object;
}
export {};