Deleting a Contact Deleting a contact is the final bit of functionality this Worker must provide:
public async deleteContact(inID): Promise {
await axios.delete(
`${config.serverAddress}/contacts/${inID}`);
}
Well, that’s pretty simple, isn’t it? Here, you can see the contact’s ID added to the
URL, as per our REST interface server design.
Mirroring the Server Part 2: IMAP.ts The second Worker to look at is in the IMAP.ts files. Just like with contacts, we begin with
an interface:
export interface IMailbox { name: string, path: string }
And also, just like with contacts, this mimics the interface of the same name found in
the server version of IMAP.ts. Similarly, we have the same IMessage interface as on the
server too:
Chapter 9 Delivering the gooDs: MailBag, the Client
245
export interface IMessage {
id: string, date: string, from: string,subject: string,
body?: string
}
After that, the Worker class begins, and we have some methods to look at.