-
Notifications
You must be signed in to change notification settings - Fork 440
fix: add escape
to CSS
#370
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
Conversation
0ad0cc6
to
fa95e4d
Compare
baselines/dom.generated.d.ts
Outdated
@@ -1819,6 +1819,7 @@ declare var CryptoKeyPair: { | |||
}; | |||
|
|||
interface CSS { | |||
escape(value?: string): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest I am not sure 100% that the value should be a string
as while the input is a DOMString
from the example it seems that It can accept a number.
Example
CSS.escape(".foo#bar") // "\.foo\#bar"
CSS.escape("()[]{}") // "\(\)\[\]\{\}"
CSS.escape('--a') // "--a"
CSS.escape(0) // "\30 ", the Unicode code point of '0' is 30
CSS.escape('\0') // "\ufffd", the Unicode REPLACEMENT CHARACTER
fa95e4d
to
6fc8fc5
Compare
The file is automatically generated. please make your edits in https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json instead. |
Question: I noticed that the |
We have been accepting these lately. |
I think you the new method should go in However, when I do so I end up with something like this; interface CSS {
escape(value: string): string;
}
declare var CSS: {
supports(property: string, value?: string): boolean;
}; Maybe you can point me to the right direction? |
yes. you are correct, addedTypes is the right place. |
Closes: microsoft/TypeScript#21090