@@ -84,41 +84,34 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
8484document . createElement = newCreateElement ;
8585
8686class Clipboard {
87-
8887 public has ( ) : boolean {
8988 return false ;
9089 }
9190
9291 public writeText ( value : string ) : Promise < void > {
9392 return clipboard . writeText ( value ) ;
9493 }
95-
9694}
9795
9896class Shell {
99-
10097 public async moveItemToTrash ( path : string ) : Promise < void > {
10198 await promisify ( exec ) (
10299 `trash-put --trash-dir ${ escapePath ( "~/.Trash" ) } ${ escapePath ( path ) } ` ,
103100 ) ;
104101 }
105-
106102}
107103
108104class App extends EventEmitter {
109-
110105 public isAccessibilitySupportEnabled ( ) : boolean {
111106 return false ;
112107 }
113108
114109 public setAsDefaultProtocolClient ( ) : void {
115110 throw new Error ( "not implemented" ) ;
116111 }
117-
118112}
119113
120114class Dialog {
121-
122115 public showSaveDialog ( _ : void , options : Electron . SaveDialogOptions , callback : ( filename : string | undefined ) => void ) : void {
123116 const defaultPath = options . defaultPath || "/untitled" ;
124117 const fileIndex = defaultPath . lastIndexOf ( "/" ) ;
@@ -203,11 +196,9 @@ class Dialog {
203196 } ) ;
204197 dialog . show ( ) ;
205198 }
206-
207199}
208200
209201class WebFrame {
210-
211202 public getZoomFactor ( ) : number {
212203 return 1 ;
213204 }
@@ -219,19 +210,15 @@ class WebFrame {
219210 public setZoomLevel ( ) : void {
220211 // Nothing.
221212 }
222-
223213}
224214
225215class Screen {
226-
227216 public getAllDisplays ( ) : [ ] {
228217 return [ ] ;
229218 }
230-
231219}
232220
233221class WebRequest extends EventEmitter {
234-
235222 public onBeforeRequest ( ) : void {
236223 throw new Error ( "not implemented" ) ;
237224 }
@@ -243,28 +230,22 @@ class WebRequest extends EventEmitter {
243230 public onHeadersReceived ( ) : void {
244231 throw new Error ( "not implemented" ) ;
245232 }
246-
247233}
248234
249235class Session extends EventEmitter {
250-
251236 public webRequest = new WebRequest ( ) ;
252237
253238 public resolveProxy ( url : string , callback : ( proxy : string ) => void ) : void {
254239 // TODO: not sure what this actually does.
255240 callback ( url ) ;
256241 }
257-
258242}
259243
260244class WebContents extends EventEmitter {
261-
262245 public session = new Session ( ) ;
263-
264246}
265247
266248class BrowserWindow extends EventEmitter {
267-
268249 public webContents = new WebContents ( ) ;
269250 private representedFilename : string = "" ;
270251
@@ -323,15 +304,13 @@ class BrowserWindow extends EventEmitter {
323304 public setTitle ( value : string ) : void {
324305 document . title = value ;
325306 }
326-
327307}
328308
329309/**
330310 * We won't be able to do a 1 to 1 fill because things like moveItemToTrash for
331311 * example returns a boolean while we need a promise.
332312 */
333313class ElectronFill {
334-
335314 public readonly shell = new Shell ( ) ;
336315 public readonly clipboard = new Clipboard ( ) ;
337316 public readonly app = new App ( ) ;
@@ -382,7 +361,6 @@ class ElectronFill {
382361 } ;
383362 }
384363 // tslint:enable no-any
385-
386364}
387365
388366module . exports = new ElectronFill ( ) ;
0 commit comments