Category "typescript"

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema

I have this simple helloworld react app created from an online course, however I get this error: Invalid configuration object. Webpack has been initialised

event.target.value as a number?

const [data, Setdata] = useState<number[] >([]); const [inputData, SetinputData] = useState<number>(0); const [canAdd, SetcanAdd] = useState<boo

useRef TypeScript - not assignable to type LegacyRef<HTMLDivElement>

I am trying to use useRef with TypeScript but am having some trouble. With my RefObject (I assume) I need to access current. (ie node.current) I have tried the

TypeScript: Partially "Partial" type

Environment TypeScript's version is 3.2.1 and "tsconfig.json" is like below. { "compilerOptions": { "target": "es5", "module": "commonjs", "stri

How to forbid replacing process.env variables during compilation in webpack?

Story I'm developing the AWS Lambda functions and compile the code using webpack. I've read some of the articles and it seems that the process.env variables a

Angular 2 - [(ngModel)] not updating after [value] changes

I'm setting the the value of an input calculating two other ngModels, and that seems to be working fine. But if I inspect my ngModel, it doesn't change at all.

TypeScript: Partially "Partial" type

Environment TypeScript's version is 3.2.1 and "tsconfig.json" is like below. { "compilerOptions": { "target": "es5", "module": "commonjs", "stri

How to declare an interface above an angular component?

I have a component with a method that receives values from a form. I would like to describe the form data with an interface. However, at runtime (ng serve), th

Installing WebDriverIO with Typescrit and Cucumber gives me an error

When I finish configuring the project, the wdio.conf.ts and tsconfig.json files are saved in a folder called tests and the wdio.conf.ts file gives me the follow

how to get an object literal properties with ts-morph

I am parsing a file like this using ts-morph const a = {property1: 20, property2: 30} I can't seem to figure out how to get an ObjectLiteralExpression mention

How to use deep-equal (Angular 7)

Auto import by VS Code: import deepEqual = require('deep-equal'); Doesn't work: error TS1202: Import assignment cannot be used when targeting ECMAScrip

How to build VS Code TreeView with custom JSON?

I'd like to build a TreeView based on a JSON file / REST Call and have an icon for each type of my objects. I have only three types of objects: Server, Host and

How to validate request in typeorm controller

I have created a sample application to save data for a user. I wanted to know how to validate it before saving and showing the response in JSON. I have got a re

TypeScript this in interface should reference itself and children, not only itself

There is the example: interface A { method: (itself: this) => string; } interface B extends A { additionalProperty: boolean; } type Extend<T ext

How can I assign a TypeScript type for event payloads for a class like EventEmitter?

I have a class that is just like Node's EventEmitter (it could even be the same class). How do I type it in such a way that I can specify what the callback typ

I'm new to Angular, I'm trying to figure out where I'm wrong

I keep getting this error and I'm not sure what to do?[1] [1]: https://i.stack.imgur.com/mQ3Xo.png

Could not find a declaration file for module 'module-name'. '/path/to/module-name.js' implicitly has an 'any' type

I read how TypeScript module resolution works. I have the following repository: @ts-stack/di. After compiling the directory structure is as follows: ├&#

Move focus to next control on key Enter

I have found some project on Angular 1.x where user can move focus to next control by pressing Enter key. 'use strict'; app.directive('setTabEnter', function

Fucntion not working inside razorpay ondismiss callback in Angular 12

I have a function inside ondissmiss callback options.modal.ondismiss = () => { console.log("its working"); this.detectChanges(); this.isPaying = false

Function inside ngIf is called multiple times, after a single click event- Angular2_Typescript

Hello this is the first time I qm putting question on stackoverflow. I am developing an application in angular2: v2.1.0 (typescript- v2.0.10). I am using "ng2-