How to generate interfaces instead of types
Description
Sorry, I can't find the configuration option.
export type DeviceEntry = {
}
I want the generated interface to be
export interface DeviceEntry = {
}
Because it's not a feature! @Carseason what's prompting this request?
I need to use declare modul when extending attributes
Can you illustrate how this would help?
Sorry my English is not very good, If it is an interface, I can easily add more properties to the model.
export declare module '~/generated/types' {
interface DeviceEntry {
isMonopo?: boolean
};
}
中文也可以
Why are you looking to extend types? Why don't they have those properties you want to manually add?
后端发布的文档,前端业务需要自定义一些字段参数
Why can't backend make that change? I'm just gathering context for this feature so the more you can explain, the better I understand it
- 因为后端增删字段需要发布新的版本,前端业务不一定有时间等待,后端也不一定愿意
- interface 实现可以增加一些自定义方法来使用
export interface DeviceEntry {
isLocal?:()=>boolean
}
3.在不修改swagger的情况下,typescript提供的 declare module 能很好的扩展的