refactor(types): use typed SvelteComponent interface for typing components

This commit is contained in:
Eric Liu 2020-11-25 15:29:55 -08:00
commit dab82d3479
156 changed files with 1379 additions and 1667 deletions

View file

@ -1,4 +1,5 @@
/// <reference types="svelte" />
import { SvelteComponent } from "svelte";
import { CopyProps } from "../Copy/Copy";
export interface CopyButtonProps extends CopyProps {
@ -9,11 +10,8 @@ export interface CopyButtonProps extends CopyProps {
iconDescription?: string;
}
export default class CopyButton {
$$prop_def: CopyButtonProps;
$$slot_def: {};
$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 CopyButton extends SvelteComponent<
CopyButtonProps,
{ click: WindowEventMap["click"]; animationend: WindowEventMap["animationend"] },
{}
> {}