Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -340,27 +340,6 @@
"extends": "DOMRect",
"noInterfaceObject": true
},
/*
Keeping EventListener and EventListenerObject isn't the most elegant way to handle
the event listeners, but we need to keep the EventListener as an extendable interface
for libraries like angular.
*/
"EventListener": {
"name": "EventListener",
"noInterfaceObject": true,
"methods": {
"method": {
// This is a hack to add a call signature, but I think it's reasonable
// as it means we don't have to add a call signatures section to the
// emitter for this one case.
"callable": {
"overrideSignatures": [
"(evt: Event): void"
]
}
}
}
},
"EventListenerObject": {
"name": "EventListenerObject",
"noInterfaceObject": true,
Expand Down
7 changes: 7 additions & 0 deletions inputfiles/patches/forced-declare.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Keeping EventListener and EventListenerObject isn't the most elegant way to handle the event listeners, but we need to keep the EventListener as an extendable interface for libraries like angular.
interface EventListener noInterfaceObject=#true {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erm actually this is dom, let's put this in dom.kdl

method callable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have interface.anonymouseMethods so use it with something like anonymous-method {}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will update it

type void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good reason to use returns=void

param evt type=Event
}
}
5 changes: 4 additions & 1 deletion src/build/patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ function handleMethod(child: Node): Partial<Method> {
...handleTyped(typeNode),
},
];
return { name, signature };
return {
...(name === "callable" ? {} : { name }),
signature,
};
}

/**
Expand Down