Type / interface strictly TypeScript

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

The value is missing .default for the imported module

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

Understanding the complex type declaration in the type

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) =

The Primeng dialogue is not accessible

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

Import a module from the root path into TypeScript

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

What is wrong with Type Script & lt; & gt;

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

Canonical way to search for type definitions in typecript 2.0

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

Unknown compilation error of Typescript 2.0

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

Will TypeScript 2.0 support VS 2013?

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 import path aliases

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

Import js file with TypeScript 2.0

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