I am seeing this error with TypeScript: The code itself just looks like this: let fn = function (transformPaths: Array<string>, cb: Function) { async.mapLimit(transformPaths, 5, function (t: string, $cb: Function) { // .... }, cb); }; The error mess
I'am currently working on a project with some javascript legacy-code. The application does not include a module loader, it just puts everything as an global into the window object. Touching the legacy code and including a module loader is sadly not a
I use TypeScript version 2.3.4. I want to write a function that accepts an object that must have specified fields. But this object should not contain any other fields. How can I achieve this? Now this works only if I define object inline. But if I us
I am writing our JavaScript based tests with TypeScript. I would like a single tsc --watch command, to be able to handle transpiling all of our files correctly, that's the key part. I think using multiple tsconfig.json files is the way to go here. I
Fighting with webpack, react and typescript. The core problem is that TS compiled code is referencing a ".default" when the value is on the exported component. I can either modify the *.d.ts file or I can change the code, but my attempts haven't
Looking at a this type declaration: export interface Thenable<R> { then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U> then<U>(onFulfilled?: (value: R) =
I am using "primeng": "^4.0.0-rc.2" with "@angular/cli": "^1.0.0" and angular4. When I try to use dialog the dialog is not accessible - it is hidden behind the overlay that should prevent access to the remainder of
I'm using Typescript (version 2.2.1) in VSCode (version 1.10.2) for my React Native project and I'm trying to get the compiler to map *.android.ts and *.ios.ts paths by using the instructions at: https://github.com/Microsoft/TypeScript-Handbook/blob/
I have a Array (mMemberCount) in Parent Component and based on the size of this array the child component (Reusable) is attached to Parent component. <member-template *ngFor="let item of mMemberCount" [title]="item.relation" [member
I'm still quite new at TypeScript, so other SO questions and the documentation sometimes leave me just as confused as I started. I'm going to put this as simply as I can, and if it's a duplicate, please point me to it. I'm essentially wondering what
Essentially I want to ensure that an object argument contains all of the required properties, but can contain any other properties it wants. For example: function foo(bar: { baz: number }) : number { return bar.baz; } foo({ baz: 1, other: 2 }); But t
I'm trying to implement a filter in Angular 2 class, but i'm getting an error for some reason. I'm not able to filter and return the results. Class code: employee = [ { "empId": "59C", "empDesc": "Software","lo
Let's suppose I've a project, and its main source directory is: C:\product\src Based on this directory, every import path would be relative to it. I.e., suppose: // Current script: C:\product\src\com\name\product\blah.ts import { thing } from '/com/n
I'm getting date in loop from sqlite database. The format is like "Wed Feb 01 2017 21:54:24 GMT-0200". But I want to change it as 'dd/MM/yyyy'. How can I change format in the controller? Example my code: this.issuedService.fetchAll().then(( res
I am trying to extend Button component of react-native-button library. The class using the extended component: import { DefaultButton } from "../../support/ui/DefaultButton"; ... render() { const loginProps = { title: "login", style: {
I am trying to use the element-resize-detector library (https://github.com/wnr/element-resize-detector) in an Angular2 application. From my limited JS module knowledge, the library appears to be in CommonJS format. After several attempts, I have crea
This syntax is from the Angular2 Hero tutorial. getHeroes(): Promise<Hero[]> == getHeroes(): (Promise: Hero[]) ? I am confused about the Promise<Hero[]> part, in particular. Is it a way to represent multiple types at a time? What does the area
How to code the click and view search bar in ionic 2 application. In that one the search icon only shows first, when i click the search icon the the search bar will show.ts export class Page1{ public toggled: boolean = false; constructor() { this.tog
I'm learning TypeScript so please accept my apologies for asking a dumb question. The following code is taken from the official docs, but it is not working. It looks like the function is expecting a Tuple of two numbers instead of Array, but on the o
Scenario I'm using VisualStudio 2015 to create a Webservice containing TypeScript. I'm currently using TypeScript Version 2.03 and the compilation is processed by the [Microsoft.TypeScript.MSBuild] NuGet package. Common project tree: What is working
Since typescript 2.0 instead of typings we are supposed to use npm install @types/<package-name>. In typings we have typings search command for package lookups. My question is - what is the canonical way to search type definitions in @types? So, to
I'm getting this error Unknown compiler option 'lib'. (5023) Unknown compiler option 'types'. (5023) I removed typescript from node_module didn't work used npm uninstall typescript and npm install -g typescript didn't work again used npm uninstall -g
I do not understand the meaning of types field in tsconfig.json. In documentation I have read such text: "types": { "description": "Type declaration files to be included in compilation. Requires TypeScript version 2.0 or later.&qu
I have a nodeJS project based on this seed project. It has two tsconfig.json files which look like this: { "compilerOptions": { "target": "es6", "module": "system", "moduleResolution": "node
I've tried to remove typings from my web project (Visual Studio 2015 Community) and install d.ts files via new NPM @types (typescript 2.0.3) in package.json: "dependencies": { "@types/angular": "^1.5.8", "@types/angular-
The d.ts file at dt~whatwg-fetch includes the following declaration. declare class Headers { // other code ommited [Symbol.iterator](): IterableIterator<[string, string]>; } We've tried to create a workaround interface without success. None of the f
I can't find any download for TypeScript 2.0 for VS 2013. And can't find any description about dropping support for VS 2013.It appears they have decided not to support TypeScript 2.0 in Visual Studio 2013 according to this GitHub issue.
TypeScript Version: 2.0.2.0 Code I know the code is a bit stupid, but I actually have these kind of tests in my code (making a expression visitor) and I really think these should fly and compile right away. var a: boolean = (true == false); var b: bo
I am currently working on a TypeScript application which is comprised of multiple Node modules written in TypeScript, that are installed into the node_modules directory. Before continuing, I would like to note that I am using TypeScript 2.0, I am not
Abstract I'm trying to import ".js" file from an external location (i.e. node_modules) I'm trying to do this using commonjs module pattern, however import wouldn't want to work with ".js" file types until I add ".d.ts" file n