Currently delving into the world of TypeScript and I've got a question regarding destructuring. Let's say I have an object that needs to be destructured before using the variables. Here's an example:
type bookProps = {
books: Book[],
available: boolean
}
type Book = {
title: string,
author: string,
summary: string,
year: number,
genre: string,
_id: string
}
const [books, available] = info
Is there a way to destructure 'info' while declaring the type?