Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 13 07:24
    lierdakil closed #1262
  • 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
Moritz
@moritzuehling
When pasting something, I press control +left click almost at the same time, and then just press v afterwards. This is a "human race condition" for me, because sometimes I hold control and then click, which opens lib.d.ts (for example), which takes ages, and leads to me getting frustrated.
Moritz
@moritzuehling
Oh wow, it came from the typescript-modules-helper, not from here
Consider it fixed :D
Ben
@eenblam
Hmm. I've tried both atom-typescript and VS Code, and I can't seem to get type files (installed via typings) recognized.
From my tsconfig.json:
    "filesGlob": [
      "typings/**/*.d.ts",
      "typings/globals/**/*.d.ts",
      "typings/modules/**/*.d.ts"
    ]
Gustav Bylund
@Maistho
@eenblam You should probably only add typings/index.d.t.s (if using typings 1.0)
Also where are the files located (is the tsconfig in the same folder as the typings directory)? Are the typings installed properly?
Ben
@eenblam
  1. Yes 2. I installed via the command line. Not sure how to evaluate whether or not they installed properly, apart from not getting errors on installation.
Gustav Bylund
@Maistho
ls typings ?
Blake Embrey
@blakeembrey
@eenblam filesGlob is not an official property, it'll only work using atom
Ben
@eenblam
@blakeembrey Right. I tried explicitly linking the files using "files" when using VS Code.
Blake Embrey
@blakeembrey
ok, you only need a single reference to typings/index.d.ts
what was the error?
Ben
@eenblam
@Maistho: globals/ index.d.ts modules/
Blake Embrey
@blakeembrey
was it via vs code or atom or tsc?
Ben
@eenblam
Yes, tried using only typings/idnex.d.ts, too.
One second
Blake Embrey
@blakeembrey
which typings did you use?
if they were from typing install d3, they are external modules
not global
so the name d3 will not exist in scope
you should probably be getting d3 by doing import * as d3 from 'd3'
Ben
@eenblam
Okay, so I should probably give context. I just started with TypeScript today. I went through most of the Handbook, and then I tried opening up a simple d3 app I'd written to figure out how to annotate it properly.
Okay, cool.
Gustav Bylund
@Maistho
There's probably global typings for d3 as well
Ben
@eenblam
That fixed d3, but RXJS (typings install rx) did install into globals yet isn't being found.
(even if I try importing)
Gustav Bylund
@Maistho
rx probably needs to be included as well. I recall adding import 'rxjs/Rxjs' somewhere
Ben
@eenblam
Tried import * as Rx from 'rx' and import 'rxjs/Rxjs'. Still can't find Rx.
Blake Embrey
@blakeembrey
how did you install them from global? i'm going to assume it's this: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/rx/rx.d.ts
the correct way to import would be import rx = require('rx') (but import * as rx from 'rx' should also work)
make sure it's also installed
Ben
@eenblam

I got this:

$ typings install dt~rx
typings ERR! message Attempted to compile "rx" as an external module, but it looks like a global module. You'll need to enable the global option to continue.

so I did this:

$ typings install dt~rx --global
typings INFO reference Stripped reference "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/rx/rx-lite.d.ts" during installation from "rx" (main)
rx
└── (No dependencies)
Blake Embrey
@blakeembrey
yes, and there's a reference stripped during installation
so you can do typings install dt~rx-lite --global to correct that
it's an unfortunate problem with dependency management in the definitelytyped source
Ben
@eenblam
Did so, still can't find 'Rx'
Blake Embrey
@blakeembrey
rx lowercase
aside from that, it seems correct to me
can you make sure it's not just a restart of atom or something else required
try compiling with tsc?
Ben
@eenblam
Restarted atom
Lowercase rx? I can't just import Rx = require('rx');?
Apparently not. This fixed it.
import rx = require('rx');
let Rx = rx;
(I had Rx.Observable.etc() in the original .js file.)
@blakeembrey Thanks for the help!
Blake Embrey
@blakeembrey
that's really odd, the variable name causing shouldn't have mattered
glad you've got it working now :)
Ben
@eenblam
Yeah, I'm super confused still, but I guess it's working.