feat(types): use the SvelteComponentTyped interface in the TypeScript definitions (#515)

This commit is contained in:
Eric Liu 2021-02-07 11:25:20 -08:00 committed by GitHub
commit bcd28de86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 6379 additions and 6362 deletions

View file

@ -1,6 +1,8 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface PasswordInputProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
export interface PasswordInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
*/
@ -108,18 +110,18 @@ export interface PasswordInputProps extends svelte.JSX.HTMLAttributes<HTMLElemen
ref?: null | HTMLInputElement;
}
export default class PasswordInput {
$$prop_def: PasswordInputProps;
$$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: "change", cb: (event: WindowEventMap["change"]) => void): () => void;
$on(eventname: "input", cb: (event: WindowEventMap["input"]) => 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;
}
export default class PasswordInput extends SvelteComponentTyped<
PasswordInputProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
change: WindowEventMap["change"];
input: WindowEventMap["input"];
keydown: WindowEventMap["keydown"];
focus: WindowEventMap["focus"];
blur: WindowEventMap["blur"];
},
{}
> {}

View file

@ -1,6 +1,8 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface TextInputProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
export interface TextInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
*/
@ -108,18 +110,18 @@ export interface TextInputProps extends svelte.JSX.HTMLAttributes<HTMLElementTag
inline?: boolean;
}
export default class TextInput {
$$prop_def: TextInputProps;
$$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: "change", cb: (event: WindowEventMap["change"]) => void): () => void;
$on(eventname: "input", cb: (event: WindowEventMap["input"]) => 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;
}
export default class TextInput extends SvelteComponentTyped<
TextInputProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
change: WindowEventMap["change"];
input: WindowEventMap["input"];
keydown: WindowEventMap["keydown"];
focus: WindowEventMap["focus"];
blur: WindowEventMap["blur"];
},
{}
> {}

View file

@ -1,6 +1,8 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface TextInputSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
export interface TextInputSkeletonProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set to `true` to hide the label text
* @default false
@ -8,13 +10,13 @@ export interface TextInputSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLEl
hideLabel?: boolean;
}
export default class TextInputSkeleton {
$$prop_def: TextInputSkeletonProps;
$$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;
}
export default class TextInputSkeleton extends SvelteComponentTyped<
TextInputSkeletonProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
},
{}
> {}