I can not solve the problem of type compatibility. Problem is there:
this.options.list.push(...this.cloudData.map((e: Words) => [e.word, e.size] as[string, number]) as[string, number][]);
options: Options = {
list: [] as ListEntry
};
where ListEntry is:
type ListEntry = [string, number];
And Error is:
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((...items: any[]) => number) | ((...items: [string, number][]) => number)' has no compatible call signatures.
Any ideas?
EDIT
Words type:
export class Words {
word: string;
size: number;
}
options.listis expecting a string as its first entry but you're giving it an array. - Joseph WebberWords? - arielslist: [] as ListEntry[]typescriptlang.org/play/… - Titian Cernicova-Dragomir