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

33
types/Tile/ClickableTile.d.ts vendored Normal file
View file

@ -0,0 +1,33 @@
/// <reference types="svelte" />
export default class ClickableTile {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to click the tile
* @default false
*/
clicked?: boolean;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Set the `href`
*/
href?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => 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;
}

70
types/Tile/ExpandableTile.d.ts vendored Normal file
View file

@ -0,0 +1,70 @@
/// <reference types="svelte" />
export default class ExpandableTile {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set to `true` to expand the tile
* @default false
*/
expanded?: boolean;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Specify the max height of the tile (number of pixels)
* @default 0
*/
tileMaxHeight?: number;
/**
* Specify the padding of the tile (number of pixels)
* @default 0
*/
tilePadding?: number;
/**
* Specify the icon text of the collapsed tile
* @default "Interact to expand Tile"
*/
tileCollapsedIconText?: string;
/**
* Specify the icon text of the expanded tile
* @default "Interact to collapse Tile"
*/
tileExpandedIconText?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
/**
* Set an id for the top-level div element
*/
id?: string;
/**
* Obtain a reference to the input HTML element
* @default null
*/
ref?: null | HTMLElement;
};
$$slot_def: {
above: {};
below: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "keypress", cb: (event: WindowEventMap["keypress"]) => 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;
}

58
types/Tile/RadioTile.d.ts vendored Normal file
View file

@ -0,0 +1,58 @@
/// <reference types="svelte" />
export default class RadioTile {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> & {
/**
* Set to `true` to check the tile
* @default false
*/
checked?: boolean;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Specify the value of the radio input
* @default ""
*/
value?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
/**
* Specify the ARIA label for the radio tile checkmark icon
* @default "Tile checkmark"
*/
iconDescription?: string;
/**
* Set an id for the input element
*/
id?: string;
/**
* Specify a name attribute for the input
* @default ""
*/
name?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: "change", cb: (event: WindowEventMap["change"]) => void): () => void;
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
$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;
}

70
types/Tile/SelectableTile.d.ts vendored Normal file
View file

@ -0,0 +1,70 @@
/// <reference types="svelte" />
export default class SelectableTile {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> & {
/**
* Set to `true` to select the tile
* @default false
*/
selected?: boolean;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Specify the title of the selectable tile
* @default "title"
*/
title?: string;
/**
* Specify the value of the selectable tile
* @default "value"
*/
value?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
/**
* Specify the ARIA label for the selectable tile checkmark icon
* @default "Tile checkmark"
*/
iconDescription?: string;
/**
* Set an id for the input element
*/
id?: string;
/**
* Specify a name attribute for the input
* @default ""
*/
name?: string;
/**
* Obtain a reference to the input HTML element
* @default null
*/
ref?: null | HTMLInputElement;
};
$$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: "undefined", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

21
types/Tile/Tile.d.ts vendored Normal file
View file

@ -0,0 +1,21 @@
/// <reference types="svelte" />
export default class Tile {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
};
$$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: string, cb: (event: Event) => void): () => void;
}

29
types/Tile/TileGroup.d.ts vendored Normal file
View file

@ -0,0 +1,29 @@
/// <reference types="svelte" />
export default class TileGroup {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["fieldset"]> & {
/**
* Specify the selected tile value
*/
selected?: string;
/**
* Set to `true` to disable the tile group
* @default false
*/
disabled?: boolean;
/**
* Specify the legend text
* @default ""
*/
legend?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: "select", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}