import { BrowserWindow, BrowserWindowConstructorOptions, LoadFileOptions } from 'electron';
import { ISessionHelper } from '../session/i-session-helper';
import { AppWindow } from './app-window';

export abstract class FileAppWindow extends AppWindow {
  protected loadOptions: LoadFileOptions;

  protected constructor(
    sessionHelper: ISessionHelper,
    uri: string,
    options: BrowserWindowConstructorOptions = {},
    loadOptions: LoadFileOptions = {}
  ) {
    super(sessionHelper, uri, options);
    this.loadOptions = loadOptions;
  }

  protected load(window: BrowserWindow): Promise<void> {
    return window.loadFile(this.uri, this.loadOptions);
  }
}
