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
0
votes
2 answers

declare 'this' value for helper function

I have a class: const helper = function(val){ console.log(this.a); console.log(this.b); this.bar(); }; export class Foo { public b = '45' private a = 15; bar(){ } myMethod(){ return helper.apply(this,arguments); } } the…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

How do I give plain object an index signature

I have this object: const events = { i: 'insert', u: 'update', d: 'delete' }; for some reason I am blanking on how to give the object an index signature - if I do this: export interface EventsSignature { [key:string]: string } const events…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Cannot pass array of string to function

I have this function: function proc(unames: Array){} I try to pass it this: import _ = require('lodash'); const usernames = _.flattenDeep([unames]).filter(function (item, index, arr) { return item && arr.indexOf(item) === index; …
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Express router file has a TypeScript error

I have the following module format: import * as express from 'express'; let router = express.Router(); router.post('/foo', function(req,res,next){ // ... }); export = router; but I am getting this error: This is driving me crazy - how can I…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
0 answers

TypeScript errors after upgrading to 2.7.2

I tried to update TypeScript on the project. Prev. version was 1.5, now it's 2.7.2. I'm using JetBrains WebStorm, and it have built in TypeScript checker. Per that checker - there was few incompatibility errors, but I resolved them all. But when I'm…
Duiz
  • 15
  • 5
0
votes
1 answer

How to export typescript class but keep relate var private

Image this example: const hidden = Symbol() export class Foo { static [hidden] = 'I dont want another touch this' } The compiler report: error TS4028: Public static property '[hidden]' of exported class has or is using private name 'hidden'. Yes…
colder
  • 644
  • 7
  • 12
0
votes
1 answer

Using `tsc` give output module a name

I use this command: tsc --out foo.js values/java-junit/*.ts --module amd or tsc --out foo.js values/java-junit/*.ts --module system and I get define("index", ["require", "exports"], function (require, exports) { "use strict"; …
user7898461
0
votes
2 answers

Abstract interface cannot be used as type in array - missing property

I have this interface: export interface SceEvent { // ... } export interface SceMain { onComplete: () => void; onNextEvent: (ev: SceEvent) => void; getRawGeneratedCode: () => string; getStyledGeneratedCode: () => string; } I…
user7898461
0
votes
0 answers

ANGULAR COMPONENT NOT LOADING IN DOT NET MVC PROJECT

I am trying to add angular5 to .net mvc web api . I have searched over and found some answers but that doesn't work for me . Following steps i followed : I cloned latest version from github of angular5 on my desktop. Then i created a new project…
deepak
  • 15
  • 6
0
votes
1 answer

Stop globals.d.ts triggering Visual Studio TypeScript services

I'm working on a legacy code base with Visual Studio 2015. There is a lot of Javascript code, and again for legacy reasons I can't just add Typescript. Any new Javascript that is written is done in VS Code and in order to improve the quality of the…
user9993
  • 5,833
  • 11
  • 56
  • 117
0
votes
1 answer

Compiled angular 5 files trigger an error at runtime "No value accessor for form control with name:"

I'm trying to update a package (ng-selector) from angular 4 to 5, and I can't get it to work correctly. From what I understand, since Angular 5 is only compiling files from the application folder, to use a package from the node_modules folder, my…
Orodan
  • 1,047
  • 2
  • 13
  • 24
0
votes
0 answers

Unable to compile TypeScript in VS Code because there's a space in the locally installed `tsc` path

I have created a TypeScript project on VS Code. I have installed TypeScript compiler locally in the project itself. The path contains space so, when I try to build the project the command is c:\Space in path\src\node_modules\.bin\tsc.cmd -p…
Naveen
  • 6,786
  • 10
  • 37
  • 85
0
votes
1 answer

Protractor typescript example error with tsc

I am trying to follow this example protractor script from here: https://github.com/angular/protractor/tree/master/exampleTypescript All of my npm installs go well, but when I get to the final: npm run tsc it fails for the reason in the screenshot…
user952342
  • 2,602
  • 7
  • 34
  • 54
0
votes
0 answers

Typescript compiling error using vss-web-extension-sdk

When trying to include the downloaded https://www.npmjs.com/package/vss-web-extension-sdk or more precisely the /typings/index.d.ts from the package I get the following typescript error after running…
Boden_Units
  • 83
  • 2
  • 7
0
votes
2 answers

bundle.js not found while refreshing the page having ID in it's URL

I ran into a problem where I am redirecting a user into its corresponding profile page where the profile information is being displayed. Let's take for example http://localhost:8080/user/1. when I am redirecting the user using the link in the navbar…
Harish Soni
  • 1,796
  • 12
  • 27