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

Commit

Permalink
fix: use Components instead of JSX for type definition (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominique Wirz <[email protected]>
  • Loading branch information
dwirz and Dominique Wirz authored Nov 2, 2023
1 parent 9126f62 commit a18ce24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web-components-react-wrapper/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ ${toExport(toPascalCase(elementName))}
const toTypeDeclaration = (elementName) =>
`declare const ${toPascalCase(
elementName,
)}: React.ForwardRefExoticComponent<React.PropsWithChildren<Partial<EnumsToStringLiterals<JSX.${toPascalCase(
)}: React.ForwardRefExoticComponent<React.PropsWithChildren<Partial<EnumsToStringLiterals<Components.${toPascalCase(
elementName,
)}> & { slot: string }>> & React.RefAttributes<HTMLElement | undefined>>;`;

export const toTypesFile = (types, enums) => `import type { JSX, ${enums.join(', ')} } from 'abc-web-components';
export const toTypesFile = (types, enums) => `import type { Components, ${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 a18ce24

Please sign in to comment.