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

60
types/ComposedModal/ComposedModal.d.ts vendored Normal file
View file

@ -0,0 +1,60 @@
/// <reference types="svelte" />
export default class ComposedModal {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set the size of the composed modal
*/
size?: "xs" | "sm" | "lg";
/**
* Set to `true` to open the modal
* @default false
*/
open?: boolean;
/**
* Set to `true` to use the danger variant
* @default false
*/
danger?: boolean;
/**
* Set to `true` to prevent the modal from closing when clicking outside
* @default false
*/
preventCloseOnClickOutside?: boolean;
/**
* Specify a class for the inner modal
* @default ""
*/
containerClass?: string;
/**
* Specify a selector to be focused when opening the modal
* @default "[data-modal-primary-focus]"
*/
selectorPrimaryFocus?: string;
/**
* Obtain a reference to the top-level HTML element
* @default null
*/
ref?: null | HTMLElement;
};
$$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: "transitionend", cb: (event: WindowEventMap["transitionend"]) => void): () => void;
$on(eventname: "submit", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: "close", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: "open", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

23
types/ComposedModal/ModalBody.d.ts vendored Normal file
View file

@ -0,0 +1,23 @@
/// <reference types="svelte" />
export default class ModalBody {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set to `true` if the modal contains form elements
* @default false
*/
hasForm?: boolean;
/**
* Set to `true` if the modal contains scrolling content
* @default false
*/
hasScrollingContent?: boolean;
};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

45
types/ComposedModal/ModalFooter.d.ts vendored Normal file
View file

@ -0,0 +1,45 @@
/// <reference types="svelte" />
export default class ModalFooter {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Specify the primary button text
* @default ""
*/
primaryButtonText?: string;
/**
* Set to `true` to disable the primary button
* @default false
*/
primaryButtonDisabled?: boolean;
/**
* Specify a class for the primary button
*/
primaryClass?: string;
/**
* Specify the secondary button text
* @default ""
*/
secondaryButtonText?: string;
/**
* Specify a class for the secondary button
*/
secondaryClass?: string;
/**
* Set to `true` to use the danger variant
* @default false
*/
danger?: boolean;
};
$$slot_def: {
default: {};
};
$on(eventname: string, cb: (event: Event) => void): () => void;
}

54
types/ComposedModal/ModalHeader.d.ts vendored Normal file
View file

@ -0,0 +1,54 @@
/// <reference types="svelte" />
export default class ModalHeader {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Specify the modal title
* @default ""
*/
title?: string;
/**
* Specify the modal label
* @default ""
*/
label?: string;
/**
* Specify the label class
* @default ""
*/
labelClass?: string;
/**
* Specify the title class
* @default ""
*/
titleClass?: string;
/**
* Specify the close class
* @default ""
*/
closeClass?: string;
/**
* Specify the close icon class
* @default ""
*/
closeIconClass?: string;
/**
* Specify the ARIA label for the close icon
* @default "Close"
*/
iconDescription?: string;
};
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}