Q:

Simple Office Typescript Example

I've created a new Outlook Web Add-In project from Visual Studio, installed the Office TypeScript typings via npm. 
I then changed the default example MessageRead.js to MessageRead.ts
in the function loadProps() we see this :
let item = Office.context.mailbox.item;
we then see the following line
$('#attachments').html(buildAttachmentsString(item.attachments));

but with the typescript intellisense the item class does not contain the attachments object. 
Where am i going wrong?  Could someone give a basic example? 

A:

The mailbox.item typings will only have members common to all item types.  For message read item scenarios, try casting it like this: (item as Office. MessageRead).attachments to get message read members in intellisense.  Hope this helps!