interface IMailTo { name : string ; email : string ; } interface IMailMessage { subject : string ; body : string ; attachment ? : string [ ] ; } interface IMessageDTO { to : IMailTo ; message : IMailMessage ; } interface IEmailService { sendMail ( request ) : void ; } class EmailService implements IEmailService { sendMail ( { to , message } ) { console . log ( `Email enviado para ${ to . name }: ${ message . subject }` ) ; } } export default EmailService ;