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,24 @@
/// <reference types="svelte" />
export default class DatePickerSkeleton {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set to `true` to use the range variant
* @default false
*/
range?: boolean;
/**
* Set an id to be used by the label element
*/
id?: string;
};
$$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;
}

75
types/DatePicker/DatePicker.d.ts vendored Normal file
View file

@ -0,0 +1,75 @@
/// <reference types="svelte" />
export default class DatePicker {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Specify the date picker type
* @default "simple"
*/
datePickerType?: "simple" | "single" | "range";
/**
* Specify the date picker input value
* @default ""
*/
value?: string;
/**
* Specify the element to append the calendar to
*/
appendTo?: HTMLElement;
/**
* Specify the date format
* @default "m/d/Y"
*/
dateFormat?: string;
/**
* Specify the maximum date
* @default null
*/
maxDate?: null | string | Date;
/**
* Specify the minimum date
* @default null
*/
minDate?: null | string | Date;
/**
* Specify the locale
* @default "en"
*/
locale?: string;
/**
* Set to `true` to use the short variant
* @default false
*/
short?: boolean;
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Set an id for the date picker element
*/
id?: string;
};
$$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: "undefined", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

87
types/DatePicker/DatePickerInput.d.ts vendored Normal file
View file

@ -0,0 +1,87 @@
/// <reference types="svelte" />
export default class DatePickerInput {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
/**
* Set the size of the input
*/
size?: "sm" | "xl";
/**
* Specify the input type
* @default "text"
*/
type?: string;
/**
* Specify the input placeholder text
* @default ""
*/
placeholder?: string;
/**
* Specify the Regular Expression for the input value
* @default "\\d{1,2}\\/\\d{1,2}\\/\\d{4}"
*/
pattern?: string;
/**
* Set to `true` to disable the input
* @default false
*/
disabled?: boolean;
/**
* Specify the ARIA label for the calendar icon
* @default ""
*/
iconDescription?: string;
/**
* Set an id for the input element
*/
id?: string;
/**
* Specify the label text
* @default ""
*/
labelText?: string;
/**
* Set to `true` to visually hide the label text
* @default false
*/
hideLabel?: boolean;
/**
* Set to `true` to indicate an invalid state
* @default false
*/
invalid?: boolean;
/**
* Specify the invalid state text
* @default ""
*/
invalidText?: string;
/**
* Set a name for the input element
*/
name?: string;
/**
* Obtain a reference to the input HTML element
* @default null
*/
ref?: null | HTMLInputElement;
};
$$slot_def: {};
$on(eventname: "input", cb: (event: WindowEventMap["input"]) => void): () => void;
$on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void;
$on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}