Skip to content

Instantly share code, notes, and snippets.

View thebuilder's full-sized avatar

Daniel Schmidt thebuilder

View GitHub Profile
@thebuilder
thebuilder / arrayElement.ts
Created July 20, 2022 10:25
TypeScript: Pick type of item in an Array
/**
* Get an element from an array
* @example
* interface Item {
* id: number
* }
*
* interface BunchOfItems extends Array<Item> {}
*
* interface SingleItemAgain extends ArrayElement<BunchOfItems> {}