我声明这一点:
export interface Interface {
func: string[][] => string[][];
}
我得到了这个:
error TS1005: ';' expected.
func: string[][] => string[][];
~~
error TS1131: Property or signature expected.
func: string[][] => string[][];
~~~~~~
error TS1011: An element access expression should take an argument.
func: string[][] => string[][];
error TS1011: An element access expression should take an argument.
func: string[][] => string[][];
error TS1128: Declaration or statement expected.
}
~
这里的正确语法是什么?
发布于 2020-04-17 07:38:24
箭头函数'=>‘创建一个表达式。另一方面,接口是一个定义,所以你可以这样做:
export interface Interface {
func(arg: string[][]): string[][];
}
https://stackoverflow.com/questions/61266000
复制相似问题