-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Updated dom related reference files according to new IE spec #2739
Updated dom related reference files according to new IE spec #2739
Conversation
Updated the dom files according to new IE spec. Remove part of the IE only types in "extensions.d.ts" that are not used in the new spec.
Hi @zhengbli, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
some comments:
|
Added document string; changed back some method param types of interface Console from 'any' to 'string'; Removed static members from interface instance definition; Sorted overloads of 'addEventListener's by event name; Removed unnecessary declaration of the 'addEventListener' method in some interfaces; For method overloads, moved the most generic ones to the last; Removed named-constructors and dictionary interfaces from webworkers.generated.d.ts (including Audio, Image etc); Made all string overloads of 'getElementsByTagName' lower case for consistency.
I updated the files according to the comments. And because |
Replaced the interfaces using the ones in es.d.ts
TextTrack.mode type is other than that looks good 👍 |
Updated dom related reference files according to new IE spec
What is the recommendation for using Map and Set when compiling with --target ES5? Right now I'm using a <reference...> to lib.es6.d.ts, which makes compile succeed, but seems wrong. Apologies if this is the wrong place to ask this; this pull request is referenced in https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes |
@DustinWehr can you explain your scenario? what other types do you need from ES6 definitions that are not in lib.d.ts. |
@DustinWehr the issue is these were IE-specific and were removed as part of the cleanup. it should be safe to include just the definitions in a file in your project, and it should behave the same as in 1.4. interface Map<K, V> {
clear(): void;
delete(key: K): boolean;
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
get(key: K): V;
has(key: K): boolean;
set(key: K, value: V): Map<K, V>;
size: number;
}
declare var Map: {
new <K, V>(): Map<K, V>;
prototype: Map<any, any>;
}
interface Set<T> {
add(value: T): Set<T>;
clear(): void;
delete(value: T): boolean;
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
has(value: T): boolean;
size: number;
}
declare var Set: {
new <T>(): Set<T>;
prototype: Set<any>;
} |
(Open a new PR that sorts the old dom files first for better diff)
The IE team started to issue new specs in the format of XML files instead of webidl files for upcoming API changes. The new dom.generated.d.ts and webworker.d.ts are generated from the new XML specs to be consistent with IE Dom API changes.
Related to PR #2645.
Issues that would be fixed:
#2437 Missing properties: document.pointerLockElement and MouseEvent.movement
#2416 WheelEvent constructor in lib.d.ts
#2029 Type definition of CustomEvent constructor needs parameter(s).
#1852 DOMStringMap is defined as an empty interface - this makes it awkward to use
#1850 "SOURCE"
#1618 "getElementsByTagName('svg')" does not returns NodeList of SVGSVGElement, but generic NodeList.
#1302 add declarations for HTML Touch events to lib.d.ts
#1224 EventListener interface does not accept objects with a handleEvent method
(not sure) #1075 IDBKeyRange definition is degraded
#674 MouseEvent constructor is missing parameters
#314 SourceBuffer.appendBuffer() is missing overload for ArrayBufferView param in lib.d.ts