mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31: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
25
types/Icon/Icon.d.ts
vendored
25
types/Icon/Icon.d.ts
vendored
|
@ -1,7 +1,10 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
import { IconSkeletonProps } from "./IconSkeleton";
|
||||
|
||||
export interface IconProps extends IconSkeletonProps, svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["svg"]> {
|
||||
export interface IconProps
|
||||
extends IconSkeletonProps,
|
||||
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["svg"]> {
|
||||
/**
|
||||
* Specify the icon from `carbon-icons-svelte` to render
|
||||
*/
|
||||
|
@ -14,13 +17,13 @@ export interface IconProps extends IconSkeletonProps, svelte.JSX.HTMLAttributes<
|
|||
skeleton?: boolean;
|
||||
}
|
||||
|
||||
export default class Icon {
|
||||
$$prop_def: IconProps;
|
||||
$$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 Icon extends SvelteComponentTyped<
|
||||
IconProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
mouseover: WindowEventMap["mouseover"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
|
|
24
types/Icon/IconSkeleton.d.ts
vendored
24
types/Icon/IconSkeleton.d.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface IconSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
export interface IconSkeletonProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set the size of the icon
|
||||
* @default 16
|
||||
|
@ -8,13 +10,13 @@ export interface IconSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElement
|
|||
size?: number;
|
||||
}
|
||||
|
||||
export default class IconSkeleton {
|
||||
$$prop_def: IconSkeletonProps;
|
||||
$$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 IconSkeleton extends SvelteComponentTyped<
|
||||
IconSkeletonProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
mouseover: WindowEventMap["mouseover"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
},
|
||||
{}
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue