Consider the following interface that represents an array of objects.
export interface App {
entry: object;
content: {
label: string;
visible: boolean;
};
name: string;
length: number;
}
export type AppsList<Response> = App[];
I am attempting to have AppsList extend Response since Response type is necessary in the code below.
However, I encounter the error message: Generic type 'AppsList' requires 1 type argument(s).ts(2314)
export function getLocalApps(userPrefsAppOrder: string): Promise<unknown> {
return new Promise((resolve, reject) => {
fetchLocalApps()
.then((res: AppsList) => {
resolve(orderApps(filterInternalApps(res.entry), userPrefsAppOrder));
})
.catch(e => reject(e));
});
};