<分区>
给定一个接口(interface)
interface IAmOptional {
optional? : string,
optional2?: string
forced: string
}
有没有办法以这种实现失败的方式来隐藏、扩展或类似IAmOptional
?
class someClass {
thisShouldHaveAllKeys : IAmOptional = { // Forced<IAmOptional> ??
forced: 'i am forced'
} // Here I want an error like 'thisShouldHaveAllKeys does not have optional and optional2'
}