import { File , FileType } from "../../models" ; export enum ViewType { Editor , Markdown , Binary , Viz } export function defaultViewTypeForFileType ( type ) { switch ( type ) { case FileType . Markdown : return ViewType . Markdown ; case FileType . DOT : return ViewType . Viz ; default : return ViewType . Editor ; } } export function isViewFileDirty ( view ) { if ( ! view || ! view . file ) { return false ; } return view . file . isDirty ; } export class View { public file : File ; public type : ViewType ; public state : monaco . editor . ICodeEditorViewState ; constructor ( file , type = ViewType . Editor ) { this . file = file ; this . type = type ; } clone ( ) { return new View ( this . file , this . type ) ; } }