Most viewed questions in TypeSript

0 votes
1 answer

How to get TypeScript definition files via bower?

The best option is to use tsd. It ...READ MORE

Jun 10, 2022 in TypeSript by Nina
• 3,060 points
787 views
0 votes
0 answers

How can I create a navigational compass using Typescript and HTML?

I'm looking to display a compass heading ...READ MORE

Jul 13, 2022 in TypeSript by Logan
• 2,140 points
778 views
0 votes
0 answers

What should the return type of Promise.race be? (Typescript)

For example in the code below, what ...READ MORE

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
769 views
0 votes
1 answer

Measuring web performance metrices in TypeScript front end program

The performance metrics are provided by the ...READ MORE

Jun 1, 2022 in TypeSript by Nina
• 3,060 points
766 views
0 votes
0 answers

Typescript hierarchical inheritance

Consider the following: class A { commonString: ...READ MORE

Jul 5, 2022 in TypeSript by Nina
• 3,060 points

edited Dec 6, 2023 by Soumya 760 views
0 votes
0 answers

User-Defined Extended Enums in TypeScript

I am writing a TypeScript library that ...READ MORE

Jul 18, 2022 in TypeSript by Logan
• 2,140 points
756 views
0 votes
1 answer

Conversion from both keys and values of object

You could just change the declaration of ...READ MORE

May 31, 2022 in TypeSript by Nina
• 3,060 points
751 views
0 votes
1 answer

Is it possible to extend types in Typescript?

you can intersect types: type TypeA = { ...READ MORE

Jun 7, 2022 in TypeSript by Nina
• 3,060 points
742 views
0 votes
0 answers

TypeScript: for-in statement

TypeScript docs say nothing about loop like ...READ MORE

Jun 3, 2022 in TypeSript by Logan
• 2,140 points
736 views
0 votes
1 answer

What does <T> do in TypeSript?

This is a TS Generics declaration. T will be declared ...READ MORE

May 31, 2022 in TypeSript by Nina
• 3,060 points
705 views
0 votes
1 answer

How to typecast a string to number in TypeScript?

You can use the parseInt or parseFloat functions, or simply use ...READ MORE

Jun 9, 2022 in TypeSript by Nina
• 3,060 points
686 views
0 votes
1 answer

how to use spread syntax and new Set() with TypeScript

The ... operator should work on anything ...READ MORE

Jun 10, 2022 in TypeSript by Nina
• 3,060 points
673 views
0 votes
0 answers

Function definition syntax confuse in Typescript

I figure that out: One post in ...READ MORE

Jul 5, 2022 in TypeSript by Nina
• 3,060 points
671 views
0 votes
0 answers

Applying pdf watermark at typescript side

I am trying to add a watermark ...READ MORE

Jul 14, 2022 in TypeSript by Logan
• 2,140 points
655 views
0 votes
0 answers

In typescript, why do the | and & operators flip their meaning when used on function types?

In this code, example1 and example2 are confusing me: type F1 = ...READ MORE

Jul 13, 2022 in TypeSript by Logan
• 2,140 points
644 views
0 votes
0 answers

Alternative to decorate function in TypeScript

Since TypeScript allows decorate only class, method, ...READ MORE

Jul 14, 2022 in TypeSript by Logan
• 2,140 points
626 views
0 votes
0 answers

TypeScript: Typing the result of an external module's non-mutating extension function

Let's say I'm using external package "foo". ...READ MORE

Jul 18, 2022 in TypeSript by Logan
• 2,140 points
615 views
0 votes
1 answer

Difference between interfaces and classes in Typescript

Interfaces Describe how an object should look Exists compile ...READ MORE

Jun 15, 2022 in TypeSript by Nina
• 3,060 points
597 views
0 votes
0 answers

How to watch typescript files in the background continuously without blocking the terminal?

Is there a way to run tsc ...READ MORE

Jul 14, 2022 in TypeSript by Logan
• 2,140 points
571 views
0 votes
0 answers

What is TypeScript and why would I use it in place of JavaScript?

Can you please describe what the TypeScript ...READ MORE

Jul 18, 2022 in TypeSript by Logan
• 2,140 points
544 views
0 votes
1 answer

Naming of TypeScript's union and intersection types

The type A | B refers to objects which ...READ MORE

Jun 10, 2022 in TypeSript by Nina
• 3,060 points
541 views
0 votes
0 answers

What is the way of declaring an array in JavaScript?

These are some of the way to ...READ MORE

Aug 3, 2022 in TypeSript by krishna
• 2,820 points
500 views
0 votes
1 answer

Is it necessary to learn TypeScript first before going to explore Angular2?

It's not necessary to learn TypeScript but ...READ MORE

Jun 10, 2022 in TypeSript by Nina
• 3,060 points
495 views
0 votes
0 answers

I don't know about return type in typescript

TYPESCRIPT 3.4.3 I want to make function like ...READ MORE

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
383 views
0 votes
0 answers

What is argument of type 'never[ ]' is not assignable to parameter of type 'string' in TypeScript

This is my code : export default class ...READ MORE

Apr 18, 2023 in TypeSript by anonymous

edited Mar 5 217 views
0 votes
0 answers

npm installing old versions of (typescript compiler) package

On a windows environment, I have: node ...READ MORE

Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points

edited Mar 4 179 views
0 votes
0 answers

How to cast a json in typescript?

How to remove properties automatictly? READ MORE

Nov 10, 2022 in TypeSript by Alexandre

edited Mar 4 164 views
0 votes
0 answers

Optional property class in typescript

I'm new in typescript and I want ...READ MORE

Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points

edited Mar 4 151 views
0 votes
0 answers

typescript - create type that denotes the set of even numbers

Can anyone know how to create this ...READ MORE

Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points

edited Mar 4 137 views
0 votes
0 answers

Ignore typescript definition error

I have a 3rd party typescript definition ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 87 views
0 votes
0 answers

Property 'value' does not exist on type EventTarget in TypeScript

So the following code is in Angular ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 86 views
0 votes
0 answers

typescript interface require one of two properties to exist

I'm trying to create an interface that ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 83 views
0 votes
0 answers

What is the difference between var and let in Typescript?

I submitted a question on stack overflow ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 82 views
0 votes
0 answers

Typescript compiler can't find node with yarn - Cannot find type definition file for 'node'

I have @types/node installed. I'm using Yarn ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 80 views
0 votes
0 answers

TypeScript A computed property name in a type literal must directly refer to a built-in symbol

I'm looking forward an object which contains ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 77 views
0 votes
0 answers

React Typescript: It looks like you're trying to use TypeScript but do not have typescript installed

I want to create a React application ...READ MORE

Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points

edited Mar 4 75 views
0 votes
0 answers

How to install and run Typescript locally in npm?

I want to install and run Typescript ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 75 views
0 votes
0 answers

When to use Interface and Model in TypeScript / Angular

I recently watched a Tutorial on Angular ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 74 views
0 votes
0 answers

How to add Typescript definitions to Express req & res?

I have a set of controller functions ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 73 views
0 votes
0 answers

Define prototype function with typescript

When I try to define a prototype ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 73 views
0 votes
0 answers

Enforcing the type of the indexed members of a Typescript object?

I would like to store a mapping ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 73 views
0 votes
0 answers

Typescript how to create type with common properties of two types?

There are 2 types type A = { ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 71 views
0 votes
0 answers

Declare an array in TypeScript

I'm having trouble either declaring or using ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 71 views
0 votes
0 answers

Difference between Javascript object and Typescript object

I am trying to figure out if ...READ MORE

Aug 1, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 71 views
0 votes
0 answers

How can I define the type for a <video> reference in React using Typescript?

I'm trying to control the play/pause state ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 67 views
0 votes
0 answers

How to install all typescript definition file based on packages.json?

In my project, I have a package.json ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 64 views
0 votes
0 answers

Typescript & operator

I'm struggling to find the definition of ...READ MORE

Aug 3, 2022 in TypeSript by Deepak
• 980 points

edited Mar 4 63 views
0 votes
0 answers

Source has 2 element(s) but target allows only 1. Typescript spread operator

I'm trying to spread all values in ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 60 views
0 votes
0 answers

Use typescript to dynamically set class property in constructor

I am trying create a typescript class MyClass with ...READ MORE

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 58 views
0 votes
0 answers

In TypeScript how can I declare class method synonym?

I want to define class method which ...READ MORE

Jul 18, 2022 in TypeSript by Logan
• 2,140 points

edited Mar 4 58 views