I want to force all methods return the same type.
Like this:
interface ITextGenerator {
[key: string]: () => string
}
class TextGenerator implements ITextGenerator {
genarator1 = () => "text1"
genarator2 = () => "text2
}
Error in TextGenerator:
Class 'TextGenerator' incorrectly implements interface 'ITextGenerator'. Index signature is missing in type 'TextGenerator'.