I have an async function that returns either a string or an array of strings. I've tried the following:
async getAllAnnotationTimes(): Promise<string> | Promise<string[]> {
return await this.app.client.getText(this.allAnnotationPositions);
}
I have also used this declaration: Promise<string> | Promise<Array<string>>
Which gives this error: [ts] The return type of an async function or method must be the global Promise<T> type.
The error seems to related to the part after the or (Promise<Array<string>>)
How do I declare a promised string array?