Category "typescript"

Include reference to TypeScript library in Jest config for another library

I have a shared typescript library that exports a function being used by a react library. Everything works at runtime, however when running the tests for the re

TypeError when running "blitz dev" command

I'm currently trying to run my blitz project. Worked fine at first, but after a few changes, this error starts to pop out everytime i tried to run blitz dev to

React Antd: How to remove spacing between vertical divider and any content right next to it?

</div> <Divider type="vertical" style={{ width: "5px", height: "auto" , marginRight : '0px' , padding : '0 0'}} /> <div style={{ padding : '0 0'

react-xarrows not updating lines in position

There are some issues I'm having while using the react-xarrows with mui. I'm trying to achieve: The line should be connected in the same position after toggling

WebdriverIO: automating native upload window that opens on button click in electron

I am trying to automate file upload in Electron, but Native upload is used that is open when the upload button is clicked, so there is no input element to set t

Why is onClick misbehaving and sometimes not showing data behind it?

New to typescript and have been using it for 2 days now mainly to build a custom component for my streamlit app. I have created the below navigation bar and the

Typscript Error on Class Constructor - No index signature with a parameter of type 'string' was found on type 'BarberModel'

I have a class constructor and I want populate it with an object that I receive in constructor. But I don't know how to solve this TS error on line this[key] =

Build a dynamic interface for Object in angular

I have an JSON Object received from an api call and the Object will have multiple values but all of type string. How to I write an Interface for such an Object

How to create generic that extends union type of class programaticaly

I have following the code: const events = { a: ['event1' as const, 'event2' as const], b: ['event3' as const, 'event4' as const], }; class SomeClass<

Creating service in React Typescript using axios

There are two different ways to create a service and call from the required funtional component. 1. export const userProfileService = { ResetPassword: asyn

Differentiating custom Typescript Interfaces that have the same fields

I have a custom interface like this: interface Pointer<T> { id: string } id is a pointer to other data structures, but the id field doesn't contain inf

TypeScript Mapped Type - Convert type properties to instances of type

I am trying to convert an object full of class constructors to a mapped object with properties that are functions that return an instance. For example: // From

What does this mean in angular, what kind of type is this?

I would like to know what this type means: type newtype = (state: EntityState<IEntities>) => IEntities[];

Define an "extends string" type that doesn't allow union of strings

I have this function function something<T extends string>(): void { // ... } I would like to restrict T to be a SINGLE string, and not a union of strin

cls-hooked: AssertionError [ERR_ASSERTION]: context not currently entered; can't exit

I'm currently deploying an express app to Heroku. I'm using cls-hooked to set request ids for each request. This works perfectly on my local machine and inside

What's the ideal way to add set data to a database in Nest.JS when starting the app for the first time?

I have a database with quite a few tables, and some of those tables need to have default information in them - stuff like categories, permissions, roles, tags,

Is there a way to keep type inference in union types from type guards inside a function?

Let's say I have three types (and a union one) type A = { type: 'a' title: string description: string } type B = { type: 'b' title: string

Nested object from an array using lodash in typescript

My Data structure reads this {property: ["a","b"] , value : "somevalue" , comparision : "somecomparison"} I want to create a object out of it like { "propertie

Do these two snippets return the same value?

I'm not sure how to title this question, but it's concerning a pattern where the || operator is used to resolve a sequence of undefined values to the first defi

ESLint rules for no-unused-enums

There's a no-unused-vars eslint rule that can warn/error if a variable is unused: https://eslint.org/docs/rules/no-unused-vars If I want to ensure that there ar