refactor(types): rewrite type definitions to account for intrinsic attributes

This commit is contained in:
Eric Liu 2020-11-03 05:44:11 -08:00
commit 3c04f122b0
158 changed files with 6997 additions and 5383 deletions

View file

@ -0,0 +1,33 @@
/// <reference types="svelte" />
export default class ContentSwitcher {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set the selected index of the switch item
* @default 0
*/
selectedIndex?: number;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Specify the size of the content switcher
*/
size?: "sm" | "xl";
};
$$slot_def: {
default: {};
};
$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: "change", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

46
types/ContentSwitcher/Switch.d.ts vendored Normal file
View file

@ -0,0 +1,46 @@
/// <reference types="svelte" />
export default class Switch {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Specify the switch text
* Alternatively, use the named slot "text" (e.g. <span slot="text">...</span>)
* @default "Provide text"
*/
text?: string;
/**
* Set to `true` for the switch to be selected
* @default false
*/
selected?: boolean;
/**
* Set to `true` to disable the switch
* @default false
*/
disabled?: boolean;
/**
* Set an id for the button element
*/
id?: string;
/**
* Obtain a reference to the button HTML element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$slot_def: {
default: {};
};
$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;
}