UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

247 lines (246 loc) 6.57 kB
import { Attachment, AttachmentFactoryOptions } from './attachment'; import { ExternalAttachment } from './external'; import { Attachmentable } from '../shared'; import { AttachmentType, kSerializeData } from '../../utils/constants'; declare const kAttachments: unique symbol; declare const kCopyHistoryAttachments: unique symbol; export interface IWallAttachmentPayload { id: number; to_id?: number; owner_id: number; access_key?: string; from_id?: number; created_by?: number; date?: number; text?: string; reply_owner_id?: number; reply_post_id?: number; friends_only?: number; comments?: { count: number; can_post: number; groups_can_post: number; can_close: number; can_open: number; }; copyright?: { id?: number; link: string; name: string; type: string; }; likes?: { count: number; user_likes: number; can_like: number; can_publish: number; }; reposts?: { count: number; user_reposted: number; }; views?: { count: number; }; post_type?: string; post_source?: { type: string; platform: string; data: string; url: string; }; attachments?: object[]; geo?: object; signer_id?: number; copy_history?: IWallAttachmentPayload[]; can_pin?: number; can_delete?: number; can_edit?: number; is_pinned?: number; marked_as_ads?: number; is_favorite?: number; donut?: { is_donut: boolean; paid_duration?: number; placeholder?: { text: string; }; can_publish_free_copy?: boolean; edit_mode?: 'all' | 'duration'; durations?: { id: number; name: string; }[]; }; postponed_id?: number; } export type WallAttachmentOptions = AttachmentFactoryOptions<IWallAttachmentPayload>; declare class WallAttachment extends Attachment<IWallAttachmentPayload, AttachmentType.WALL | 'wall'> { protected [kAttachments]: (Attachment | ExternalAttachment)[]; protected [kCopyHistoryAttachments]: WallAttachment[]; /** * Constructor */ constructor(options: WallAttachmentOptions); /** * Load attachment payload */ loadAttachmentPayload(): Promise<void>; /** * Checks has comments */ get hasComments(): boolean | undefined; /** * Checks has ads in post */ get hasAds(): boolean | undefined; /** * Checks has this user reposted */ get hasUserReposted(): boolean | undefined; /** * Checks has this user likes */ get hasUserLike(): boolean | undefined; /** * Checks can the current user comment on the entry */ get isCanUserCommented(): boolean | undefined; /** * Checks if a community can comment on a post */ get isCanGroupsCommented(): boolean | undefined; /** * Checks if you can comment on a post */ get isCanCommented(): boolean | undefined; /** * Checks if a user can close on a comments */ get isCanCloseComments(): boolean | undefined; /** * Checks if a user can open on a comments */ get isCanOpenComments(): boolean | undefined; /** * Checks whether the current user can like the record */ get isCanLike(): boolean | undefined; /** * hecks whether the current user can repost the record */ get isCanReposted(): boolean | undefined; /** * Checks is can this user pin post */ get isCanPin(): boolean | undefined; /** * Checks is can this user delete post */ get isCanDelete(): boolean | undefined; /** * Checks is can this user edit post */ get isCanEdit(): boolean | undefined; /** * Checks is can this user edit post */ get isPinned(): boolean | undefined; /** * Checks is post created only by friends */ get isFriendsOnly(): boolean | undefined; /** * Checks is bookmarked current user */ get isFavorited(): boolean | undefined; get ownerId(): number; /** * Returns the identifier author */ get authorId(): number | undefined; /** * Returns the administrator identifier that posted the entry */ get createdUserId(): number | undefined; /** * The identifier of the record owner, in response to which the current */ get replyOwnerId(): number | undefined; /** * The identifier of the record in response to which the current one was left. */ get replyPostId(): number | undefined; /** * Returns author identifier if the entry was published * on behalf of the community and signed by the user */ get signerId(): number | undefined; /** * Returns the id of the pending entry. This field is returned when the entry was on the timer. */ get postponedId(): number | undefined; /** * Returns the date when this post was created */ get createdAt(): number | undefined; /** * Returns the post type */ get postType(): string | undefined; /** * Returns the post text */ get text(): string | undefined; /** * Returns the number of record views */ get viewsCount(): number | undefined; /** * Returns the likes count */ get likesCount(): number | undefined; /** * Returns the reposts count */ get repostsCount(): number | undefined; /** * Returns the comments count */ get commentsCount(): number | undefined; /** * Returns the likes info */ get likes(): IWallAttachmentPayload['likes'] | undefined; /** * Returns the post source */ get postSource(): IWallAttachmentPayload['post_source'] | undefined; /** * Returns the geolocation */ get geo(): IWallAttachmentPayload['geo'] | undefined; /** * Returns the copyright */ get copyright(): IWallAttachmentPayload['copyright'] | undefined; /** * Returns the attachments */ get attachments(): (Attachment | ExternalAttachment)[]; /** * Returns the history of reposts for post */ get copyHistory(): WallAttachment[] | undefined; /** * Applies the payload */ private applyPayload; /** * Returns the custom data */ [kSerializeData](): object; } interface WallAttachment extends Attachmentable { } export { WallAttachment };