Importing Electron classes with Typescript -
how can import electron classes typescript file, intellisense functioning?
for example, i'd turn this:
var browserwindow = require('browser-window'); var app = require('app'); app.on("ready", function() { var mainwindow = new browserwindow({ width: 600, height: 800 }); });
into (doesn't work):
/// <reference path="./typings/github-electron/github-electron.d.ts"/> var app = githubelectron.app; app.on("ready", function() { var mainwindow = new githubelectron.browserwindow({ width: 600, height: 800 }); });
use type annotations on return values of require
function calls:
var browserwindow: githubelectron.browserwindow = require('browser-window'); var app = githubelectron.app = require('app'); app.on("ready", function() { var mainwindow = new browserwindow({ width: 600, height: 800 }); });
Comments
Post a Comment