These are chat archives for TypeStrong/atom-typescript

11th
Sep 2015
Stephen Baynham
@CannibalVox
Sep 11 2015 02:44
@basarat Error message says it's not a module, because the DTS files being produced by typescript aren't really ambient modules it seems?
Stephen Baynham
@CannibalVox
Sep 11 2015 02:57
I guess I can have gulp place an ambient declaration before & after the DTS output, is that the best way? Seems crazy that I have to do a full gulp build, deploy, update to have two projects open in Atom, one of which relies on the other.
Also is there any way to not compile to a single file but have the compiled output not be mixed in with the source?
Basarat Ali Syed
@basarat
Sep 11 2015 04:08

because the DTS files being produced by typescript aren't really ambient modules it seems?

They should be. Should have stuff like export var at the root level of the file .... that makes them an ambient export module

Also is there any way to not compile to a single file but have the compiled output not be mixed in with the source?

You can use outDir. But I recommend against that as it becomes fairly weird ... fairly quickly

Stephen Baynham
@CannibalVox
Sep 11 2015 04:49
All that's at the root level is declare namespace
because the root of my source files looks like this:
namespace TechnicCommon {
export class VersionedResource extends WebResource {
is that not correct?
Basarat Ali Syed
@basarat
Sep 11 2015 05:51

is that not correct?

No. export needs to be at the root level . (ref)

Stephen Baynham
@CannibalVox
Sep 11 2015 06:00
Basarat Ali Syed
@basarat
Sep 11 2015 06:01
@CannibalVox at the bottom of that page For most projects we recommend using external modules and using namespace for quick demos and porting old JavaScript code.
Stephen Baynham
@CannibalVox
Sep 11 2015 06:34
Okay, I have two classes that are in the same exported module, one inherits from the other and both need to be available to consumers. I've tried marking just the module for export, but in that case the class doesn't appear in the DTS file. If I mark the class for export, though, it's not marked as export in the DTS file. This seems like it's probably fine, but when compiling the child class it gives me an "all export or all local" error. This happens even when I'm importing directly from the TS file, though.
Basarat Ali Syed
@basarat
Sep 11 2015 06:36
@CannibalVox parent : http://pastebin.com/9wEkrWBh child : http://pastebin.com/881JdDXj :rose:
Note: using namespaces with external modules is generally redundant
also ES6 import should not contain the extension .ts in child
Stephen Baynham
@CannibalVox
Sep 11 2015 06:37
Yeah, sorry, I wasn't using it before I just wanted to see if it was picking up the DTS instead somehow
Okay, thanks.
I understand how this should work now, thanks a ton!
Basarat Ali Syed
@basarat
Sep 11 2015 06:41
no worries :rose: