options.offset type is incomplete in both style/FillPattern.js and style/StrokePattern.js #955
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In both
style/FillPattern.js
andstyle/StrokePattern.js
, parameteroptions.offset
is typed as:@param {number} options.offset pattern offset for hash/dot/circle/cross pattern
However, the code in both classes also accepts an 2-dimensional array of numbers [x,y], and this is sometimes a must-have option (for ex. if you have hatches oriented at an angle of 135°, you can't simply pass a single number in the
options.offset
: it won't work! In such cases, you definitely need to pass an array of 2 different numbers).Thus, the correct code should be:
@param {number|[number, number]} options.offset pattern offset for hash/dot/circle/cross pattern
Note that it also impacts incorrect (incomplete) types to be generated by
Siedlrchr/types-ol-ext
.Thanks for all your amazing work on this project,
Best regards