Open Andrew-web-coder opened 1 year ago
I think the problem is that TS definitions are wrong, because source has exports.default = openAboutWindow;
but definitions are without default
- export default function openAboutWindow(info_or_img_path: AboutWindowInfo | string): Electron.BrowserWindow;
.
And then this works -
openAboutWindow.default({
icon_path: appIcon
})
but then the problem is with TS complaining about the types
Same, but a little more complex. I try to import in a ts file this way:
import * as openAboutWindow from "about-window";
and then openAboutWindow.default({...})
but it complains that
Same problem with
import openAboutWindow from "about-window";
and then openAboutWindow({...})
.
Could this be caused by the tsconfig.json that says:
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
?
It it a so nice module, but seems I have to return to my old based on electron dialog.showMessageBoxSync
I try to import like this:
import openAboutWindow from 'about-window'
or
import { default as openAboutWindow } from 'about-window'
but all I get is
"openAboutWindow" is not a function
error message