H
H
herasko-siarhei2022-04-04 16:11:32
typescript
herasko-siarhei, 2022-04-04 16:11:32

How to extend a type inside a TypeScript interface?

There is an interface of this kind
export interface IGetMovies {
page: number;
results: {
poster_path: string | null;
adult: boolean;
overview:string;
release_date: string;
genre_ids: number[];
id: number;
original_title: string;
original_language:string;
title:string;
backdrop_path:string | null;
popularity: number;
vote_count: number;
video: boolean;
vote_average: number;
}[];
total_results: number;
total_pages: number;
}

How can one extend the results type inside this interface, i.e. add new lines to IGetMovies -> results.
Is it possible to do this without putting results in a separate interface?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question