import DOMView from './dom' ; import WebGLView from './webgl' ; import CanvasView from './canvas' ; import ViewController from '../view-controller' ; /**
 * Map of our different View classes.
 */ export const Views = { DOM : DOMView , WebGL : WebGLView , Canvas : CanvasView , } ; /**
 * Potential types of views.
 */ export enum ViewType { Canvas = 'Canvas' , WebGL = 'WebGL' , DOM = 'DOM' } /**
 * Configuration options for Views.
 */ export type ViewOptions = { type : ViewType ; drawGutter ? : boolean ; gutterPadding ? : [ number , number ] ; editorPadding ? : [ number , number ] ; scrollPastEnd ? : boolean ; } ; /**
 * Information about the current viewport. Measured in lines and characters.
 */ export type Viewport = { lineStart : number ; lineEnd : number ; charStart : number ; charEnd : number ; } ; /**
 * Interface for each view.
 */ export interface View { render ( ) : void ; resize ( width , height ) : void ; scrollTo ( line , char ) : void ; posFromCoords ( x , y , rect ) : [ number , number ] ; getViewport ( ) : Viewport ; } export interface FontMetrics { fontString ( ) : string ; } param { ViewType } type param { ViewController } controller param { Object } opts return { View } export function createView ( controller , opts ) { const View = < any > Views [ opts . type ] ; return new View ( controller , opts ) ; }