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

Element.setAttribute global is re-declared for the user #615

Closed
mightyiam opened this issue May 10, 2020 · 1 comment · Fixed by #637
Closed

Element.setAttribute global is re-declared for the user #615

mightyiam opened this issue May 10, 2020 · 1 comment · Fixed by #637

Comments

@mightyiam
Copy link
Contributor

// because those in TypeScript are too restrictive: https://github.com/Microsoft/TSJS-lib-generator/pull/237
declare global {
interface Element {
setAttribute(name: string, value: string | number | boolean): void
setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | number | boolean): void
}
}

@mightyiam mightyiam self-assigned this May 10, 2020
@mightyiam mightyiam changed the title Review our declaration of global Element type Review our declaration of Element.setAttribute(NS) May 10, 2020
@mightyiam mightyiam changed the title Review our declaration of Element.setAttribute(NS) Do not re-declare Element.setAttribute for the user May 17, 2020
@mightyiam
Copy link
Contributor Author

This results in a re-declaration of the global for the user — not only in our project.

https://unpkg.com/browse/[email protected]/modules/attributes.d.ts

We should not declare globals for our users if we don't have to. And we don't have to.

@mightyiam mightyiam changed the title Do not re-declare Element.setAttribute for the user Element.setAttribute global is re-declared for the user May 17, 2020
mightyiam added a commit that referenced this issue May 17, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue May 17, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue May 24, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue May 30, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue Jun 13, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue Jun 13, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
mightyiam added a commit that referenced this issue Jun 13, 2020
BREAKING CHANGE: Types exported by this package have re-declared
the global `Element.setAttribute` and `Element.setAttributeNS` to
accept `number` and `boolean` for the `value` parameter. This
change removes that re-declaration and thus the only valid value is
`string`. If your code provides `number` and/or `boolean`, then it
may now fail to compile.

Fixes #615.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant