Skip to content

Commit 91850fb

Browse files
committed
fix: d.ts in wrappers
1 parent 98f89b0 commit 91850fb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.changeset/wrapperdts.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
"@patternfly/elements": patch
4+
---
5+
fixed TypeScript typings for react wrappers

tools/pfe-tools/react/generate-wrappers.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ async function writeReactWrapper(
6666
});
6767
6868
`, 'utf8');
69-
await writeFile(outPath.replace('.js', '.d.ts'), typescript`// ${path}
70-
declare module '@patternfly/elements/react/pf-button/pf-button.js' {
71-
import type { ReactWebComponent } from '@lit-labs/react';
72-
import type { ${Class} } from '@patternfly/elements/${module.path}';
73-
export const ${reactComponentName}: ReactWebComponent<${Class}, ${eventsInterface}>;
74-
}
69+
await writeFile(outPath.replace('.js', '.d.ts'), typescript`
70+
// ${path}
71+
import type { ReactWebComponent } from '@lit-labs/react';
72+
import type { ${Class} } from '@patternfly/elements/${module.path}';
73+
export const ${reactComponentName}: ReactWebComponent<${Class}, ${eventsInterface}>;
7574
7675
`, 'utf8');
7776
return { tagName, outPath };

0 commit comments

Comments
 (0)