Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 17:46
    jakebailey synchronize #50988
  • 17:38
    iisaduan synchronize #50663
  • 17:37

    jakebailey on main

    Remove configureLanguageService… (compare)

  • 17:36
    jakebailey closed #51048
  • 16:53
    sheetalkamat review_requested #50977
  • 16:51
    RyanCavanaugh labeled #51047
  • 16:49
    RyanCavanaugh milestoned #51047
  • 16:49
    RyanCavanaugh labeled #51047
  • 16:49
    RyanCavanaugh labeled #51047
  • 16:49
    RyanCavanaugh labeled #51047
  • 16:23
    RyanCavanaugh labeled #51046
  • 16:17
    sandersn synchronize #51049
  • 16:17

    sandersn on getTypeAtLocation-support-class-expr

    Adding a JSDoc comment to the e… Update package-lock.json Merge branch 'main' into getTyp… and 1 more (compare)

  • 15:12

    jakebailey on main

    Update GitHub Actions (#51045) (compare)

  • 15:12
    jakebailey closed #51045
  • 14:14
    ajesshope edited #50855
  • 14:13
    ajesshope edited #50855
  • 14:10
    ahejlsberg synchronize #51050
  • 14:10

    ahejlsberg on fix50558

    Fix comment (compare)

  • 12:30
    typescript-bot labeled #51057
well that is how you use typings
Mental Arena
then I don't have to do that
doesn't make sense to only use typings for the compiler, they enable you support for autocompletion and so on
Hi I am trying to integrate ng2-handsontable (https://github.com/valor-software/ng2-handsontable) with my angular2 project setup done with 5 min quick start link (https://angular.io/docs/ts/latest/quickstart.html). But somehow it is not loading index.ts file of ng2handsontable component. I found that my angular2 setup has @angular folder structure while ng2-handsontable is installed with angular2 folder. I got rid of build errors but now at run time index.ts is not loaded. Can anyone can guide, what may gone wrong here?
Andrei Nemes
@caperavensoftware you should be able to include the typings index file in your gulp-typescript pipe, that should save you having to manually include refs
don't know how gulp does it but it would have to use tsc to concatenate the output for it to work
Jari Pennanen
what is wrong with this:
let a = async (s) => {
    var result = await Promise.resolve("Data recieved");
    return "blaa";
VSCode approves this, playground says error
if I've understood this correctly, above should infer return type as PromiseLike<string>
because of "blaa"
Andre Soares
Guys, what means these "three dots" (...) in this excerpt? I don't know this idiom...
const routes: RouterConfig = [
This message was deleted
Jari Pennanen
let a = [1,2,3];
let b = [6,6,6];
let c = [...a, ...b];
@Ciantic playground has TS 1.8 that does not support async/awaits I guess
Jari Pennanen
var a = [1, 2, 3];
var b = [6, 6, 6];
var c = a.concat(b);
@andregsilv with playground: http://www.typescriptlang.org/play/
@con-ssc oh right, I'm using this akward -> TS -> ES6 -> Babel thing
Andre Soares
@Ciantic Very interesting, my friend! Thanks
Jari Pennanen
was there nightly playground somewhere? I think @basarat did something like it
Andre Soares
@simplysh Thanks, I couldn't even name it, :laughing:
Andrei Nemes
@andregsilv no worries - have a read, it's pretty cool!
Jari Pennanen
must try alm tools, it oughta use ntypescript
oh yeah, it can show me the types
Tim Sandberg
@DanielRosenwasser Thanks for the tip! Turned out I commented out the root reference in an attempt to uncover the source of ponderous build times. Once I put the reference back, I noticed the "dist" folder was not getting auto-populated with *.d.ts files
I'm using tsconfig's outFile to create a bundle. Is there a way to specify a single entry point .ts source in tsconfig.json, and then use a wildcard for typings?

Eg. I can do:

"filesGlob": ["*.ts", "typings/**/*.ts"]

or I can do:

"files": ["main.ts", "typings/a/a.d.ts", "typings/b/b.d.ts", ...]

But if I do:

"filesGlob": ["main.ts", "typings/**/*.ts"]

It will bundle all .ts files it finds, not just the ones required by main.ts. If I use "files" it will only bundle the required ones, but I have to list every typings file by name.

Jari Pennanen
do you guys know gulp?
Jari Pennanen
class Bar {

class Foo {

function decorator(c: (new()=> Bar)) {
    return c;


decorator(Foo); // Not an error?
oh man, I must add properties to trigger error here
Emil Hammarström
@Ciantic does c: (new()=> Bar) really achieve anything more than c: () => Bar?
Jari Pennanen
@initiumSrc yea, I was a bit struck by the structural typing here
Basarat Ali Syed

Thanks for the mention @Ciantic :rose:

The playground I once worked on that is easy to upgrade to ts latest although I don't have the heart to do that anymore basarat/TypeScriptEditor@b90d00b

This i the project I am working on for this year http://alm.tools/ Will most likely create a hosted version of alm for demo so people can try it before npm installing at some point :heart:

Bnaya Peretz

I'm trying to create a class decorator

function injectShouldComponentUpdate<T>(clazz: T) {
    return class extends clazz {


And i'm getting the following error:
T is not a constructor function type

what am i missing?
Risto Novik
Hello, is it possible to move to TypeScript incrementally without rewriting the whole project once? If it is could you send some article links?
Andrei Nemes

you can think of any javascript file as a typescript file without typings. it's designed for maximum interoperability. if you want, you can include js files in your ts compilation too

Including .js files with --allowJs

Often there are external source files in your project that may not be authored in TypeScript. Alternatively, you might be in the middle of converting a JS code base into TS, but still want to bundle all your JS code into a single file with the output of your new TS code.
.js files are now allowed as input to tsc. The TypeScript compiler checks the input .js files for syntax errors, and emits valid output based on the --target and --module flags. The output can be combined with other .ts files as well. Source maps are still generated for .js files just like with .ts files.

Robert Nsinga
@riston TypeScript essentially compiles pure javascript, i.e. what gets executed is your *.js files. Check this article out for more: Incrementally migrating to TypeScript.
Andrei Nemes
if you're new to ts, this is a good talk about it https://channel9.msdn.com/Events/Build/2016/B881
James Forbes

Hi all, I've got a tricky generics problem I'm hoping someone can help me solve:

I want to have a map function that supports any object that implements the Functor interface.
But I want to declare that map will always return the same type that it received.

e.g. if I pass in an array, I want tsc to know its an array. Or if I pass in a Maybe, I want tsc to know its a Maybe.
I'm losing precision when I receive the result. The type signature can only guarantee that V is a Functor, instead I want to guarantee that V is the same type that was received.

interface Functor<T> {
    map<T>(a: any): Functor<T>;

interface Ramda { 

    map<T, U, V extends Functor<U>>(fn: (x: T) => U): (obj: V) => V;


interface Maybe<T> {
    map<T2> ( f: (value: T) => T2 ) : Maybe<T2>

var m : Maybe<string>;

declare var R : Ramda

// tsc says b is Functor<Number>
// but I want it to be a Maybe<Number>

var b = R.map( (a:number) => a)(m)

Is this possible?

George Nemes
@JAForbes looks a bit confusing at first glance
but let's step back a little bit
your Maybe return type is captured here map<T, U, V extends Functor<U>>(fn: (x: T) => U): (obj: V) => V;
however, there is nowhere to infer the type of V from, as it is not passed to the original function anywhere
so you'd have to provide V
maybe like this