Category "typescript"

Vuejs types for component refs

I have following scenario: I have an component here: <div class="border shadow p-2"> <chart :config="barConfig" ref="linechart" /> </div>

How to use same enum in multiple files in Typescript without import

I've been struggling with this now longer than I should and surprisingly, the existing questions (and there are many) don't really help further. My goal is to d

map multiple properties to single nested object using typescript and class-transformer

I'm using class-transformer (in nestjs) to convert my database entities into dto types to output from my api. My database entities look like: class MyEntity {

How to infer first element of a tuple as a tuple type

I'm unable to properly infer the first type of a tuple of arbitrary length as a tuple type, in order to maintain its label: type First1<T extends any[]> =

Extending tsconfig files not resolving the paths properly?

I am getting an issue with tsconfig after upgrading the package version. Below is my folder structure (simplified, but keeping the actual hierarchy): The tsconf

How to test a function inside useEffect with Jest and Enzyme?

I am testing my components using jest and enzyme. I want to load my component when the whole page is loaded so I am using load event inside useEffect, here is m

Apollo-Server display errors in a clean mannor

I'm pretty sure that the question is self explanatory. I'm using 'apollo-server-core' 3.6.5 Errors I want to get { "errors": [ { "messa

Keyof as generic

I'm trying to force someone that want to update an object to pass a the key to update with a correct value type. As seen in the playground typescript seems unab

How to add bootstrap 5 and other global packages to a SvelteKit project?

I installed bootstrap using NPM In a normal svelte project I usualy add bootstrap and other packages, which are used project wide, in the App.ts file. However,

Property 'user' does not exist on type 'void'.ts(2339)

I am trying to create singup form with firebase i am following this video and now i have this error i dont know what is problem and how to fix it This is my aut

How to extends abstract class from template in TypeScript?

I have an architecture like that and I want to extends my TemplateService with a template but actually I have an error on it. Is there a way to extends an abstr

Spread values not being recognized in Create method

Deno has sessionStorage globally available, which is what I'm using as my in-memory database. I'm working on a method that creates a new museum in sessionStorag

Is there any way to add ui-element, ElMessageBox confirm button click event?

When I delete a data from the table, I want it to pop up a warning in the middle of the screen first.Delete function is ready,i just want to add confirm button

vsCode dependencies bug with nestJs

my vsCode bug to recognize dependencies when i program with nestJs, after setting up the project with: nest new projectname then after running for example: npm

Alternative to index signature

I have an array of object like this: [ { "bio": "Douglas Gerald Hurley is an American engineer, former Marine Corps pilot and former NASA astronaut. He la

Cdktf Optional block

How to make block optional if the value for the below block not provided? const BackupType=new TerraformVariable(this,"BackupType",{ description:"(Require

how to make an iterable type in type script that has a key value pair

I am using type script and I want to make a type that represents an object like this the keys generated are genrated dynamically how do I do that { dog:true,

createAsyncThunk redux toolkit with typescript rejecWithValue and Payload types error

I'm trynig to implement authentifiaction slice in redux toolkit with typescript, but typescript is complaining about rejectWithValue error type and the action p

Typescript: this.property inside a function gives error of type implicitly any. Can't call new Object();

I'm trying to integrate typescript into my learning path and understanding the differences with javascript. So far I was able to resolve all issues but I got st

MongoDB, get documents by a field, and mergeObject from another collections grouped count

Okay, the title is a bit too verbose and complicated but I have no idea how to put it any better. So here's what I have ModelA ModelB that has reference to Mode