Question about the error message getting from setting a prop to never vs setting a prop to undefined
I am trying to make a function that can receive some args together or none of the.
(Typings) create a composition function that inherits the types of its extensions
(This is a typings only question)
Make TypeScript infer generic argument
I have a base and a descendant type
Mapping tuple-typed value to different tuple-typed value without casts
I have one value of some tuple type, and I want to map it to a different tuple of a different type. The tuples are allowed to be heterogenous. Is there a way of performing this mapping without using the type cast in the example below?
How to define a generic type that accepts any object/interface with string keys only
I want UserSetting to throw an error at [k: number]: boolean;
how can i achieve this ?
create a sub set type/interface from a given interface
My scenario: I am trying to build a filter utility that takes an interfaces and at each stage it can eliminate few properties from the object, and you can chain multiple filter methods.
TypeScript: Generic type inference fails when reordering arguments in function with multiple generic callbacks
I’m implementing a type-safe shapeAdapter
function in TypeScript that takes an original object, an adapt
function to transform it, and a revert
function to convert it back.
Typing a map of generic functions with recursive callback in Typescript
I’m making a package that lets you define “actions” and then “trigger” them. Actions are functions that take some payload and a callback to trigger more actions recursively.
Typescript – how to type an endpoint to cover potential variations in the data
I’m converting legacy project from JS to TS and I’m learning TS at the same time.
I’ve stumbled upon an endpoint that has many different variants of responses.
Let’s say I only know part of the types, like in example below:
Functions calling each other with a subset of types, leading to unintended intersection and never type
I’ve added a simplified version of my problem here