Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix: add missing enum imports to generated types file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominique Wirz committed Oct 19, 2023
1 parent 62bec4b commit 504db39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-components-react-wrapper/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const toTypeDeclaration = (elementName) =>
elementName,
)}> & { slot: string }>> & React.RefAttributes<HTMLElement | undefined>>;`;

export const toTypesFile = (types, enums) => `import type { JSX } from 'abc-web-components';
export const toTypesFile = (types, enums) => `import type { JSX, ${enums.join(', ')} } from 'abc-web-components';
import type React from 'react';
type IsEnum<T> = T extends ${enums.join(' | ')} ? true : false;
Expand Down

0 comments on commit 504db39

Please sign in to comment.