Skip to content

Commit

Permalink
Fix event declarations in svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Jul 30, 2024
1 parent 0e52b61 commit 8ee0a59
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/poor-lies-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chialab/plasma': patch
---

Fix event declarations in svelte.
2 changes: 1 addition & 1 deletion src/svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ import { ${getAttributes(definition.extend ?? definition.name).split('<')[0]}, t
.map((member) => `${member.name}?: Base${declaration.name}['${member.name}'];`)
.concat(
declaration.events?.map(
(declaration) => `on${declaration.name}?: EventHandler<CustomEvent, Base${declaration.name}>;`
(event) => `on${event.name}?: EventHandler<CustomEvent, Base${declaration.name}>;`
) ?? []
);

Expand Down
2 changes: 1 addition & 1 deletion test/src/svelte/TestElement.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare const __propDef: {
numericProp?: BaseTestElement['numericProp'];
objectProp?: BaseTestElement['objectProp'];
defaultValue?: BaseTestElement['defaultValue'];
onstringchange?: EventHandler<CustomEvent, Basestringchange>;
onstringchange?: EventHandler<CustomEvent, BaseTestElement>;
};
events: {
'stringchange': CustomEvent;
Expand Down
2 changes: 1 addition & 1 deletion test/src/svelte/TestLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare const __propDef: {
numericProp?: BaseTestLink['numericProp'];
objectProp?: BaseTestLink['objectProp'];
defaultValue?: BaseTestLink['defaultValue'];
onstringchange?: EventHandler<CustomEvent, Basestringchange>;
onstringchange?: EventHandler<CustomEvent, BaseTestLink>;
};
events: {
'stringchange': CustomEvent;
Expand Down

0 comments on commit 8ee0a59

Please sign in to comment.