From e939da8a2b715b7ee520debca5e137eb67cd6afe Mon Sep 17 00:00:00 2001 From: heymdall Date: Fri, 15 Jun 2018 13:34:55 +0300 Subject: [PATCH] feat(typings): accept all HTML and React types as valid ts types --- typings/stringify-component-definition.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typings/stringify-component-definition.js b/typings/stringify-component-definition.js index 86ad314..cf27fc0 100644 --- a/typings/stringify-component-definition.js +++ b/typings/stringify-component-definition.js @@ -51,11 +51,13 @@ function stringifyType(type, componentName, propName, description, typeRefs) { case 'any': return 'any'; case 'Event': - case 'HTMLElement': case 'Date': case 'File': return type.name; default: + if (typeof type.name === 'string' && (type.name.startsWith('React.') || type.name.startsWith('HTML'))) { + return type.name; + } return 'any' + `/* Не нашёлся встроенный тип для типа ${JSON.stringify(type)} * https://github.com/alfa-laboratory/library-utils/issues/new