mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
refactor(types): use typed SvelteComponent interface for typing components
This commit is contained in:
parent
4226535338
commit
dab82d3479
156 changed files with 1379 additions and 1667 deletions
28
types/ComboBox/ComboBox.d.ts
vendored
28
types/ComboBox/ComboBox.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponent } from "svelte";
|
||||
|
||||
export interface ComboBoxItem {
|
||||
id: string;
|
||||
|
@ -118,18 +119,15 @@ export interface ComboBoxProps extends svelte.JSX.HTMLAttributes<HTMLElementTagN
|
|||
listRef?: null | HTMLDivElement;
|
||||
}
|
||||
|
||||
export default class ComboBox {
|
||||
$$prop_def: ComboBoxProps;
|
||||
$$slot_def: {};
|
||||
|
||||
$on(
|
||||
eventname: "select",
|
||||
cb: (event: CustomEvent<{ selectedId: string; selectedIndex: number; selectedItem: ComboBoxItem }>) => void
|
||||
): () => void;
|
||||
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
|
||||
$on(eventname: "focus", cb: (event: WindowEventMap["focus"]) => void): () => void;
|
||||
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
|
||||
$on(eventname: "clear", cb: (event: WindowEventMap["clear"]) => void): () => void;
|
||||
$on(eventname: "scroll", cb: (event: WindowEventMap["scroll"]) => void): () => void;
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class ComboBox extends SvelteComponent<
|
||||
ComboBoxProps,
|
||||
{
|
||||
select: CustomEvent<{ selectedId: string; selectedIndex: number; selectedItem: ComboBoxItem }>;
|
||||
keydown: WindowEventMap["keydown"];
|
||||
focus: WindowEventMap["focus"];
|
||||
blur: WindowEventMap["blur"];
|
||||
clear: WindowEventMap["clear"];
|
||||
scroll: WindowEventMap["scroll"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue