Comments (3)
hmm I actually have no idea sorry, but feel free to leave this issue open
in case someone else does
On Thursday, July 23, 2015, Linda_pp [email protected] wrote:
Hi.
I'm using menubar in TypeScript and found an issue.
When I import menubar as below,
// Definition in lib.d.tsdeclare module "menubar" {
function create(opts: Object): any;
export = create;
}
// ...
// main.tsimport * as menu from 'menubar';I got an error
browser/main.ts(3,23): error TS2497: Module '"menubar"' resolves to a non-module entity and cannot be imported using this construct.
It seems that menubar is already defined in TypeScript standard lib.d.ts
https://github.com/Microsoft/TypeScript/blob/a24aa6f57d281bafd3535f0f4c3f492364a8b4d6/bin/lib.d.ts#L16369.
It is defined as global variable and leads to above error.Is there any way to resolve this problem?
Now I avoid this issue in dirty way but it disables type check for whole
menubar module// Now using JS style require...var menu = require('menubar');
—
Reply to this email directly or view it on GitHub
#37.
Sent from my phone
from menubar.
Thanks. I'll do that.
I write the current workaround for me.
I defined the menubar
object as below.
declare class MenuBar implements NodeJS.EventEmitter {
on(event: string, listener: Function): MenuBar;
once(event: string, listener: Function): MenuBar;
removeListener(event: string, listener: Function): MenuBar;
removeAllListeners(event?: string): MenuBar;
setMaxListeners(n: number): void;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
addListener(event: string, listener: Function): MenuBar;
tray: GitHubElectron.Tray;
app: GitHubElectron.App;
window: GitHubElectron.BrowserWindow;
}
And I use it for the returned value from create()
as below.
var mainMenu: MenuBar = require('menubar')(menuConfig);
This is better than the workaround I showed previously because now mainMenu
has a type.
from menubar.
Menubar has since been rewritten into TS. Typings come for free.
from menubar.
Related Issues (20)
- Cannot integrate node in the menubar BrowserWindow HOT 2
- Remote url is getting cached
- Hide from cmd + tab menu HOT 1
- Taskbar with auto-hide on gets overlaid by menubar
- Add support to work with Electron 21 HOT 2
- Question: Site Context Menus HOT 1
- Menubar showing empty white screen with no content, but shows content on the desktop app and the website. HOT 1
- hello-world project cannot run on M1 mac
- Electron Forge x React with Menubar HOT 1
- Incorrect position on multiple monitor HOT 1
- Menubar window is incorrectly positioned when opened while the tray icon is hidden on Windows HOT 1
- Electron menubar not loading file in Production - but working properly in development HOT 4
- Doesn't work in the latest version of electron (v.26) HOT 1
- Cant find window.require with reactjs HOT 1
- Setting an icon makes the app disappear
- The IconTemplate.png overrides my icons when I package my app HOT 2
- Small bug on macos menubar
- add electron 28.x and 29.x support
- Main window's menu disappear when have menubar window HOT 1
- bug(macOS): inconsistent space when using mission control spaces HOT 1
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 menubar.