export enum MessageType { Success , Info , Warning , Error } export interface Message { type : MessageType ; message : string ; } export function instanceOfMessage ( object ) { return 'type' in object && 'message' in object ; }