I am using Algolia search with Typescript. The search result looks like:
{
hits: [
{
author: 'Author 1',
eventCategory: 'Major',
book: 'My Book1',
eventStarTime: 1683081900,
eventID: 2323213,
objectID: 'o-871278123',
_highlightResult: [Object]
},
{
author: 'Author 1',
eventCategory: 'Major',
book: 'My Book2',
eventStarTime: 1683084000,
eventID: 2344244,
objectID: 'o-871278456',
_highlightResult: [Object]
}
],
nbHits: 2,
page: 0,
nbPages: 1,
hitsPerPage: 20,
exhaustiveNbHits: true,
exhaustiveTypo: true,
exhaustive: { nbHits: true, typo: true },
query: '',
params: 'filters=isAuthor+%3D+1',
processingTimeMS: 1,
processingTimingsMS: { request: { queue: 4, roundTrip: 4 } },
serverTimeMS: 4
}
How can I parse this object to a custom interface? I am only interested in the following fields: author, eventCategory, book, eventStarTime, eventID, objectID
Ideally I want an array or list of my custom interface.
Thanks