typescript

Must use import to load ES Module webpack.config.js

I decided to try the es6 Node modules.js (those that are .mjs or "type" = "module"). I write the code in typescript, the ts-l ... ules" Mistake: TypeError: Invalid host defined options at module.exports (/home/admin/web/31_MyCMS2/webpack.config.cjs:2:18)

How to use useSelector in react + redux + typescript?

Using useSelector an error occurs Property 'reducer' does not exist on type 'DefaultRootState'.ts(2339)

Overloading a function in TypeScript

interface MyPosition { x: number|undefined y: number|undefined } interface MyPositionDefault extends MyPosition { ... on the second overload. In addition, you can return objects of any type in return. On the contrary, it does not give errors.

Webpack does not transpose typescript in es5

I build an application on js and ts using webpack. And the ts-loader throws an error during the build. You may need an appro ... , exclude: /node_modules/, }, ], }, resolve: { extensions: ['.ts', '.js'], }, };

How to make Vuelidate friends with Typescript

Package.json "dependencies": { "vuelidate": "^0.7.5", }, "devDependencies": { "@types/vuelidate": ... s.$v.$touch(); return; } } The linter returns the following error: Property '$v' does not exist on type 'Login'.

HTML input element extension

Making a component that just extends the normal html input. const Input: React.FC<HTMLAttributes<HTMLInputElement>& ... putElement> & { children?: ReactNode; }'. In general, I'm doing something wrong, but I don't understand what exactly.

How to properly call an asynchronous request in react?

There is a code that outputs a list of posts: import React from "react"; type respX = { "id": any, "userId": any, ... ng on each post (click on li) , for example https://jsonplaceholder.typicode.com/posts/1 - where 1 is the number of the post.

Why is a static field of the same class type declared?

So far, I am not very familiar with TypeScript, but I have not yet met with this in any language, I saw this code in the boil ... this.$http.post<IAuthUser>('Login', credentials); return data; } } export const AuthApi = AuthService.Instance;

How to determine a coin with or without commission using the sdk uniswap.org

I am trying to create and send a transaction to https://app.uniswap.org using the SDK: https://uniswap.org/docs/v2/smart-cont ... a coin has a commission or not? Without sending a transaction Otherwise, if sent wrong, the transaction will not take place.

Why typescript error when importing actions redux?

I am making a large react+redux application alone and have encountered a strange error! I ask the pros to help. Here is the c ... tand it is related to ThunkType, but if you import ActionsTypes and combine it, then there is even more errors. Help me solve

NW.JS + Typescript - Does not output to the console

Application Entry Point nw.js - index.html In this index.html I connect the main file.js If I connect it like this (option 1) ... sqlite3": "^5.0.0" }, "devDependencies": { "@types/node": "^14.0.22" } } I suffer almost the whole day... Help!!!

What is the difference between JavaScript and ES6 and EC2015?

Actually, the question is: what is the difference between JavaScript and ES6, EC2015 and TypeScript? No one can really answer me on the merits. Why do I need TS for Angular 2?

Property error 'then' does not exist on type 'Observable '

I make a service with my own logic, but the error Property error occurs 'then' does not exist on type 'Observable'. Service ... arams.get('id')) .subscribe(user => this.user = user)); } goBack(): void { this.location.back(); } }

How to use the new getter and setter?

Please help me refactor the code. I wrote a component that is a form for sending questions. It also displays the questions as ... ions.push(question); }); }; .... .... But the console outputs an error: Duplicate identifier 'questions'.

Simulating multiple inheritance with method overrides

Last time I learned how to make the typescript see the methods being copied to the class prototype from another location. A ... th() {}, but in this case, the compiled code gets garbage, so I would not like to do this. PS: This question is in English.

Angular 2 and Typescript Inheritance

There are two components in which there are two identical functions. Based on the principles of OOP, it is most logical to pu ... how to design and in which folder to put the new class and, in general, is a similar approach used with respect to Angular?

How do I set the default value in a form field in Angular 2+?

Hello, I make fields for editing an object in angular, I ran into a problem when the fields already passed to value are not p ... placeholder="Контент" value="{{ content?.body }}"/> <input type="submit" value="Редактировать"/> </form>

Angular 2 unused Class

I analyze the examples on the documentation site https://angular.io/docs/ts/latest/guide/user-input.html And I can't connect ... ed. Also in main.ts added import { ClickMeComponent } from './click-me.component'; and this line also glows as not active.

How to specify a global variable from js in TypeScript?

TypeScript building webpack via ts-loader. There is a separate, non-typed js myNewLib file.js, in which the global variable m ... yLib, and declare that it is global, and then it is already in all files to use as global, is it possible to do this somehow?

The dart language compiles to JavaScript exactly the same as TypeScript?

I came across AngularDart, which is written in Google Dart. And I was wondering in the same JavaScript code it compiles TypeS ... not defined due to the loss of context, but in Dart the context is not lost => somehow everything is compiled differently.