You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"external types" for d.ts files dependent on others #1402
Bigger d.ts files depend on multiple big d.ts files, which again depend on others. (Example: atom.d.ts, ...) Collecting all those required files may not only be painful but also be unnecessary, especially for those who just want to use a specific part of a d.ts file that is not dependent on anything.
A method to specify external types can help here, allowing users to exclude unwanted declaration files.
// jszip.d.ts/// <reference path="../node/node.d.ts" />externalinterface Buffer: "../node/node.d.ts";// use.d.ts/// <referernce path="jszip.d.ts" />varzip: JSZipObject;vartext=zip.asText();// works fine without node.d.tsvarbuffer=zip.asNodeBuffer();// typeof any when there is no node.d.ts;// No error but a warning: "interface Buffer should be defined by "node.d.ts"
interface Buffer { } may just work here, but not for classes as they are not open-ended.
// bar.d.ts/// <reference path="foo.d.ts" />;externalclass Foo: "foo.d.ts";// This should not block Foo definition by foo.d.tsinterfaceBar{foo: Foo;}
This should be covered by ES6 module alignment. See the named import functionality like what's in 5.1 here http://www.2ality.com/2014/09/es6-modules-final.html We wouldn't want to do any TS specific syntax here that risks incompatibility with ES6+ versions.
Activity
danquirk commentedon Dec 8, 2014
This should be covered by ES6 module alignment. See the named import functionality like what's in 5.1 here http://www.2ality.com/2014/09/es6-modules-final.html We wouldn't want to do any TS specific syntax here that risks incompatibility with ES6+ versions.
saschanaz commentedon Dec 9, 2014
Thank you for the information! :)