You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
only allows Image and Canvas types as input.
Clearing a pattern fill could be by passing the fillPatternImage an empty string (it could be undefined, but it may be some design decision), which is marked as uncompatible value. So using this one hase to add a @ts-ignore which is an antipattern and also may generates a warning itself in strict mode.
The same goes on any other field, so the code is polluted with @ts-ignore:
This solution has only impact on the .d.ts files.
Accepting undefined and/or null may be even cleaner. However, it has a great impact on the base JS code.
The text was updated successfully, but these errors were encountered:
BalagePMI
changed the title
Missing string type in .d.ts parameters
Missing empty string in .d.ts parameters for non-string types in attributes
Dec 16, 2024
The problem
The .d.ts (typescript mapper) for Shape and many other data types are not supporting string (or at least empty string constant) as input.
For example, the following declaration
only allows Image and Canvas types as input.
Clearing a pattern fill could be by passing the
fillPatternImage
an empty string (it could be undefined, but it may be some design decision), which is marked as uncompatible value. So using this one hase to add a@ts-ignore
which is an antipattern and also may generates a warning itself in strict mode.The same goes on any other field, so the code is polluted with
@ts-ignore
:The suggestion
The values which receives non string values should be extended with empty string pattern as input.
This solution has only impact on the
.d.ts
files.Accepting
undefined
and/ornull
may be even cleaner. However, it has a great impact on the base JS code.The text was updated successfully, but these errors were encountered: