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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -