说我有以下内容:
interface Validator {
validate: (value: string) => boolean;
errorMessage: string;
}
interface EditDialogField {
label: string;
prop: string;
required?: boolean;
type: 'input';
validators?: Validator[];
}
这很有用,因为 IntelliSense 在我使用这些接口(interface)时会弹出建议,但我希望能够添加也显示在 IntelliSense 中的注释(特别是 VS Code)。这可能吗?
最佳答案
知道了!
interface EditDialogField {
/** Explain label here */
label: string;
/** Explain prop here */
prop: string;
required?: boolean;
type: 'input';
validators?: Validator[];
}
关于typescript - 有没有办法在 TypeScript 的界面中记录字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51641378/