UNPKG

vk-io

Version:

Modern VK API SDK for Node.js

83 lines (82 loc) 2.1 kB
import { Attachment, AttachmentFactoryOptions } from './attachment'; import { AttachmentType, kSerializeData } from '../../utils/constants'; export interface IPhotoSize { type: string; url: string; width: number; height: number; } export interface IPhotoAttachmentPayload { id: number; owner_id: number; access_key?: string; album_id?: number; user_id?: number; text?: string; date?: number; sizes?: IPhotoSize[]; width?: number; height?: number; } export type PhotoAttachmentOptions = AttachmentFactoryOptions<IPhotoAttachmentPayload>; export declare class PhotoAttachment extends Attachment<IPhotoAttachmentPayload, AttachmentType.PHOTO | 'photo'> { /** * Constructor */ constructor(options: PhotoAttachmentOptions); /** * Load attachment payload */ loadAttachmentPayload(): Promise<void>; /** * Returns the ID of the user who uploaded the image */ get userId(): number | undefined; /** * Returns the ID of the album */ get albumId(): number | undefined; /** * Returns the photo text */ get text(): string | undefined; /** * Returns the date when this photo was created */ get createdAt(): number | undefined; /** * Returns the photo height */ get height(): number | undefined; /** * Returns the photo width */ get width(): number | undefined; /** * Returns the URL of a small photo * (130 or 75) */ get smallSizeUrl(): string | undefined; /** * Returns the URL of a medium photo * (807 or 604 or less) */ get mediumSizeUrl(): string | undefined; /** * Returns the URL of a large photo * (2560 or 1280 or less) */ get largeSizeUrl(): string | undefined; /** * Returns the sizes */ get sizes(): IPhotoSize[] | undefined; /** * Returns the sizes of the required types */ getSizes(sizeTypes: string[]): IPhotoSize[]; /** * Returns the custom data */ [kSerializeData](): object; }