types / env-electron Goto Github PK
View Code? Open in Web Editor NEWThe type definition for https://github.com/electron/electron
License: MIT License
The type definition for https://github.com/electron/electron
License: MIT License
My code is:
import { BrowserWindow } from 'electron'
function doSomeOnWindow(win: BrowserWindow) {
win.loadURL('...')
}
It is wrong:
error TS2304: Cannot find name 'BrowserWindow'
So how do I correct it?
Relevant changelog notes:
https://github.com/typed-typings/env-electron/blob/master/index.d.ts#L4226-L4228. I can't see any actual value coming from that, and I feel like it's very brittle - the users node typings may not have this interface exposed ambiently.
I ran typings install env~electron
but got not found error
typings ERR! message https://api.typings.org/entries/npm/env~electron responded with 404, expected it to equal 200
typings ERR! cwd /Users/xxxxxxx
typings ERR! system Darwin 15.6.0
typings ERR! command "/Users/xxxxxx/.nvm/versions/node/v5.0.0/bin/node" "/usr/local/bin/typings" "info" "env~electron"
typings ERR! node -v v5.0.0
typings ERR! typings -v 0.7.12
typings ERR! code EINVALIDSTATUS
It's currently specified as any
.
Documentation: http://electron.atom.io/docs/v0.37.6/api/session/#seswebrequest
@unional Are you still using this? I noticed some updates have some through DefinitelyTyped by @miniak - see https://github.com/DefinitelyTyped/DefinitelyTyped/commits/master/github-electron/github-electron.d.ts. @miniak Is there anything we can do to help you perhaps?
Related to typings/registry#980
Electron is working on providing an official electron.d.ts (automatically generated from the API docs) electron/electron#4875. Please raise any concerns / ideas there.
This copy is very badly outdated and should not be used.
This one is tricky, but generally valuable. Currently the type definition is directly tied to the current Node.js type definition shape on DefinitelyTyped. I'd love to move away from relying on ambient shapes and instead rely on the actual exposed types. E.g. Change from relying on NodeJS.EventEmitter
to import { EventEmitter } from 'events'
. Basically, making dependencies explicit and mirroring what exists at runtime instead of relying on implicit and ambient interfaces.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.