Category "typescript"

Can I mock one function exported from a typescript module that uses ES6 import style

I have been struggling with some specific ES6 importing-style and using with Jest mocking in typescript. It's very specific, so I wrote this example puzzle to

TS2304 TypeScript (TS) Cannot find name

I am getting this error about Cannot find name 'Record' is that a package I need to install for this class? Severity Code Description File Project Line

How do I wait for users to click on certain buttons in component, then return a value from that in a function depending on which button was pressed?

I have an overlay component that appears when a user clicks on certain things in my page, and in this overlay it gives a warning and 2 buttons, one for yes and

React i18n - "t" function doesn't accept string variables (typescript)? "No overload matches this call"

anyone familiar with this error: [code with error message][1] [1]: https://i.stack.imgur.com/SbJvu.png {t(`${settingType}` as const)} error: No overload matche

Inconvenience when working `as const` arrays - readonly T[] not assignable to T[] - how to remove readonly modifier from array [duplicate]

I keep running into this problem all the time (playground link): const arr = [1,2,3] as const const doSomethingWithNumbers = <T extends nu

force folder structure and names in a repository using eslint

I'm looking to force a structure of names in a specific path for a folder and it's sub folders not only the styling of the names (kebab, camel) but the actual n

NestJs e2e returns 201 created response though required form data is missing, expected 400 bad request

I'm trying to write a test that checks if request body does not have proper data, it should return an error, and the status code should be 400. Which I think is

How to generate safe RSA keys deterministically using a seed?

How do we use a mnemonic list of words as a seed (like we have been become accustomed using cryptocurrency wallets) to be able to recover a private key in case

How to make Chain multiple RxJS observables subscribe angular 8?

I work on angular 8 i have multiple subscribe i need to make Chain multiple RxJS for getactivesession and after that subscribe PostUpload . What I have tried:

Angular not grabbing elements by class name when page is loaded

I am trying to get the document.getElementsByClassName('side-nav-link-ref'); elements in my angular html view and It keeps returning empty. I’ve narrowed

React Context State Not Updating

My Context: type Props = { children: React.ReactNode; }; interface Context { postIsDraft: boolean; setPostIsDraft: Dispatch<SetStateAction<boolean&

Property 'accessToken' does not exist on type 'User' && firebase is not defined

I am using TypeScript in my React application and I have an error "Property 'accessToken' does not exist on type 'User'" when getting an accessToken of user My

Test Typescript Service : Multiple Subscription on one Observable

I am having a problem performing a test on a typescript service. I have a function that returns an observable. I use .subscribe() to look at the result and veri

How to create a GraphQL typed SDK from a Typescript schema object?

I have a code-first GraphQL API in which the GraphQLSchema is created like so: import { GraphQLSchema } from 'graphql'; import { mutationType } from './mutation

checking array of objects

I wanted to check if each length of array of objects of inspectionScheduleUnitContactArtifactDto , if there is one inspectionScheduleUnitContactArtifactDto whic

React 18 Fragment complaining of too many children

A few days ago I tried to add Storybook to my React app, and basically everything imploded. I restored from a backup, but it didn't include the node_modules fol

setRateLimitPerUser does not exist

I'm creating a slow mode command for my discord bot. I create the bot with typescript and I wonder why setRateLimitPerUser does not exist. What can I use instea

How to use MUI to stack components on top of eachother?

I want a div that looks like this on Desktop: ------------------------------------------------------------------ | (icon) | (content)

bundle.js TypeError: Cannot read propertied of undefined (reading PriceIndexationDataControlStandard)

I am developing a React component via Microsoft PCF Framework and I have encountered a very strange error out of nowhere. I was changing only typescript, not ev

How can I assign a value to a variable of a callable type?

How can I assign a variable of a callable type (type with call signature)? interface CallableType<T> { (isSomething: boolean): T description: string