Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use type-fest #12

Merged
merged 5 commits into from
Mar 18, 2019
Merged

Use type-fest #12

merged 5 commits into from
Mar 18, 2019

Conversation

CvX
Copy link
Contributor

@CvX CvX commented Mar 18, 2019

🚀

@@ -28,7 +28,7 @@ import {
} from '.';

expectType<AllElectron | Remote>(api);
expectType<boolean>(api.app.isPackaged);
expectType<boolean | undefined>(api.app.isPackaged);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In electron-api.json isPackaged property isn't marked as required, so in the electron/typescript-definitions generated electron.d.ts file it is added as:

interface App extends EventEmitter {
  ()
  isPackaged?: boolean;
}

hence boolean | undefined.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, the Electron and Node.js type definitions are just so bad...

@sindresorhus sindresorhus merged commit c0b2762 into sindresorhus:master Mar 18, 2019
@sindresorhus
Copy link
Owner

Thanks for doing this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants