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
16
types/Select/Select.d.ts
vendored
16
types/Select/Select.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponent } from "svelte";
|
||||
|
||||
export interface SelectProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
|
@ -83,13 +84,8 @@ export interface SelectProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNam
|
|||
ref?: null | HTMLSelectElement;
|
||||
}
|
||||
|
||||
export default class Select {
|
||||
$$prop_def: SelectProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
||||
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
|
||||
$on(eventname: "change", cb: (event: CustomEvent<any>) => void): () => void;
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class Select extends SvelteComponent<
|
||||
SelectProps,
|
||||
{ blur: WindowEventMap["blur"]; change: CustomEvent<any> },
|
||||
{ default: {} }
|
||||
> {}
|
||||
|
|
8
types/Select/SelectItem.d.ts
vendored
8
types/Select/SelectItem.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponent } from "svelte";
|
||||
|
||||
export interface SelectItemProps {
|
||||
/**
|
||||
|
@ -26,9 +27,4 @@ export interface SelectItemProps {
|
|||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export default class SelectItem {
|
||||
$$prop_def: SelectItemProps;
|
||||
$$slot_def: {};
|
||||
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class SelectItem extends SvelteComponent<SelectItemProps, {}, {}> {}
|
||||
|
|
10
types/Select/SelectItemGroup.d.ts
vendored
10
types/Select/SelectItemGroup.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponent } from "svelte";
|
||||
|
||||
export interface SelectItemGroupProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["optgroup"]> {
|
||||
/**
|
||||
|
@ -14,11 +15,4 @@ export interface SelectItemGroupProps extends svelte.JSX.HTMLAttributes<HTMLElem
|
|||
label?: string;
|
||||
}
|
||||
|
||||
export default class SelectItemGroup {
|
||||
$$prop_def: SelectItemGroupProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class SelectItemGroup extends SvelteComponent<SelectItemGroupProps, {}, { default: {} }> {}
|
||||
|
|
21
types/Select/SelectSkeleton.d.ts
vendored
21
types/Select/SelectSkeleton.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponent } from "svelte";
|
||||
|
||||
export interface SelectSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
|
@ -8,13 +9,13 @@ export interface SelectSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLEleme
|
|||
hideLabel?: boolean;
|
||||
}
|
||||
|
||||
export default class SelectSkeleton {
|
||||
$$prop_def: SelectSkeletonProps;
|
||||
$$slot_def: {};
|
||||
|
||||
$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: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class SelectSkeleton extends SvelteComponent<
|
||||
SelectSkeletonProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
mouseover: WindowEventMap["mouseover"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue