Type is missing the following properties from type

Discussão em 'Angular' iniciado por coolblue2000, Novembro 12, 2024.

  1. coolblue2000

    coolblue2000 Guest

    I have the following interface in a typescript file.

    export interface TempContext {
    FriendlyName?: boolean;
    hList: SelectFilterListItem[];
    }


    SelectFilterListItem is an interface in another file

    export interface SelectFilterListItem {
    name: string;
    value: any;
    }


    I then want to use this in a function in the same file

    filterDef: new SelectFilterDef({
    filterList: (context: TempContext) => context.hList,
    }),


    I get the following error


    Type '(context: TempContext) => SelectFilterListItem[]' is missing the following properties from type 'SelectFilterListItem[]': pop, push, concat, join, and 25 more.
    ​

    Continue reading...

Compartilhe esta Página