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

22
types/Copy/Copy.d.ts vendored
View file

@ -1,6 +1,8 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface CopyProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
export interface CopyProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Set the feedback text shown after clicking the button
* @default "Copied!"
@ -20,13 +22,11 @@ export interface CopyProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameM
ref?: null | HTMLButtonElement;
}
export default class Copy {
$$prop_def: CopyProps;
$$slot_def: {
default: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "animationend", cb: (event: WindowEventMap["animationend"]) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}
export default class Copy extends SvelteComponentTyped<
CopyProps,
{
click: WindowEventMap["click"];
animationend: WindowEventMap["animationend"];
},
{ default: {} }
> {}