Improve typings (#813)
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
This commit is contained in:
committed by
delvedor
parent
fb365c9adf
commit
e6f0d272ca
@ -74,10 +74,10 @@ export interface Generic {
|
||||
}
|
||||
|
||||
const code = `
|
||||
export interface ${name[0].toUpperCase() + name.slice(1)} extends Generic {
|
||||
export interface ${name[0].toUpperCase() + name.slice(1)}${body ? '<T = any>' : ''} extends Generic {
|
||||
${partsArr.map(genLine).join('\n ')}
|
||||
${paramsArr.map(genLine).join('\n ')}
|
||||
${body ? `body${body.required ? '' : '?'}: any;` : ''}
|
||||
${body ? `body${body.required ? '' : '?'}: T;` : ''}
|
||||
}
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user