make reflected types show up in docs

pull/463/head
Cory LaViska 2021-05-30 09:46:09 -04:00
rodzic 0dbb72efe9
commit e7d7469c4e
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -32,6 +32,18 @@ function getTypeInfo(item) {
});
}
if (item.type.type === 'reflection' && item.type.declaration?.children) {
const args = item.type.declaration.children.map(prop => {
const name = prop.name;
const type = prop.type.name;
const isOptional = prop.flags.isOptional === true;
return `${name}${isOptional ? '?' : ''}: ${type}`;
});
// Display as an object
type += `{ ${args.join(', ')} }`;
}
return {
type,
values: values.length ? values : undefined