Code Monkey home page Code Monkey logo

electron-quick-start-typescript's Introduction

Caution

This template is deprecated. To get started with an Electron + TypeScript project, we highly recommend starting with Electron Forge's official TypeScript templates.

electron-quick-start-typescript

Clone and run for a quick way to see Electron in action.

This is a TypeScript port of the Electron Quick Start repo -- a minimal Electron application based on the Quick Start Guide within the Electron documentation.

Use this app along with the Electron API Demos app for API code examples to help you get started.

A basic Electron application needs just these files:

  • package.json - Points to the app's main file and lists its details and dependencies.
  • main.ts - Starts the app and creates a browser window to render HTML. This is the app's main process.
  • index.html - A web page to render. This is the app's renderer process.

You can learn more about each of these components within the Quick Start Guide.

To Use

To clone and run this repository you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
git clone https://github.com/electron/electron-quick-start-typescript
# Go into the repository
cd electron-quick-start-typescript
# Install dependencies
npm install
# Run the app
npm start

Note: If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

Re-compile automatically

To recompile automatically and to allow using electron-reload, run this in a separate terminal:

npm run watch

Resources for Learning Electron

License

CC0 1.0 (Public Domain)

electron-quick-start-typescript's People

Contributors

ckerr avatar codebytere avatar dependabot[bot] avatar dpavlou avatar dsanders11 avatar erickzhao avatar leonardonline avatar malept avatar naofumi-fujii avatar vanessayuenn avatar vazra avatar vhashimotoo avatar vladneacsu avatar worldsayshi avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-quick-start-typescript's Issues

Uncaught ReferenceError: exports is not defined

Thanks for updating this repository to use the newest version of Electron. I was trying to use it but I have a problem with React. When I try to import I get the Uncaught ReferenceError: exports is not defined. I've tried several solutions found on Stackoverflow and GitHub but nothing works. I've also tried nodeIntegration: true but it doesn't seem to work either. It exposes window.require function but it doesn't add module.exports. I don't know what's wrong with that.

Replace TSLint with ESLint

Due to the fact, that TSLint was deprecated by the developer, it should be replaced with the better ESLint.

Doesn't work on macOS

Works perfectly fine on my Windows machine but if I try to start it with macOS I get a white screen as if the preload script is never reached

Code Protection

Who will not like their code to be safe and by safe I mean ‘not getting stolen’. The files aren’t encrypted which means that anyone can get a working copy of the code.

I could be extremely wrong.

Any way to resolve this?

TypeError: electron_1.BrowserWindow is not a constructor

I'm using this typescript boilerplate for electron. The main process is working but when i use renderer process to create a modal window i'm getting this error. As i searched it is because of when compiling to js there is no .remote present. Please provide basic instructions to use renderer process

Sourcemap is not working in the renderer

  • Add a console.log() and a debugger; in renderer.ts
  • Run npm start
  • Open devtools
  • The console.log is not mapped to src/renderer.ts but dist/renderer.js

image

Sourcemap seems correct to me and I wonder if it may be an electron issue...

electron-quick-start-typescript version 2cc1f0f
electron version 2.0.2
tsc version 2.7.2

Sharing global object

The documentation shows how to share data between pages:

// In the main process.
global.sharedObject = {
  someProperty: 'default value'
}

but with Typescript version, we get this error:

error TS2339: Property 'sharedObject' does not exist on type 'Global'.

Cannot start project

I have installed node module, when i start these error below

node_modules/typescript/lib/lib.dom.d.ts:16231:14
16231 readonly RENDERBUFFER_BINDING: GLenum;
~~~~~~~~~~~~~~~~~~~~
'RENDERBUFFER_BINDING' was also declared here.

../../node_modules/@types/web/index.d.ts:25284:14 - error TS2717: Subsequent property declarations must have the same type. Property 'MAX_RENDERBUFFER_SIZE' must be of type 'number', but here has type '34024'.

25284 readonly MAX_RENDERBUFFER_SIZE: 0x84E8;
~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16196:14
16196 readonly MAX_RENDERBUFFER_SIZE: GLenum;
~~~~~~~~~~~~~~~~~~~~~
'MAX_RENDERBUFFER_SIZE' was also declared here.

../../node_modules/@types/web/index.d.ts:25285:14 - error TS2717: Subsequent property declarations must have the same type. Property 'INVALID_FRAMEBUFFER_OPERATION' must be of type 'number', but here has type '1286'.

25285 readonly INVALID_FRAMEBUFFER_OPERATION: 0x0506;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16174:14
16174 readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'INVALID_FRAMEBUFFER_OPERATION' was also declared here.

../../node_modules/@types/web/index.d.ts:25286:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNPACK_FLIP_Y_WEBGL' must be of type 'number', but here has type '37440'.

25286 readonly UNPACK_FLIP_Y_WEBGL: 0x9240;
~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16339:14
16339 readonly UNPACK_FLIP_Y_WEBGL: GLenum;
~~~~~~~~~~~~~~~~~~~
'UNPACK_FLIP_Y_WEBGL' was also declared here.

../../node_modules/@types/web/index.d.ts:25287:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNPACK_PREMULTIPLY_ALPHA_WEBGL' must be of type 'number', but here has type '37441'.

25287 readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16340:14
16340 readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'UNPACK_PREMULTIPLY_ALPHA_WEBGL' was also declared here.

../../node_modules/@types/web/index.d.ts:25288:14 - error TS2717: Subsequent property declarations must have the same type. Property 'CONTEXT_LOST_WEBGL' must be of type 'number', but here has type '37442'.

25288 readonly CONTEXT_LOST_WEBGL: 0x9242;
~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16104:14
16104 readonly CONTEXT_LOST_WEBGL: GLenum;
~~~~~~~~~~~~~~~~~~
'CONTEXT_LOST_WEBGL' was also declared here.

../../node_modules/@types/web/index.d.ts:25289:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNPACK_COLORSPACE_CONVERSION_WEBGL' must be of type 'number', but here has type '37443'.

25289 readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16338:14
16338 readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'UNPACK_COLORSPACE_CONVERSION_WEBGL' was also declared here.

../../node_modules/@types/web/index.d.ts:25290:14 - error TS2717: Subsequent property declarations must have the same type. Property 'BROWSER_DEFAULT_WEBGL' must be of type 'number', but here has type '37444'.

25290 readonly BROWSER_DEFAULT_WEBGL: 0x9244;
~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16090:14
16090 readonly BROWSER_DEFAULT_WEBGL: GLenum;
~~~~~~~~~~~~~~~~~~~~~
'BROWSER_DEFAULT_WEBGL' was also declared here.

../../node_modules/@types/web/index.d.ts:25506:14 - error TS2717: Subsequent property declarations must have the same type. Property 'CONNECTING' must be of type 'number', but here has type '0'.

25506 readonly CONNECTING: 0;
~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16499:14
16499 readonly CONNECTING: number;
~~~~~~~~~~
'CONNECTING' was also declared here.

../../node_modules/@types/web/index.d.ts:25507:14 - error TS2717: Subsequent property declarations must have the same type. Property 'OPEN' must be of type 'number', but here has type '1'.

25507 readonly OPEN: 1;
~~~~

node_modules/typescript/lib/lib.dom.d.ts:16500:14
16500 readonly OPEN: number;
~~~~
'OPEN' was also declared here.

../../node_modules/@types/web/index.d.ts:25508:14 - error TS2717: Subsequent property declarations must have the same type. Property 'CLOSING' must be of type 'number', but here has type '2'.

25508 readonly CLOSING: 2;
~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16498:14
16498 readonly CLOSING: number;
~~~~~~~
'CLOSING' was also declared here.

../../node_modules/@types/web/index.d.ts:25509:14 - error TS2717: Subsequent property declarations must have the same type. Property 'CLOSED' must be of type 'number', but here has type '3'.

25509 readonly CLOSED: 3;
~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16497:14
16497 readonly CLOSED: number;
~~~~~~
'CLOSED' was also declared here.

../../node_modules/@types/web/index.d.ts:25516:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'WebSocket' must be of type '{ new (url: string | URL, protocols?: string | string[]): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; }', but here has type '{ new (url: string | URL, protocols?: string | string[]): WebSocket; prototype: WebSocket; readonly CONNECTING: 0; readonly OPEN: 1; readonly CLOSING: 2; readonly CLOSED: 3; }'.

25516 declare var WebSocket: {
~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16507:13
16507 declare var WebSocket: {
~~~~~~~~~
'WebSocket' was also declared here.

../../node_modules/@types/web/index.d.ts:25629:14 - error TS2717: Subsequent property declarations must have the same type. Property 'DOM_DELTA_PIXEL' must be of type 'number', but here has type '0'.

25629 readonly DOM_DELTA_PIXEL: 0x00;
~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16524:14
16524 readonly DOM_DELTA_PIXEL: number;
~~~~~~~~~~~~~~~
'DOM_DELTA_PIXEL' was also declared here.

../../node_modules/@types/web/index.d.ts:25630:14 - error TS2717: Subsequent property declarations must have the same type. Property 'DOM_DELTA_LINE' must be of type 'number', but here has type '1'.

25630 readonly DOM_DELTA_LINE: 0x01;
~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16522:14
16522 readonly DOM_DELTA_LINE: number;
~~~~~~~~~~~~~~
'DOM_DELTA_LINE' was also declared here.

../../node_modules/@types/web/index.d.ts:25631:14 - error TS2717: Subsequent property declarations must have the same type. Property 'DOM_DELTA_PAGE' must be of type 'number', but here has type '2'.

25631 readonly DOM_DELTA_PAGE: 0x02;
~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16523:14
16523 readonly DOM_DELTA_PAGE: number;
~~~~~~~~~~~~~~
'DOM_DELTA_PAGE' was also declared here.

../../node_modules/@types/web/index.d.ts:25634:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'WheelEvent' must be of type '{ new (type: string, eventInitDict?: WheelEventInit): WheelEvent; prototype: WheelEvent; readonly DOM_DELTA_LINE: number; readonly DOM_DELTA_PAGE: number; readonly DOM_DELTA_PIXEL: number; }', but here has type '{ new (type: string, eventInitDict?: WheelEventInit): WheelEvent; prototype: WheelEvent; readonly DOM_DELTA_PIXEL: 0; readonly DOM_DELTA_LINE: 1; readonly DOM_DELTA_PAGE: 2; }'.

25634 declare var WheelEvent: {
~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16527:13
16527 declare var WheelEvent: {
~~~~~~~~~~
'WheelEvent' was also declared here.

../../node_modules/@types/web/index.d.ts:25914:5 - error TS2374: Duplicate index signature for type 'number'.

25914 [index: number]: Window;
~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/@types/web/index.d.ts:26315:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNSENT' must be of type 'number', but here has type '0'.

26315 readonly UNSENT: 0;
~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16934:14
16934 readonly UNSENT: number;
~~~~~~
'UNSENT' was also declared here.

../../node_modules/@types/web/index.d.ts:26316:14 - error TS2717: Subsequent property declarations must have the same type. Property 'OPENED' must be of type 'number', but here has type '1'.

26316 readonly OPENED: 1;
~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16933:14
16933 readonly OPENED: number;
~~~~~~
'OPENED' was also declared here.

../../node_modules/@types/web/index.d.ts:26317:14 - error TS2717: Subsequent property declarations must have the same type. Property 'HEADERS_RECEIVED' must be of type 'number', but here has type '2'.

26317 readonly HEADERS_RECEIVED: 2;
~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16931:14
16931 readonly HEADERS_RECEIVED: number;
~~~~~~~~~~~~~~~~
'HEADERS_RECEIVED' was also declared here.

../../node_modules/@types/web/index.d.ts:26318:14 - error TS2717: Subsequent property declarations must have the same type. Property 'LOADING' must be of type 'number', but here has type '3'.

26318 readonly LOADING: 3;
~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16932:14
16932 readonly LOADING: number;
~~~~~~~
'LOADING' was also declared here.

../../node_modules/@types/web/index.d.ts:26319:14 - error TS2717: Subsequent property declarations must have the same type. Property 'DONE' must be of type 'number', but here has type '4'.

26319 readonly DONE: 4;
~~~~

node_modules/typescript/lib/lib.dom.d.ts:16930:14
16930 readonly DONE: number;
~~~~
'DONE' was also declared here.

../../node_modules/@types/web/index.d.ts:26326:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'XMLHttpRequest' must be of type '{ new (): XMLHttpRequest; prototype: XMLHttpRequest; readonly DONE: number; readonly HEADERS_RECEIVED: number; readonly LOADING: number; readonly OPENED: number; readonly UNSENT: number; }', but here has type '{ new (): XMLHttpRequest; prototype: XMLHttpRequest; readonly UNSENT: 0; readonly OPENED: 1; readonly HEADERS_RECEIVED: 2; readonly LOADING: 3; readonly DONE: 4; }'.

26326 declare var XMLHttpRequest: {
~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:16941:13
16941 declare var XMLHttpRequest: {
~~~~~~~~~~~~~~
'XMLHttpRequest' was also declared here.

../../node_modules/@types/web/index.d.ts:26455:14 - error TS2717: Subsequent property declarations must have the same type. Property 'ANY_TYPE' must be of type 'number', but here has type '0'.

26455 readonly ANY_TYPE: 0;
~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17038:14
17038 readonly ANY_TYPE: number;
~~~~~~~~
'ANY_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26456:14 - error TS2717: Subsequent property declarations must have the same type. Property 'NUMBER_TYPE' must be of type 'number', but here has type '1'.

26456 readonly NUMBER_TYPE: 1;
~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17042:14
17042 readonly NUMBER_TYPE: number;
~~~~~~~~~~~
'NUMBER_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26457:14 - error TS2717: Subsequent property declarations must have the same type. Property 'STRING_TYPE' must be of type 'number', but here has type '2'.

26457 readonly STRING_TYPE: 2;
~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17045:14
17045 readonly STRING_TYPE: number;
~~~~~~~~~~~
'STRING_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26458:14 - error TS2717: Subsequent property declarations must have the same type. Property 'BOOLEAN_TYPE' must be of type 'number', but here has type '3'.

26458 readonly BOOLEAN_TYPE: 3;
~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17040:14
17040 readonly BOOLEAN_TYPE: number;
~~~~~~~~~~~~
'BOOLEAN_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26459:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNORDERED_NODE_ITERATOR_TYPE' must be of type 'number', but here has type '4'.

26459 readonly UNORDERED_NODE_ITERATOR_TYPE: 4;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17046:14
17046 readonly UNORDERED_NODE_ITERATOR_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'UNORDERED_NODE_ITERATOR_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26460:14 - error TS2717: Subsequent property declarations must have the same type. Property 'ORDERED_NODE_ITERATOR_TYPE' must be of type 'number', but here has type '5'.

26460 readonly ORDERED_NODE_ITERATOR_TYPE: 5;
~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17043:14
17043 readonly ORDERED_NODE_ITERATOR_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~~~~
'ORDERED_NODE_ITERATOR_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26461:14 - error TS2717: Subsequent property declarations must have the same type. Property 'UNORDERED_NODE_SNAPSHOT_TYPE' must be of type 'number', but here has type '6'.

26461 readonly UNORDERED_NODE_SNAPSHOT_TYPE: 6;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17047:14
17047 readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'UNORDERED_NODE_SNAPSHOT_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26462:14 - error TS2717: Subsequent property declarations must have the same type. Property 'ORDERED_NODE_SNAPSHOT_TYPE' must be of type 'number', but here has type '7'.

26462 readonly ORDERED_NODE_SNAPSHOT_TYPE: 7;
~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17044:14
17044 readonly ORDERED_NODE_SNAPSHOT_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~~~~
'ORDERED_NODE_SNAPSHOT_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26463:14 - error TS2717: Subsequent property declarations must have the same type. Property 'ANY_UNORDERED_NODE_TYPE' must be of type 'number', but here has type '8'.

26463 readonly ANY_UNORDERED_NODE_TYPE: 8;
~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17039:14
17039 readonly ANY_UNORDERED_NODE_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~
'ANY_UNORDERED_NODE_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26464:14 - error TS2717: Subsequent property declarations must have the same type. Property 'FIRST_ORDERED_NODE_TYPE' must be of type 'number', but here has type '9'.

26464 readonly FIRST_ORDERED_NODE_TYPE: 9;
~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17041:14
17041 readonly FIRST_ORDERED_NODE_TYPE: number;
~~~~~~~~~~~~~~~~~~~~~~~
'FIRST_ORDERED_NODE_TYPE' was also declared here.

../../node_modules/@types/web/index.d.ts:26467:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'XPathResult' must be of type '{ new (): XPathResult; prototype: XPathResult; readonly ANY_TYPE: number; readonly ANY_UNORDERED_NODE_TYPE: number; readonly BOOLEAN_TYPE: number; readonly FIRST_ORDERED_NODE_TYPE: number; ... 5 more ...; readonly UNORDERED_NODE_SNAPSHOT_TYPE: number; }', but here has type '{ new (): XPathResult; prototype: XPathResult; readonly ANY_TYPE: 0; readonly NUMBER_TYPE: 1; readonly STRING_TYPE: 2; readonly BOOLEAN_TYPE: 3; readonly UNORDERED_NODE_ITERATOR_TYPE: 4; ... 4 more ...; readonly FIRST_ORDERED_NODE_TYPE: 9; }'.

26467 declare var XPathResult: {
~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17050:13
17050 declare var XPathResult: {
~~~~~~~~~~~
'XPathResult' was also declared here.

../../node_modules/@types/web/index.d.ts:26688:9 - error TS2717: Subsequent property declarations must have the same type. Property 'value' must be of type 'any', but here has type 'ValueTypeMap[T]'.

26688 value: ValueTypeMap[T];
~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17125:9
17125 value: any;
~~~~~
'value' was also declared here.

../../node_modules/@types/web/index.d.ts:26693:9 - error TS2403: Subsequent variable declarations must have the same type. Variable 'Global' must be of type '{ new (descriptor: GlobalDescriptor, v?: any): Global; prototype: Global; }', but here has type '{ new (descriptor: GlobalDescriptor, v?: ValueTypeMap[T]): Global; prototype: Global<...>; }'.

26693 var Global: {
~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17129:9
17129 var Global: {
~~~~~~
'Global' was also declared here.

../../node_modules/@types/web/index.d.ts:26774:9 - error TS2717: Subsequent property declarations must have the same type. Property 'value' must be of type 'ValueType', but here has type 'T'.

26774 value: T;
~~~~~

node_modules/typescript/lib/lib.dom.d.ts:17196:9
17196 value: ValueType;
~~~~~
'value' was also declared here.

electron-reload typescript compiled to a wrong object ( to be electronReload['default'])

I am trying to learn typescript with electron a bit, using a template "electron-quick-start-typescript" (https://github.com/electron/electron-quick-start-typescript). I want to add a hot reload function to the template so I could hot reload while editing the code. I am trying to add

import electronReload from "electron-reload";
electronReload(__dirname, {});

these two lines of code, but after the compilation it became

var electron_reload_1 = require("electron-reload");
(0, electron_reload_1["default"])(__dirname, {});

where electron_reload_1["default"] cannot be recognised. I can run the compiled js while I manually changed electron_reload_1["default"] to electron_reload_1.

I guess the problem is because in electron-reload lib, it is not using export default module to export a function. Does anyone has experience on making typescript + electron hot reloadable? Thank you.

How to remove [exports.__esModule = true;] in js file?

When I use "import { ipcRenderer } from 'electron';" in renderer.ts file, I got "exports.__esModule = true;"
And Electron will error!

renderer.ts

import { ipcRenderer } from 'electron';

renderer.js

exports.__esModule = true;

electron error:

renderer.js:2 Uncaught ReferenceError: exports is not defined

When I delete this in renderer.js and only Run Electron, Electron not error!

Old Electron Version

This uses a very old version of electron (2.0.2 vs 3.*. As a scaffolding for starter projects/learning, this would be much nicer if more up to date. I will likely submit a PR when I get my micro type-script + electron app running...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.