Comments (6)
I solved using:
(<any>global).sharedObject = {
someProperty: string
};
from electron-quick-start-typescript.
interface SharedObject {
someProperty: string;
};
declare const sharedObject: SharedObject = { ... }
Does it work for you?
from electron-quick-start-typescript.
@Leonardonline Thank you. I faced the same issue and your solution helped!
from electron-quick-start-typescript.
I tried but it doesn't work, it doesn't get the data.
from electron-quick-start-typescript.
Here a repo where I replicate my error and @theJian solution, but unfortunately not working
https://github.com/Leonardonline/electron-quick-start-typescript
from electron-quick-start-typescript.
Create a global.d.ts file in your project.
declare namespace NodeJS{
export interface Global {
myVar: number
}
}
This will merge the base NodeJS declarations with yours, so you can write global.myVar
in your code. I couldn't figure out how to specify existing interfeces, so I use : any for my global settingsService
from electron-quick-start-typescript.
Related Issues (20)
- How to remove [exports.__esModule = true;] in js file? HOT 2
- electron-reload typescript compiled to a wrong object ( to be electronReload['default']) HOT 1
- Doesn't work on macOS HOT 2
- Code Protection
- Make this a template repository HOT 1
- Uncaught ReferenceError: exports is not defined HOT 18
- How to enable the Zero-Copy Video Capture flag setting in electron?
- Archive this repository HOT 2
- npm start not work HOT 4
- Cannot start project
- v6 still get problems, electron-packager get problems
- Use concurrently
- Type 'null' is not assignable to type 'BrowserWindow'. HOT 2
- Replace TSLint with ESLint HOT 1
- Upgrade dependencies v8.2.0
- Test issue HOT 1
- require or import statement don't work in "renderer.ts" HOT 2
- DELETEME PLEASE
- Desktop capturer doesn't work with this template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-quick-start-typescript.