[Bug]: Custom typings of built-in libs are in conflict with the libs from TypeScript 4.4
See original GitHub issueContact Details
j.vanoostveen@afas.nl
What happened?
When installing tsparticles in combination with TS4.4+, the lib.dom.d.ts reports an error because of a collision with typings of Document
within this library.
node_modules/typescript/lib/lib.dom.d.ts:4256:11 - error TS2430: Interface 'Document' incorrectly extends interface 'FontFaceSource'.
Types of property 'fonts' are incompatible.
Type 'FontFaceSet' is missing the following properties from type 'FontFaceSet': onloading, onloadingdone, onloadingerror, forEach, and 13 more.
4256 interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase {
I don’t understand why there are global definition of the DOM in this library, but it would be preferred they are at least compatible with the built-in definitions provided by TypeScript self.
A minimal repro case can be found here: https://github.com/jvanoostveen/tsparticles-ts4.4
Version
1.19.1
Which library are you using?
Vanilla (tsparticles)
tsParticles Configuration
(any configuration will do...)
confetti(`confettiWrapper`, {
angle: 90,
count: 5,
position: { x: 100, y: 100 },
spread: 100,
startVelocity: 75,
decay: 0.8,
gravity: 2,
drift: 0,
ticks: 75,
colors: ['#ff0000', '#ff8400', '#ffea00', '#00ff00', '#00bbff', '#0000ff', '#ff00ff'],
shapes: ['circle'],
scalar: 1.25,
zIndex: 2000,
disableForReducedMotion: true
});
What browsers are you seeing the problem on?
No response
Relevant log output
node_modules/typescript/lib/lib.dom.d.ts:4256:11 - error TS2430: Interface 'Document' incorrectly extends interface 'FontFaceSource'.
Types of property 'fonts' are incompatible.
Type 'FontFaceSet' is missing the following properties from type 'FontFaceSet': onloading, onloadingdone, onloadingerror, forEach, and 13 more.
4256 interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase {
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TypeScript module versions conflicts · Issue #33137 - GitHub
I've still having problems with TypeScript and types resolution, not only with monorepositories: As i said, npm allows to install more than one ......
Read more >Documentation - TypeScript 4.5
TypeScript 4.5 introduces a way to override a specific built-in lib in a manner similar to how @types/ support works. When deciding which...
Read more >TypeScript 2: custom typings for untyped npm module
If you have custom typings or single loose d.ts files that are not contained withing a folder following ... index.d.ts has declare module...
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
{24,25} conflicting types for 'poll_initwait'" status:RESOLVED ... Bug:270098 - "sys-freebsd/freebsd-lib-7.1: miscompilation with gcc 4.4 without ...
Read more >Common TypeScript module problems and how to solve them
Enabling the compiler module resolution tracing in TypeScript can provide insight in diagnosing and solving problems.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think it could be released in some days, I need to add the auto theme switch feature and it will be ready
1.35.0 has been released, closing this.