vk-io
Version:
Modern VK API SDK for Node.js
67 lines (66 loc) • 1.75 kB
TypeScript
import { ExternalAttachment, ExternalAttachmentFactoryOptions } from './external';
import { PhotoAttachment, IPhotoAttachmentPayload } from './photo';
import { AttachmentType, kSerializeData } from '../../utils/constants';
declare const kPhoto: unique symbol;
export interface ILinkAttachmentPayload {
title: string;
caption?: string;
description?: string;
url: string;
product?: {
price: object;
};
button?: {
title: string;
action: {
type: string;
url: string;
};
};
photo?: IPhotoAttachmentPayload;
}
export type LinkAttachmentOptions = ExternalAttachmentFactoryOptions<ILinkAttachmentPayload>;
export declare class LinkAttachment extends ExternalAttachment<ILinkAttachmentPayload, AttachmentType.LINK | 'link'> {
protected [kPhoto]: PhotoAttachment | undefined;
/**
* Constructor
*/
constructor(options: LinkAttachmentOptions);
/**
* Checks for the presence of a photo in a link
*/
get hasPhoto(): boolean;
/**
* Returns the title
*/
get title(): string;
/**
* Returns the title
*/
get caption(): string | undefined;
/**
* Returns the description
*/
get description(): string | undefined;
/**
* Returns the URL of the link
*/
get url(): string;
/**
* Returns the product
*/
get product(): ILinkAttachmentPayload['product'] | undefined;
/**
* Returns the button
*/
get button(): ILinkAttachmentPayload['button'] | undefined;
/**
* Returns the photo
*/
get photo(): PhotoAttachment | undefined;
/**
* Returns the custom data
*/
[kSerializeData](): object;
}
export {};