Category "typescript"

How do I upload multiple files in array in Angulars reactive forms, from an API and send the data as a number to the array

***ERROR IMAGE: *** https://ibb.co/JKd0hV3 Who can help me solve this problem, I get a 490error whenever I run this code. Am I missing something or need to refa

How to capture Typescript conditional property type

I have the following Typescript type: type Config = { key: string, type: `input` | `switch` | `radios` | `select` | `checklist` | `image`, options: string

Merge multiple POST requests based on the same value of each array. (Angular)

These are the two outputs "statusCode": 200, "data": [ { "color": { "id": "1111", "name": null,

How to access FlowNode in typescript ast api?

I try to resolve foo and bar from nodes variable. After I checked at ts-ast-viewer you can see in the picture that typescript can know about foo and bar from no

Typing Object.fromEntries(new FormData(form))

TypeScript newbie here, having problems with Object.fromEntries. I'm trying to pares form and cast its values to something else. For example, given homogeneous

Typescript generics with functions Parameters

I'm trying to open a typescript method using generics. There is an object with methods (the comment indicated different types of function parameters) const emai

Shadowdom access form selenium javascript/typescript

I'm trying to get access to some shadow dom elements using selenium in Javascript/Typescript, but can't quite seem to get it to work as expected. I haven't bee

Tuple inference via literal typing (i.e brute force typing)

This seems so obvious and simple, but I can't get it to work. Would love to get everybody's perspective to see if you can find what am I missing. Playground con

Ignore Typescript errors in submodule

I have created a Typescript React project using create-react-app. I have also added a library via submodule. However, Typescript keeps reporting error on the su

Using redux toolkit in NextJS without next-redux-wrapper

I'm new to NextJS and I'm trying to figure out on how to implement RTK, I stumbled on this github repo example from Jack Harrington and basically his slices has

Destructure a function parameter in Typescript

I'm trying to give a type to the members of below function. args is an object with a data property of type UserCreateInput So, from this: createUser(parent: a

Typescript Function Arguement with Child/Inherited class?

I am trying to write a function that sets some properties on its arguments (not return a new object), the argument is of a class that extends from the same base

How to create a generic buffer in TypeScript?

I have the following class: export class BufferData { arr: Float32Array; index: number; constructor() { this.arr = new Float32Array(8); this.inde

ERROR Error: Uncaught (in promise): FirebaseError: Firebase: Error (auth/argument-error). I already enabled my google sign in firebase. How can i fix

I'm trying to use google sign in from firebase in my ionic angular project, I follow the tutorial, the compilation was good but when i click the sign in button

How to import js module when Typescript declaration file is located in a separate directory?

Question: When I run npm run build with the configuration below, rollup.js is unable to resolve the dependency (import) and displays the following message below

Angular MatStepper fails to recognize cached values from two str arrays (but successfully recognizes values from another str array)

I have a MatStepper that's used to navigate to the next page of a signup flow. I also have a method that loads values from a cache if it's available, and if so

unable to determine transport target for "pino-pretty"

I am trying to use pino library but I am getting error My code I created a logger.js file and imported pino from node_module and added transport of pino-pretty.

Error in React-Router: 'Type expected. TS1110' after deleting my node_modules folder and package-lock.json

My project was working perfectly well but I went and accidentally deleted my node_modules folder and package-lock.json and then reinstalled everything using npm

How to create a signal that delays the underlying signal and clears immediately

I want to make a signal that sets itself to underlying signal or a memo after a certain delay, and clears immediately if the underlying signal is cleared. The f

Condtional type is not working properly as return type

I'm trying to make a settings system for my desktop app. having a config that includes several settings like add_while_paused, min_chars, and startup_settings (