TypeScript experts: how do you normally patch a type that is missing something you need? I have a few examples in the codebase I& #39;m working on, and I just keep adding ts-ignore& #39;s until I can get around to them https://abs.twimg.com/emoji/v2/... draggable="false" alt="😅" title="Lächelndes Gesicht mit offenem Mund und Angstschweiß" aria-label="Emoji: Lächelndes Gesicht mit offenem Mund und Angstschweiß">
Example: types/express-session adds a Session interface for req.session. However, it& #39;s not indexed by string so `req.session["key"]` is an error. I tried:

namespace express {
export interface Request {
session: { [k: string]: string }
}
}

but that overwrites it entirely
... so I don& #39;t get all the type information that was included in types/express-session in the first place. Ideally, what I& #39;d like to do is just add a string index to the Session type.
You can follow @mjackson.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: