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

17
types/UIShell/Content.d.ts vendored Normal file
View file

@ -0,0 +1,17 @@
/// <reference types="svelte" />
export default class Content {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["main"]> & {
/**
* Specify the id for the main element
* @default "main-content"
*/
id?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

54
types/UIShell/GlobalHeader/Header.d.ts vendored Normal file
View file

@ -0,0 +1,54 @@
/// <reference types="svelte" />
export default class Header {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `false` to hide the side nav by default
* @default true
*/
expandedByDefault?: boolean;
/**
* Set to `true` to open the side nav
* @default false
*/
isSideNavOpen?: boolean;
/**
* Specify the ARIA label for the header
*/
uiShellAriaLabel?: string;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the company name
*/
company?: string;
/**
* Specify the platform name
* Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>)
* @default ""
*/
platformName?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$slot_def: {
default: {};
["skip-to-content"]: {};
platform: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,38 @@
/// <reference types="svelte" />
export default class HeaderAction {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to open the panel
* @default false
*/
isOpen?: boolean;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Specify the text
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
*/
text?: string;
/**
* Obtain a reference to the button HTML element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$slot_def: {
default: {};
text: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "close", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: "undefined", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,31 @@
/// <reference types="svelte" />
export default class HeaderActionLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to use the active state
* @default false
*/
linkIsActive?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$slot_def: {};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,18 @@
/// <reference types="svelte" />
export default class HeaderActionSearch {
$$prop_def: {
/**
* Set to `true` to focus the search
* @default false
*/
searchIsActive?: boolean;
};
$$slot_def: {};
$on(eventname: "focusInputSearch", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: "focusOutInputSearch", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: "inputSearch", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,16 @@
/// <reference types="svelte" />
export default class HeaderNav {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> & {
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,33 @@
/// <reference types="svelte" />
export default class HeaderNavItem {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$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: "keyup", cb: (event: WindowEventMap["keyup"]) => void): () => void;
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
$on(eventname: "focus", cb: (event: WindowEventMap["focus"]) => void): () => void;
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,48 @@
/// <reference types="svelte" />
export default class HeaderNavMenu {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the `href` attribute
* @default "/"
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
/**
* Specify the ARIA label for the chevron icon
* @default "Expand/Collapse"
*/
iconDescription?: string;
};
$$slot_def: {
default: {};
};
$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: "keyup", cb: (event: WindowEventMap["keyup"]) => void): () => void;
$on(eventname: "focus", cb: (event: WindowEventMap["focus"]) => void): () => void;
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,11 @@
/// <reference types="svelte" />
export default class HeaderPanelDivider {
$$prop_def: {};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,23 @@
/// <reference types="svelte" />
export default class HeaderPanelLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,11 @@
/// <reference types="svelte" />
export default class HeaderPanelLinks {
$$prop_def: {};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,11 @@
/// <reference types="svelte" />
export default class HeaderUtilities {
$$prop_def: {};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

29
types/UIShell/HeaderGlobalAction.d.ts vendored Normal file
View file

@ -0,0 +1,29 @@
/// <reference types="svelte" />
export default class HeaderGlobalAction {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to use the active variant
* @default false
*/
isActive?: boolean;
/**
* Specify the icon to render
*/
icon?: typeof import("carbon-icons-svelte/lib/Add16").default;
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

28
types/UIShell/SideNav/SideNav.d.ts vendored Normal file
View file

@ -0,0 +1,28 @@
/// <reference types="svelte" />
export default class SideNav {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> & {
/**
* Set to `true` to use the fixed variant
* @default false
*/
fixed?: boolean;
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
/**
* Set to `true` to toggle the expanded state
* @default false
*/
isOpen?: boolean;
};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

11
types/UIShell/SideNav/SideNavItems.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
/// <reference types="svelte" />
export default class SideNavItems {
$$prop_def: {};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

37
types/UIShell/SideNav/SideNavLink.d.ts vendored Normal file
View file

@ -0,0 +1,37 @@
/// <reference types="svelte" />
export default class SideNavLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to select the current link
* @default false
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$slot_def: {};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

34
types/UIShell/SideNav/SideNavMenu.d.ts vendored Normal file
View file

@ -0,0 +1,34 @@
/// <reference types="svelte" />
export default class SideNavMenu {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -0,0 +1,31 @@
/// <reference types="svelte" />
export default class SideNavMenuItem {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to select the item
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the item text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$slot_def: {};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

24
types/UIShell/SkipToContent.d.ts vendored Normal file
View file

@ -0,0 +1,24 @@
/// <reference types="svelte" />
export default class SkipToContent {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
* @default "#main-content"
*/
href?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}