module author Christos Panagiotakopoulos <chrispanag@gmail.com>
 *  copyright license /** Generic attachment class */ export class Attachment { public type : string ; public payload : Record < string , unknown > ; param { string } type param { object } payload constructor ( type , payload ) { this . type = type ; this . payload = payload ; } public serialize ( ) { return { type : this . type , payload : this . payload } ; } } /** An image attachment */ export class ImageAttachment extends Attachment { param { string } url constructor ( url ) { super ( 'image' , { url } ) ; } } /** A template attachment */ export class TemplateAttachment extends Attachment { param { object } template constructor ( template ) { super ( 'template' , template ) ; } }