All files / src/hosts electron.ts

63.64% Statements 7/11
0% Branches 0/3
25% Functions 1/4
62.5% Lines 5/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                  1x 1x   1x         1x     1x  
import { Host } from './host';
import { Platform } from '../platforms/platform';
import { inject } from 'aurelia-dependency-injection';
import { MaterialDesign } from '../designs/material-design';
import { FrameworkConfiguration } from 'aurelia-framework';
import { Web } from './web';
import { PLATFORM } from 'aurelia-pal';
 
@inject(MaterialDesign)
export class Electron implements Host {
  public type = 'electron';
 
  public get isAvailable() {
    const p = PLATFORM.global.process;
    return p && p.versions && p.versions.electron;
  }
 
  public start(config: FrameworkConfiguration): Promise<Platform> {
    return Promise.resolve().then(() => config.container.get(Web));
  }
}