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

Create DOM-Level specific dom-version.d.ts #2481

Closed
SergioMorchon opened this issue Mar 24, 2015 · 5 comments
Closed

Create DOM-Level specific dom-version.d.ts #2481

SergioMorchon opened this issue Mar 24, 2015 · 5 comments
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript

Comments

@SergioMorchon
Copy link

ECMAScript defines the basics of the script language, but It doesn't competes with the DOM Level API.

DOM API goes separately, as for example the level 2 (see http://www.w3.org/TR/DOM-Level-2-Core/).
Some scenarios, mainly Enterprise ones, Works with legacy version of browsers, which mixes versions of ECMAScript and DOM.

It would be great if we can choose the ES version and the DOM API versión (if we want one... nodejs apps?).

@SergioMorchon SergioMorchon changed the title Create DOM-Level specific .d.ts Create DOM-Level specific dom-version.d.ts Mar 24, 2015
@mhegazy mhegazy added the Suggestion An idea for TypeScript label Mar 24, 2015
@LPGhatguy
Copy link
Contributor

I think this is a good idea.

I also feel that the DOM APIs should be broken out into a dedicated dom.d.ts file that's modular. It would include other typing files that specify certain sets of features (Level 1, Level 2, Web Audio, Custom Elements) that are optional.

I'm not sure how I feel about a dedicated compiler target just for the DOM -- it's just another API.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 25, 2015

would not https://github.com/borisyankov/DefinitelyTyped be a better place for this. users can include dom.level3.d.ts or even dom.chrome.d.ts?

#4168 includes a proposal to allow for picking up pieces of the default library, with this in place, it should be simple to do something like

tsc --lib core, es6 typings\dom.chrome.d.ts test.ts

to get your dom.chrome.d.ts from definitely typed, and get the default js typings from lib.core.d.ts.

@LPGhatguy and @SergioMorchon would this be sufficient to address your scenarios?

@LPGhatguy
Copy link
Contributor

I don't feel that DefinitelyTyped is the appropriate place for first-class browser API definitions to live. Augmenting existing type definitions given in lib.d.ts seems like it could be a nightmare if the two projects are ever desynchronized.

What qualifies a method to be a DOM API candidate for inclusion in lib.d.ts by default?

@SergioMorchon
Copy link
Author

@mhegazy yes! Granularity is the key. I also wanted to use es6 promises, but I still need to target es5, as explained at the purpose #4168...

Great decision, thank you!!

@mhegazy
Copy link
Contributor

mhegazy commented Dec 9, 2015

looks like #4168 and #4692 covers the request here. closing.

@mhegazy mhegazy closed this as completed Dec 9, 2015
@mhegazy mhegazy added the Duplicate An existing issue was already created label Dec 9, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants