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 more precise type: Canvas.createPattern #1808

Open
3xau1o opened this issue Sep 24, 2024 · 1 comment
Open

Use more precise type: Canvas.createPattern #1808

3xau1o opened this issue Sep 24, 2024 · 1 comment

Comments

@3xau1o
Copy link

3xau1o commented Sep 24, 2024

createPattern arg repetition type is widened to string

however According to MDN should be "repeat" | "repeat-x" | "repeat-y" | "no-repeat"

location in repo
https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/main/baselines/dom.generated.d.ts#L5747

current signature

createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;

expected signature

type PatternRepeatMode = "repeat" | "repeat-x" | "repeat-y" | "no-repeat"

createPattern(image: CanvasImageSource, repetition: PatternRepeatMode | null): CanvasPattern | null;
@3xau1o 3xau1o changed the title Canvas createPattern PatternRepeatMode tyoe Canvas createPattern type Sep 24, 2024
@HolgerJeromin
Copy link
Contributor

Just to make the issue clear:
Currently we have this in current master.

createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;

@3xau1o 3xau1o changed the title Canvas createPattern type User more precise type: Canvas.createPattern Oct 16, 2024
@3xau1o 3xau1o changed the title User more precise type: Canvas.createPattern Use more precise type: Canvas.createPattern Oct 16, 2024
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

No branches or pull requests

2 participants