Skip to content

orta/node-typescript-web-globals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A project which has the split types/vars branch of TS DOM lib generator which integrates with the Node JS types. See this thread

Changes to node's types:

// For me in here:
+ /// <reference path="../../@typescript/lib-dom/types.d.ts" />

// Real world:
+ /// <reference lib="dom-types" />


+ declare var AbortController: AbortControllerConstructor
- declare var AbortController: {
-     prototype: AbortController;
-     new(): AbortController;
- };

+ declare var AbortSignal: AbortSignalConstructor
- declare var AbortSignal: {
-     prototype: AbortSignal;
-     new(): AbortSignal;
-     // TODO: Add abort() static
- };

The:

/// <reference path="../../@typescript/lib-dom/types.d.ts" />

Would be something like /// <reference lib="dom.type" />.

The tricky part is that this is not backwards compatible, e.g. clients on 4.5 don't have dom.type in their lib and so that would fail. Unsure on what to do there yet.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published