Questions tagged [tsc]

tsc is a compiler for converting TypeScript into plain JavaScript.

tsc is a compiler for converting TypeScript into plain JavaScript targeting either the ECMAScript 3 or ECMAScript 5 specifications.

927 questions
-1
votes
1 answer

Better way of defining the return type of closure function inside typescript .d.ts file

I am declaring the function in my typescript definition file .d.ts. It returns a complex predefined object. Need help with the same. I used the npx -p typescript tsc src/handler.js --declaration --allowJs --emitDeclarationOnly --outDir types the…
Gary
  • 2,293
  • 2
  • 25
  • 47
-1
votes
1 answer

How does TypeScript allow assignment of null to type null[]?

I am learning typescript and I see a few counter-intuitive practices when it comes to null and undefined. const a: null[] = null; const b: null[] = [null]; const c: null[] = undefined; const d: null[] = [undefined]; All the above statements do not…
shishir
  • 41
  • 4
-1
votes
2 answers

I'm getting this error on build using tsc

I'm getting this error on the build using tsc Can someone check this, please? node_modules/@types/node/index.d.ts:75:11 - error TS2300: Duplicate identifier 'IteratorResult'. 75 interface IteratorResult { } I'm using latest typescript and…
Carlos Vieira
  • 559
  • 2
  • 10
  • 22
-1
votes
1 answer

My application doesn't seem to picking up my angular material/dialog module. How can i fix this so that it works?

I would like to use two material ui components for my angular application. They are MatDialog, and MatDialogConfig. I'm not sure if I have something in the wrong place or not but basically all my modules work fine except this one. Both my…
evan
  • 117
  • 1
  • 10
-1
votes
1 answer

Defining constant/ro properties on objects with TypeScript

Using TypeScript, is there any way to enforce non-reassignment? Say I have this: fn.foo = 5; fn.foo = 6; is there a way to get a compile error on the second line? As soon as I assign the foo property, it should be ReadOnly I suppose. My case foo…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
-1
votes
2 answers

typescript augment "rx" module => Invalid module name

I am writing a node module that also contains types, since I'm using it with a typescript project. The module depends on "rx": "^4.0.6". This version of rx contains the types internally in rx/ts. What I want to do is augment the rx types with 2…
XeniaSis
  • 2,192
  • 5
  • 24
  • 39
-1
votes
1 answer

Why is tsc called twice in this npm start script?

The package.json example at this link includes the following start commands: "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", What explicitly does the above command do? I think that the "concurrently \"npm run tsc:w\" \"npm…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
-1
votes
1 answer

tsc compiles ES6 code into ES5

'I am using TS 2.2 and I tried compiling my ES6 module ( js file) using tsc and it did compile into valid ES5 code. I was using google's Tracur OR some other tool int he past to do so. I believe, this feature, of compiling js files from ES6 to ES5,…
user2225263
  • 277
  • 4
  • 15
-1
votes
1 answer

Why is it possible to declare a variable of 'anyTextString' type in TypeScript?

Why tsc doesn't complain for this line of code: let a: 'my text string'; and allows a to be of type 'my text string'? And... Isn't this bug-prone if, let's say, someone takes advantage of implicit type inference, and just puts a ':' instead of…
ebu_sho
  • 394
  • 6
  • 17
-1
votes
2 answers

Visual Studio Code - Strangely Typescript compiler (tsc) not exists

I'm getting this error pressing Ctrl+Shift+B trying to compiling a Typescript file: (Translated) "tsc" is not recognized as an internal or external command... It's not supposed to be already included???
Pedro Mora
  • 95
  • 9
-1
votes
1 answer

How can i compile a file containing different libraries (e.g. jquery, jquery-ui, other 3rd party libs) with typescript

I am working on a project that contains multiple libraries (Jquery, jq-ui, fileupload plugins and some other 3rd party plugins) i am converting my project to typescript but in order to work with those libraries I need a .d.ts file to include in my…
Aamir Shah
  • 646
  • 5
  • 14
-5
votes
1 answer

Tsickle says "Error No inputs were found in config file" if I call it with tsconfig.json in a different directory

Calling tsickle with tsickle --externs=target/externs.js -- -p target/src I get this error: Error No inputs were found in config file 'target/src/tsconfig.json'. Specified 'include' paths were '["./my/pathes/**/*.ts"]' and 'exclude' paths were…
peterh
  • 11,875
  • 18
  • 85
  • 108
1 2 3
61
62