Category "typescript"

Angular 2 Animation - boolean trigger?

I'm trying to trigger a transition bound to a boolean property, but this doesn't seem to fire. Here is a cut down version of my animation trigger trigger( '

Module build failed: UnhandledSchemeError: Reading from "alias:/path" is not handled by plugins (Unhandled scheme)

I am creating a new react app and trying to configure webpack compiler from scratch. The issue happens when running the build command with webpack -c config/web

Use async await with Array.map

Given the following code: var arr = [1,2,3,4,5]; var results: number[] = await arr.map(async (item): Promise<number> => { await callAsynchron

Add dynamic loading messages with APP_INITIALIZER

I have an app which do some backend calls before initializing. I have a loading screen for this, which tells the user that something is currently loading. The p

How to mock interface with Jest without creating an instance

I know we can do it in Kotlin but I did not find it with Jest. I have complex interfaces and array of those interfaces and I do not want to specify all values o

What is "not assignable to parameter of type never" error in TypeScript?

Code is: const foo = (foo: string) => { const result = [] result.push(foo) } I get the following TS error: [ts] Argument of type 'string' is not a

contextBridge.exposeInMainWorld and IPC with Typescript in Electron app: Cannot read property 'send' of undefined

I defined contextBridge ( https://www.electronjs.org/docs/all#contextbridge ) in preload.js as follows: const { contextBridge, ipcRenderer } = require("elec

How to make the date input mask in angular?

I am trying to make the input date of birth mask in angular and format of date is dd/mm/yyyy ,but it not set and return the input according to our requirement

Angular FormArray display validation errors

I have Angular form that is built with help of FormBuilder. Form contains a FormArray which has as many fields as user wants. I've set validator for fields this

Which React TypeScript version to use in development?

I have an existing TypeScript React project that was created before Hooks existed in React, and I'm trying to rewrite all the classes using Hooks. Thus in my pa

Unwanted *.js and *.js.map files are being generated from .ts in some areas of project

I am developing an angular cli v6 project in visual studio 2017 and noticing that unwanted .js and .js.map`files are being generated for some of my typescript f

Updating Apexchart series on daily bases in angular

I am using apexchart but cannot know how to use updateseries I have tried directly sending the values HTML <apx-chart [chart]="{ ty

error TS2306: '...index.d.ts' is not a module

I'm trying to write a lib in Typescript that I want to use in various other typescript or JS projects. All of the those other projects run in browsers. My Type

How can I disable auto new-line in Visual Studio Code?

The problem is after I've installed the Angular extension in Visual Studio Code, I constantly get across all files (.ts, .html, and .css) auto new-line after ty

how to pass data from angular material dialog to parent component?

I'm using angular 6 and I have a button which opens a dialog. in my dialog, I have a form that gets user's data and then I have two buttons to submit and cancel

Create File object type in TypeScript

I have a function that should only accept JS File objects. How do I create that type in TypeScript? edit: sharing my tsconfig.json { "compilerOptions": {

"Consider using a mapped object type instead." - what's a mapped object type and how do I use it here?

When I try to compile this Typescript code interface Foo { [foo: "hello" | "world"]: string; } I get this error message An index signature parameter type

Tuple argument with correct return type for a function

How to return the correct type associated function argument as a tuple? I would like a function to return its value based on its argument's tuple type. The exam

TypeScript Generics column.id should be within row[key]

I'm writing a TypeScript Interface for Tables: interface Column { id: string; label: string; } interface Data { [key: string]: string; } interfac

'unknown' vs. 'any'

TypeScript 3.0 introduces unknown type, according to their wiki: unknown is now a reserved type name, as it is now a built-in type. Depending on your inte