chore(code-snippet): preserve custom copy event type (#1375)

This commit is contained in:
metonym 2022-06-27 05:44:05 -07:00 committed by GitHub
commit 5a8bd9ca57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 8 deletions

View file

@ -567,12 +567,12 @@ None.
| :----------- | :--------- | :---------------- |
| expand | dispatched | <code>null</code> |
| collapse | dispatched | <code>null</code> |
| copy | dispatched | <code>null</code> |
| click | forwarded | -- |
| mouseover | forwarded | -- |
| mouseenter | forwarded | -- |
| mouseleave | forwarded | -- |
| animationend | forwarded | -- |
| copy | dispatched | <code>null</code> |
## `CodeSnippetSkeleton`

View file

@ -1235,6 +1235,7 @@
"events": [
{ "type": "dispatched", "name": "expand", "detail": "null" },
{ "type": "dispatched", "name": "collapse", "detail": "null" },
{ "type": "dispatched", "name": "copy", "detail": "null" },
{
"type": "forwarded",
"name": "click",
@ -1255,12 +1256,7 @@
"name": "mouseleave",
"element": "CodeSnippetSkeleton"
},
{
"type": "forwarded",
"name": "animationend",
"element": "CopyButton"
},
{ "type": "dispatched", "name": "copy", "detail": "null" }
{ "type": "forwarded", "name": "animationend", "element": "CopyButton" }
],
"typedefs": [],
"rest_props": { "type": "InlineComponent", "name": "CodeSnippetSkeleton" }

View file

@ -2,6 +2,7 @@
/**
* @event {null} expand
* @event {null} collapse
* @event {null} copy
*/
/**

View file

@ -122,12 +122,12 @@ export default class CodeSnippet extends SvelteComponentTyped<
{
expand: CustomEvent<null>;
collapse: CustomEvent<null>;
copy: CustomEvent<null>;
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
animationend: WindowEventMap["animationend"];
copy: CustomEvent<null>;
},
{ default: {} }
> {}