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> | | expand | dispatched | <code>null</code> |
| collapse | dispatched | <code>null</code> | | collapse | dispatched | <code>null</code> |
| copy | dispatched | <code>null</code> |
| click | forwarded | -- | | click | forwarded | -- |
| mouseover | forwarded | -- | | mouseover | forwarded | -- |
| mouseenter | forwarded | -- | | mouseenter | forwarded | -- |
| mouseleave | forwarded | -- | | mouseleave | forwarded | -- |
| animationend | forwarded | -- | | animationend | forwarded | -- |
| copy | dispatched | <code>null</code> |
## `CodeSnippetSkeleton` ## `CodeSnippetSkeleton`

View file

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

View file

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

View file

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