11/// <reference path="../../localtypings/monaco.d.ts" />
22
3- import { MonacoFieldEditor , MonacoFieldEditorDefinition , MonacoFieldEditorHost , TextEdit } from "../../pxteditor" ;
43import * as compiler from "./compiler" ;
54import * as pkg from "./package" ;
65
@@ -11,7 +10,7 @@ interface OwnedRange {
1110 id : number ;
1211}
1312
14- export class ViewZoneEditorHost implements MonacoFieldEditorHost , monaco . editor . IViewZone {
13+ export class ViewZoneEditorHost implements pxt . editor . MonacoFieldEditorHost , monaco . editor . IViewZone {
1514 domNode : HTMLDivElement ;
1615 afterLineNumber : number ;
1716 heightInPx = 520 ;
@@ -26,7 +25,7 @@ export class ViewZoneEditorHost implements MonacoFieldEditorHost, monaco.editor.
2625
2726 suppressMouseDown = false ;
2827
29- constructor ( protected fe : MonacoFieldEditor , protected range : monaco . Range , protected model : monaco . editor . IModel ) {
28+ constructor ( protected fe : pxt . editor . MonacoFieldEditor , protected range : monaco . Range , protected model : monaco . editor . IModel ) {
3029 this . afterLineNumber = range . endLineNumber ;
3130
3231 const outer = document . createElement ( "div" ) ;
@@ -52,7 +51,7 @@ export class ViewZoneEditorHost implements MonacoFieldEditorHost, monaco.editor.
5251 return this . content ;
5352 }
5453
55- showAsync ( fileType : pxt . editor . FileType , editor : monaco . editor . IStandaloneCodeEditor ) : Promise < TextEdit > {
54+ showAsync ( fileType : pxt . editor . FileType , editor : monaco . editor . IStandaloneCodeEditor ) : Promise < pxt . editor . TextEdit > {
5655 this . fileType = fileType ;
5756 this . editor = editor ;
5857 return compiler . getBlocksAsync ( )
@@ -132,10 +131,10 @@ export class ViewZoneEditorHost implements MonacoFieldEditorHost, monaco.editor.
132131 }
133132}
134133
135- export class ModalEditorHost implements MonacoFieldEditorHost {
134+ export class ModalEditorHost implements pxt . editor . MonacoFieldEditorHost {
136135 protected blocks : pxtc . BlocksInfo ;
137136
138- constructor ( protected fe : MonacoFieldEditor , protected range : monaco . Range , protected model : monaco . editor . IModel ) {
137+ constructor ( protected fe : pxt . editor . MonacoFieldEditor , protected range : monaco . Range , protected model : monaco . editor . IModel ) {
139138 }
140139
141140 contentDiv ( ) : HTMLDivElement {
@@ -164,7 +163,7 @@ export class ModalEditorHost implements MonacoFieldEditorHost {
164163 return this . package ( ) . host ( ) . readFile ( pkg . mainPkg , filename ) ;
165164 }
166165
167- showAsync ( fileType : pxt . editor . FileType , editor : monaco . editor . IStandaloneCodeEditor ) : Promise < TextEdit > {
166+ showAsync ( fileType : pxt . editor . FileType , editor : monaco . editor . IStandaloneCodeEditor ) : Promise < pxt . editor . TextEdit > {
168167 return compiler . getBlocksAsync ( )
169168 . then ( bi => {
170169 this . blocks = bi ;
@@ -179,7 +178,7 @@ export class ModalEditorHost implements MonacoFieldEditorHost {
179178}
180179
181180export class FieldEditorManager implements monaco . languages . FoldingRangeProvider {
182- protected fieldEditors : MonacoFieldEditorDefinition [ ] = [ ] ;
181+ protected fieldEditors : pxt . editor . MonacoFieldEditorDefinition [ ] = [ ] ;
183182 protected decorations : pxt . Map < string [ ] > = { } ;
184183 protected liveRanges : OwnedRange [ ] = [ ] ;
185184 protected fieldEditorsEnabled = true ;
@@ -213,7 +212,7 @@ export class FieldEditorManager implements monaco.languages.FoldingRangeProvider
213212 }
214213 }
215214
216- addFieldEditor ( definition : MonacoFieldEditorDefinition ) {
215+ addFieldEditor ( definition : pxt . editor . MonacoFieldEditorDefinition ) {
217216 for ( const f of this . fieldEditors ) {
218217 if ( f . id === definition . id ) return ;
219218 }
0 commit comments