У меня есть следующий фрагмент кода:
public async insert(data: iFlower | iFlower[]): Promise<iFlower> | Promise<iFlower[]> {
await this.insert(data);
}
private async insert(data: iFlower): Promise<iFlower>{
....
return data;
}
private async insert(data: iFlower[]): Promise<iFlower[]> {
....
return data;
}
iFlower
is:
export interface iFlower {
color: string;
number: string;
}
Я получаю следующие ошибки: The return type of an async function or method must be the global Promise<T> type.
Duplicate function implementation.
'insert' is declared but its value is never read.
Это потому, что iFlower
- это интерфейс?