Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 07 18:02
    lierdakil edited #1527
  • Dec 07 17:57
    lierdakil edited #1527
  • Dec 07 17:55
    lierdakil edited #1527
  • Dec 07 17:55
    lierdakil edited #1527
  • Dec 07 17:21
    lierdakil labeled #1509
  • Dec 07 17:14
    lierdakil synchronize #1527
  • Dec 07 17:11
    lierdakil synchronize #1527
  • Dec 07 16:43
    lierdakil synchronize #1527
  • Dec 07 05:56
    lierdakil synchronize #1527
  • Dec 05 17:51
    lierdakil synchronize #1527
  • Dec 05 16:20
    lierdakil edited #1527
  • Dec 05 16:15
    lierdakil opened #1527
  • Dec 05 06:59
    lierdakil closed #1503
  • Dec 05 06:59
    lierdakil closed #1509
  • Dec 05 05:43
    lierdakil labeled #1502
  • Dec 05 05:43
    lierdakil closed #1502
  • Dec 05 05:24
    lierdakil labeled #1513
  • Dec 05 05:24
    lierdakil labeled #1513
  • Dec 05 05:24
    lierdakil labeled #1510
  • Dec 05 01:28
    lierdakil closed #1523
Basarat Ali Syed
@basarat

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
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

is that not correct?

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

Stephen Baynham
@CannibalVox
Basarat Ali Syed
@basarat
@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
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
@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
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
no worries :rose:
Gerasimos (Makis) Maropoulos
@removed~kataras
basarat I have a problem !
look at DefinitelyTyped room :/
Basarat Ali Syed
@basarat
^ Done :rose:
Jari Pennanen
@Ciantic
Hello! Is it possible to get node auto completion without TSD files? I'm thinking about writing my one-off-script in TS and node.
I started in Python, but even though this ends up being like ~200 lines at max, it would be nice to have auto-completion :)
Basarat Ali Syed
@basarat

Is it possible to get node auto completion without TSD files

@Ciantic Not easily. Best solution seems adding integration with TSD to download files for you on demand. PS: I'm heading home right now :rose:

Jari Pennanen
@Ciantic
yeah, I think the tsd is not that cumbersome, for some reason I just wanted to keep all the details of the script in single file, but I think it's a useless requirement
Jari Pennanen
@Ciantic
well :D I think I'll go with Python: tsd install csv >> zero results
I always forget, everybody is not using TS in npm
Miguel Couto
@Mig1st4ck
in windows how do i do the sync ?
i did some changes in my ts files outside of atom
when i press F6 it gives bugs of files that no longer exists
i know i can close and open atom to fix it bug in the https://atom.io/packages/atom-typescript Sync sugests i can force a refresh
but "ctrol+'" does nothing
Basarat Ali Syed
@basarat
@Mig1st4ck ctrl+' should work
Stephen Baynham
@CannibalVox
Hi, I included https://github.com/borisyankov/DefinitelyTyped/blob/master/request/request.d.ts in my tsconfig.json, and I'm trying to pull it into a file with import RequestAPI from 'request';
However, I'm getting an error "Module 'request' has no default export."
But it does, it's right there in the file.
Oh I see- I'm getting a different error from gulp, that it can't find the module.
That's a little misleading.
Stephen Baynham
@CannibalVox
Oh it's because it's an ES5 definition file
hellboy81
@hellboy81
Is there possible to use https://github.com/borisyankov/DefinitelyTyped as helper for intellisense if I am coding only JS?
Basarat Ali Syed
@basarat
@hellboy81 its been requested before : TypeStrong/atom-typescript#315 but not supported yet.
I'm keeping an eye on the TypeScript code to see if it officially becomes any easier : Microsoft/TypeScript#4094 / Microsoft/TypeScript#4789 :rose:
Rob Yoder
@robyoder
Anyone know what's up with the URL definition in lib.d.ts? I'm getting Cannot use 'new' with an expression whose type lacks a call or construct signature. when trying to run new URL('https://example.com') which should be perfectly valid
interface URL {
    createObjectURL(object: any, options?: ObjectURLOptions): string;
    revokeObjectURL(url: string): void;
}
declare var URL: URL;
Not sure why URL is defined this way. Anyone else?
Basarat Ali Syed
@basarat
@robyoder because its not supported in all browsers and very importantly (from ms perspective) IE : https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#Browser_compatibility
Rob Yoder
@robyoder
Sure, but I should be able to check that and use it if it is supported. As it is, I just get an error. I can't redefine it either since it's already been declared. @basarat
Basarat Ali Syed
@basarat
@robyoder you can amend it easily. Just add to the URL interface. See https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html for examples :rose:
Rob Yoder
@robyoder

Thanks. I've done that before, but I was getting mixed up with it earlier, overcomplicating things and it wasn't seeming to work. Just defining

interface URL {
    new(url: string): any;
}

is a good enough hack for now

kpgarrod
@kpgarrod
I am having an issue since about 6.06 with 'go to declaration'. It takes me to the end of the file where the function is declared, not the declaration of the function itself. Anybody else?
Basarat Ali Syed
@basarat
tested.gif