Mike Gerwitz

Activist for User Freedom

path: root/doc
diff options
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-23 10:39:04 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-24 10:30:14 -0400
commit8f7afd22e50b1718e062c54701e258e5ca2ad715 (patch)
tree5d1dc3a1cfdcc8c7e664d885e84b35c708981fb7 /doc
parentfa80c79650a31377f518a4a785693c8683e4dc0f (diff)
doc/hacking.texi (TypeScript Migration): .d.ts reference
The original suggestion for interfaces (see diff) is much more confusing. We've found .d.ts files to work well for incremental migration.
Diffstat (limited to 'doc')
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/hacking.texi b/doc/hacking.texi
index b445e10..f848bb6 100644
--- a/doc/hacking.texi
+++ b/doc/hacking.texi
@@ -341,14 +341,17 @@ If this is a concern,
in conjunction with ease.js'
-Interfaces do not exist at runtime in TypeScript,
- but they do in easejs.
- you can continue to export an ease.js interface while also exporting
- a TypeScript interface.
+Often times you will need to reference a class or interface as a
+ dependency before it has been migrated away from ease.js.
To do this,
- continue to export using @samp{module.exports} rather than
- TypeScript's @samp{export =}.
+ create a corresponding @code{.d.ts} file in the same directory
+ as the dependency.
+For example,
+ if a class @code{Foo} is contained in @file{Foo.js},
+ create a sibling @file{Foo.d.ts} file.
+For more information,
+ see @url{https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html,Declaration Files}
+ in the TypeScript handbook.
ease.js implements stackable Scala-like traits.
Traits are @emph{not} provided by TypeScript.