I'm trying to properly type the props for a component that maps children: type Props = { children: any } const MyComponent: FunctionComponent<Props>
I have a slightly complex object that has typed keys on the top-most level of the object, as well as the deepest level of the object, and I can't seem to be abl
I am working on a meta framework that will use react. I would like to offer some functions that are directly available without the need of an import, exactly li
The origin of the following autogenerated type is a GraphQL query: export type OfferQuery = { __typename?: 'Query' } & { offer: Types.Maybe< { __ty
Currently pdfjs-dist https://github.com/mozilla/pdfjs-dist/tree/bd2a6cd87f9e0c3a9b3197d5d27acfb99886629b contains the d.ts and js files in separate folders: htt
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
Currently using typescript 3.4.5 with strict mode enabled... Backstory I just ran into a situation where typescript failed to protect me from my own mistakes
I would like to strongly type my jest mocks. To a certain extent, I can make it work but when a class has private properties I'm stuck. An additional question,
I'm writing a React app using TypeScript. I use material-ui for my components. I'm writing a custom wrapper for material-ui's Button component. It looks like th
Is there any trick to "evaluate" the type of a generic fuction? Consider the following: type Arr = <A>() => A[] type Ev<G, A> = ??? Question: I
I'm looking for ways to define an empty object type that can't hold any values. type EmptyObject = {} const MyObject: EmptyObject = { thisShouldNotWork: {},
We use as const to narrow the types: [ {foo: 'foo' }, { bar: 'bar' } ] as const but this also adds readonly modifiers for all props and values. As of const thi
I need an interface for making some fields of other interface as required. For example: I have IUserInterface: interface IUser { name: string; role?: str
How to declare the function wraps that takes any function and returns a version of it that differs only in returning an object that wraps the original return ty
In my react and typescript app, I use: onChange={(e) => data.motto = (e.target as any).value} How do I correctly define the typings for the class, so I woul
I am getting File node_modules/@types/webrtc/index.d.ts is not a module with this code: import * as webrtc from "webrtc"; const peerConnection1 = new RTCPeerCo
The DefinitelyTyped definition of the Node built-in IncomingMessage (the type of req in the (req, res, next) arguments) has defined url to be nullable. Here's t
I'm trying to write a lib in Typescript that I want to use in various other typescript or JS projects. All of the those other projects run in browsers. My Type
check this snippet: interface Foo { id: string; } const fooFunc = (arr: Foo[]): Foo[] => arr .map((item: Foo): Foo | null => { const so
Ive been getting these strange type errors on my typescript project for certain packages. Ex: 'TimeAgo' cannot be used as a JSX component. Its instance type '