chore: add more prop annotations

This commit is contained in:
Eric Liu 2020-07-25 06:26:49 -07:00
commit 773b18d314
75 changed files with 877 additions and 137 deletions

View file

@ -1,6 +1,20 @@
<script>
/**
* Set the feedback text shown after clicking the button
* @type {string} [feedback="Copied!"]
*/
export let feedback = "Copied!";
/**
* Set the timeout duration (ms) to display feedback text
* @type {number} [feedbackTimeout=2000]
*/
export let feedbackTimeout = 2000;
/**
* Obtain a reference to the button HTML element
* @type {null | HTMLElement} [ref=null]
*/
export let ref = null;
import { onMount } from "svelte";
@ -8,8 +22,6 @@
let animation = undefined;
let timeout = undefined;
$: showFeedback = timeout !== undefined;
onMount(() => {
return () => {
clearTimeout(timeout);