mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +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
19
types/Select/Select.d.ts
vendored
19
types/Select/Select.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface SelectProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
export interface SelectProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Specify the selected item value
|
||||
*/
|
||||
|
@ -83,13 +85,8 @@ export interface SelectProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNam
|
|||
ref?: null | HTMLSelectElement;
|
||||
}
|
||||
|
||||
export default class Select {
|
||||
$$prop_def: SelectProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
||||
$on(eventname: "change", cb: (event: CustomEvent<string>) => void): () => void;
|
||||
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
|
||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||
}
|
||||
export default class Select extends SvelteComponentTyped<
|
||||
SelectProps,
|
||||
{ change: CustomEvent<string>; blur: WindowEventMap["blur"] },
|
||||
{ default: {} }
|
||||
> {}
|
||||
|
|
12
types/Select/SelectItem.d.ts
vendored
12
types/Select/SelectItem.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface SelectItemProps {
|
||||
/**
|
||||
|
@ -26,9 +27,8 @@ 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 SvelteComponentTyped<
|
||||
SelectItemProps,
|
||||
{},
|
||||
{}
|
||||
> {}
|
||||
|
|
17
types/Select/SelectItemGroup.d.ts
vendored
17
types/Select/SelectItemGroup.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface SelectItemGroupProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["optgroup"]> {
|
||||
export interface SelectItemGroupProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["optgroup"]> {
|
||||
/**
|
||||
* Set to `true` to disable the optgroup element
|
||||
* @default false
|
||||
|
@ -14,11 +16,8 @@ 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 SvelteComponentTyped<
|
||||
SelectItemGroupProps,
|
||||
{},
|
||||
{ default: {} }
|
||||
> {}
|
||||
|
|
24
types/Select/SelectSkeleton.d.ts
vendored
24
types/Select/SelectSkeleton.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface SelectSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
export interface SelectSkeletonProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to hide the label text
|
||||
* @default false
|
||||
|
@ -8,13 +10,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 SvelteComponentTyped<
|
||||
SelectSkeletonProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
mouseover: WindowEventMap["mouseover"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue