fix(tag): define JSDoc restProps type

This commit is contained in:
Eric Liu 2020-11-19 09:10:30 -08:00
commit 26ce330e1d
4 changed files with 16 additions and 22 deletions

View file

@ -38,7 +38,7 @@
"rollup": "^2.33.3",
"rollup-plugin-svelte": "^6.1.1",
"rollup-plugin-terser": "^7.0.2",
"sveld": "^0.1.0-rc.5",
"sveld": "^0.1.0",
"svelte": "^3.29.7",
"svelte-check": "^1.1.14",
"svelte-loader": "^2.13.6",

View file

@ -1,32 +1,24 @@
<script>
/**
* @restProps {div | span}
*/
/**
* Specify the type of tag
* @type {"red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast"} [type]
*/
export let type = undefined;
/**
* Set to `true` to use filterable variant
* @type {boolean}
*/
/** Set to `true` to use filterable variant */
export let filter = false;
/**
* Set to `true` to disable a filterable tag
* @type {boolean}
*/
/** Set to `true` to disable a filterable tag */
export let disabled = false;
/**
* Set to `true` to display the skeleton state
* @type {boolean}
*/
/** Set to `true` to display the skeleton state */
export let skeleton = false;
/**
* Set the title for the close button in a filterable tag
* @type {string}
*/
/** Set the title for the close button in a filterable tag */
export let title = "Clear filter";
/** Set an id for the filterable tag */

4
types/Tag/Tag.d.ts vendored
View file

@ -1,6 +1,8 @@
/// <reference types="svelte" />
export interface TagProps {
export interface TagProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]>,
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["span"]> {
/**
* Specify the type of tag
*/

View file

@ -2728,10 +2728,10 @@ supports-color@^7.0.0, supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
sveld@^0.1.0-rc.5:
version "0.1.0-rc.5"
resolved "https://registry.npmjs.org/sveld/-/sveld-0.1.0-rc.5.tgz#32d35b3d2b9f2aaed28202da0e5f5adf69b6f181"
integrity sha512-TJY0mYN8vUPiPL8GGNn//IS6WicUF+MEbKCNzM6oXojIp6RSyBnJyJQsjIGFmfs6x5GIac+Sz8CjIFgQ40BfJQ==
sveld@^0.1.0:
version "0.1.0"
resolved "https://registry.npmjs.org/sveld/-/sveld-0.1.0.tgz#8cf208f21ba4f6af24462fcb48f279778bac7a67"
integrity sha512-JGUVJ6/GTmOeAnh3F+A+l0utszL8qDKQJ7wsTMupqA+vzqF4y+Bq8Khlt3MVBdgYmEClXIlzSLiMQ8g232h6Wg==
dependencies:
"@rollup/plugin-node-resolve" "^10.0.0"
comment-parser "^0.7.6"