Category "typescript"

RTK Query: Specifying error type per endpoint

Is there a way to specify error response per endpoint? Like we can specify Result & Request type when defining a query or mutation. I did went through the d

How to return a promise with alertcontroller in ionic 4?

I am trying to convert this ionic 3 code into ionic 4 but I don't know how the promise works on ionic 4. I tried looking into the documentations and I can't fin

How to restart a local hardhat node to initial state?

I am not really sure how to restart the state of the node to the initial state. Each time I try to redeploy a contract - I'm getting the same contract, the cons

Angular 10 - cannot force error using HttpClient delete()

so I'm following an Angular tutorial right now and in the error-handling-chapter I'm currently stuck because I cannot force an error to appear when feeding a Ht

Typescript: how to inference class type that implements an interface

Giving an interface interface IAnInterface { } How to reference and point to a class type that implements that interface! Meaning! Giving a class: class AClas

Cannot find memory leak in my Express.js Jest tests

I've now spent some time trying to find memory leaks in my Jest tests, and even though I've successfully tackled some, there's still quite a lot of memory being

can't resolve module inside subdirectory typescript

The module arrayGenerator.ts lies inside a subfolder, it works fine for other modules(Array.ts) inside the parent folder. But when I add a new module Sorting.ts

How to get Auth0 User object in getServerSideProps?

I am trying to use Auth0 with NextJS for user authentication. After login I want to access the user object in getServerSideProps. I followed this link below, St

How do i add typescript support to CDN version of vue?

I'm using the cdn version of vue on certain parts of my project. I want typescript support included on these parts of the project that are using vue cdn, but du

TypeORM Insert Cascade no effect

I Have a parent entity CostCenter that contains an Array of Coordinators, coordinators: Array<Coordinator> and this attribute has the typeORM annotations

Type 'Dispatch<SetStateAction<any[]>>' is not assignable to type '(values?: string) => void'

I'm very new to typescipt and trying to make a basic pin-input page. Sandbox link for my code . Although it is working, I'm getting this error for onChange func

How to test NestJs response interceptor

I tried to follow this thread but it I keep getting an error. transform-response.interceptor.ts: import { Injectable, NestInterceptor, ExecutionContext, CallHan

JSDoc equivalent to Typescript's `as const`?

I'm in an old project that is too huge to easily convert to Typescript, so I've been using JSDoc instead. The Typescript feature that I can't figure out how to

How to test CSS properties defined inside a class with react testing library

I am trying to test CSS properties that i have defined inside a class in css, wing the react testing library. However I am unable to do so. Adding the simplifie

Sending messages on Discord Bot start / on schedule using TypeScript

I've been building a Discord Bot in TypeScript for myself and a group of friends to use. I'm trying to send a message on client ready that's completely independ

How to properly write types for an array of generic React components and their properties?

I'm trying to properly type the following scenario: I have a manager/service that contains a collection of items, each item itself consisting of a React compone

Is there any way to modify the MatDialog overlay order?

I want to implement basic dialog handling in my application, with 2 functions: To close all open dialogs: Easy with MatDialog.closeAll(); Enable the user to swi

TypeScript error TS2403: Subsequent variable declarations must have the same type

I seem to be running into some compile errors on my TypeScript project. The full error is: node_modules/@types/mocha/index.d.ts:2680:13 - error TS2403: Subsequ

NestJs: Unable to read env variables in module files but able in service files?

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files

NestJs: Unable to read env variables in module files but able in service files?

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files