mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(types): use the SvelteComponentTyped interface in the TypeScript definitions (#515)
This commit is contained in:
parent
4e4234f83d
commit
bcd28de86e
161 changed files with 6379 additions and 6362 deletions
31
types/OverflowMenu/OverflowMenu.d.ts
vendored
31
types/OverflowMenu/OverflowMenu.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface OverflowMenuProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
|
||||
export interface OverflowMenuProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
|
||||
/**
|
||||
* Specify the size of the overflow menu
|
||||
*/
|
||||
|
@ -70,18 +72,15 @@ export interface OverflowMenuProps extends svelte.JSX.HTMLAttributes<HTMLElement
|
|||
menuRef?: null | HTMLUListElement;
|
||||
}
|
||||
|
||||
export default class OverflowMenu {
|
||||
$$prop_def: OverflowMenuProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
menu: {};
|
||||
};
|
||||
|
||||
$on(eventname: "close", cb: (event: CustomEvent<{ index: number; text: string }>) => void): () => void;
|
||||
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
|
||||
$on(eventname: "mouseover", cb: (event: WindowEventMap["mouseover"]) => void): () => void;
|
||||
$on(eventname: "mouseenter", cb: (event: WindowEventMap["mouseenter"]) => void): () => void;
|
||||
$on(eventname: "mouseleave", cb: (event: WindowEventMap["mouseleave"]) => void): () => void;
|
||||
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class OverflowMenu extends SvelteComponentTyped<
|
||||
OverflowMenuProps,
|
||||
{
|
||||
close: CustomEvent<{ index: number; text: string }>;
|
||||
click: WindowEventMap["click"];
|
||||
mouseover: WindowEventMap["mouseover"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
keydown: WindowEventMap["keydown"];
|
||||
},
|
||||
{ default: {}; menu: {} }
|
||||
> {}
|
||||
|
|
19
types/OverflowMenu/OverflowMenuItem.d.ts
vendored
19
types/OverflowMenu/OverflowMenuItem.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface OverflowMenuItemProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||
export interface OverflowMenuItemProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||
/**
|
||||
* Specify the item text
|
||||
* Alternatively, use the default slot for a custom element
|
||||
|
@ -57,13 +59,8 @@ export interface OverflowMenuItemProps extends svelte.JSX.HTMLAttributes<HTMLEle
|
|||
ref?: null | HTMLAnchorElement | HTMLButtonElement;
|
||||
}
|
||||
|
||||
export default class OverflowMenuItem {
|
||||
$$prop_def: OverflowMenuItemProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
||||
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
|
||||
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class OverflowMenuItem extends SvelteComponentTyped<
|
||||
OverflowMenuItemProps,
|
||||
{ click: WindowEventMap["click"]; keydown: WindowEventMap["keydown"] },
|
||||
{ default: {} }
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue