From 54a4ccb39ac56bf1f8124954ad0d4e5838743c6e Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 23 Jul 2019 17:36:55 -0700 Subject: [PATCH] feat: support Partial style types --- src/utils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 245d8ac..0b61bb5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -176,6 +176,11 @@ export const typify = ( } debug(chalk.red('Record with missing inner types, default to any')); return 'Record'; + case 'partial': + if (!innerTypes || innerTypes.length !== 1) { + throw new Error('Partial generic type must have exactly one inner type. i.e. Partial'); + } + return `Partial<${typify(innerTypes[0])}>`; case 'url': return 'string'; case 'touchbaritem':