Category "typescript"

AWS cdk error when trying to create App Runner

I'm trying to deploy my application with App Runner in AWS via CDK. It's based on https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apprunner.Service

React MUI Autocomplete "options.filter" is not a function

I wish to create a autocomplete search bar with my own custom call to the backend, which searches through a list of tickers. <Autocomplete mu

How to use ${text} interpolation from a variable in Angular?

This question is about ts inline text interpolation in Angular (not template interpolation for the HTML files). I couldn't find relevant information about my qu

How to replace a specific position of a main grid (array of arrays)?

I'm coding a minesweeper and I got the UI and I can't modify it. I've made the grid for different sizes but now I need to push the mines into it, I created a fu

After installing TypeScript, why does "Peek Definition" in Visual Studio Code stop working?

I'm very new to TypeScript and am trying to figure why, when transitioning a project to TypeScript in Visual Studio Code, "Peek Definition" stops working. Befor

Next.js is not recognizing '@types/react'

When I try to run my Next.js app with npm run dev I get an error message saying that I don't have the required packages to run Next with Typescript: Please inst

TypeScript type for all derived interfaces

I have an interface inheritence hierarchy like this: interface IBase { type: stirng; } interface IDerived1 extends IBase { type: "Derived1"; } interface IDerive

Checking if the entered date is the start of a quarter

Good afternoon! Can you please tell me how to implement a function that checks if the passed date is the beginning of the quarter? I tried to implement validati

Use typescript to dynamically set class property in constructor

I am trying create a typescript class MyClass with instance properties set dynamically in the constructor: const myInstance = new MyClass(({ someField: 'foo'

Angular Node - require not being used

In my Angular 13.x / Typescript 4.x project I have a reference to a node_module @types\prosemirror-schema-list In it the code uses require : I added import Ord

mat-icon text is showing in dropdown and icons in Angular

I tried using mat-icon in Angular in dropdown. But the text is shown first and after clicking dropdown it is showing the icons. I already tried importing in ind

Dependent Disjoint Unions in Typescript

Given a simple Record<string, Record<string, any>> defined as a constant record of possible named configurations, I want a type which dynamically re

How to use a class as a type in a variable with typescript?

I'm bit confused in how to use OOP in typescript. I'm used to do it with PHP. 1 - Can I use a class as a type without having to fill all attributes values? 2 -

How to keep the parent list item open when we click on submenu list item using Angular and jQuery?

I need to show the menus with submenus dynamically. What I did is, I have loaded the menus list from json and displaying that menus using ngFor in angular. Like

Persist-reducer function giving type error to my reducer in typescript

I am trying to configure react-persist in my typescript react application. The persistReducer function is giving a type error to my reducer that Argument of typ

Decorator isn't getting triggered in typescript project

I have @OnChange decorator which receives a callback after the value of the property is triggered. export interface SimpleChange<T> { firstChange: boo

Generics in typescript object indexers

I've been trying to make a type whose indexer has a return type which is based upon a string literal for the key. export enum Units { Enum = 'enum', Str

How to resolve React Native Web error "This experimental syntax requires enabling one of the following parser plugin(s): 'jsx', 'flow', 'typescript'."

I have been working on a react-native-web project without issue and recently added the react-native-gifted-charts module which is when I began receiving this er

"Tsc" is disabled on my system when I used visual studio Code to run Type Script file, what shoud I do?

PS D:\WEB DESIGN INFO\Type Script\project 2> tsc is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fw

Get AST nodes typescript name from SpreadOperator RuleListener Identifier node argument

I would like to get the node.argument properties Typescript types name, and check if it's Foo. Let's say the Foo type is defined like this: type Foo = {}; This