import { ExpectedError } from "office-addin-usage-data" ; /**
 * The types of Office add-ins.
 */ export enum AddInType { Content = "content" , Mail = "mail" , TaskPane = "taskpane" } const addInTypes = Object . keys ( AddInType ) . map < AddInType > ( ( key ) => parseAddInType ( key ) ) ; param host export function getAddInTypeForManifestOfficeAppType ( officeAppType ) { switch ( officeAppType ? officeAppType . trim ( ) . toLowerCase ( ) : officeAppType ) { case "contentapp" : return AddInType . Content ; case "mailapp" : return AddInType . Mail ; case "taskpaneapp" : return AddInType . TaskPane ; default : return undefined ; } } /**
 * Returns the Office add-in types.
 */ export function getAddInTypes ( ) { return addInTypes ; } param value throws export function parseAddInType ( value ) { const addInType = toAddInType ( value ) ; if ( ! addInType ) { throw new ExpectedError ( `${ value } is not a valid Office add-in type.` ) ; } return addInType ; } param input throws export function parseAddInTypes ( input ) { if ( input . trim ( ) . toLowerCase ( ) === "all" ) { return getAddInTypes ( ) ; } else { return input . split ( "," ) . map < AddInType > ( ( appString ) => parseAddInType ( appString ) ) ; } } param value export function toAddInType ( value ) { switch ( value . trim ( ) . toLowerCase ( ) ) { case AddInType . Content : return AddInType . Content ; case AddInType . Mail : return AddInType . Mail ; case AddInType . TaskPane : return AddInType . TaskPane ; default : return undefined ; } }