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
elsaulio opened this issue Sep 24, 2024 · 1 comment
Open

Use more precise type: Canvas.createPattern #1808

elsaulio opened this issue Sep 24, 2024 · 1 comment

Comments

@elsaulio
Copy link

elsaulio 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;
@elsaulio elsaulio 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;

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