fix(types): use type alias instead of interface for $$restProps

This commit is contained in:
metonym 2024-10-25 16:30:10 -07:00 committed by Eric Liu
commit 6fbd8ae6a9
165 changed files with 752 additions and 463 deletions

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"] & SvelteHTMLElements["p"];
type $RestProps = SvelteHTMLElements["a"] & SvelteHTMLElements["p"];
export interface ClickableTileProps extends RestProps {
type $Props = {
/**
* Set to `true` to click the tile
* @default false
@ -29,7 +29,9 @@ export interface ClickableTileProps extends RestProps {
href?: string;
[key: `data-${string}`]: any;
}
};
export type ClickableTileProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ClickableTile extends SvelteComponentTyped<
ClickableTileProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["button"];
type $RestProps = SvelteHTMLElements["button"];
export interface ExpandableTileProps extends RestProps {
type $Props = {
/**
* Set to `true` to expand the tile
* @default false
@ -71,7 +71,9 @@ export interface ExpandableTileProps extends RestProps {
ref?: null | HTMLButtonElement;
[key: `data-${string}`]: any;
}
};
export type ExpandableTileProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ExpandableTile extends SvelteComponentTyped<
ExpandableTileProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["label"];
type $RestProps = SvelteHTMLElements["label"];
export interface RadioTileProps extends RestProps {
type $Props = {
/**
* Set to `true` to check the tile
* @default false
@ -59,7 +59,9 @@ export interface RadioTileProps extends RestProps {
name?: string;
[key: `data-${string}`]: any;
}
};
export type RadioTileProps = Omit<$RestProps, keyof $Props> & $Props;
export default class RadioTile extends SvelteComponentTyped<
RadioTileProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["label"];
type $RestProps = SvelteHTMLElements["label"];
export interface SelectableTileProps extends RestProps {
type $Props = {
/**
* Set to `true` to select the tile
* @default false
@ -65,7 +65,9 @@ export interface SelectableTileProps extends RestProps {
ref?: null | HTMLInputElement;
[key: `data-${string}`]: any;
}
};
export type SelectableTileProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SelectableTile extends SvelteComponentTyped<
SelectableTileProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["div"];
type $RestProps = SvelteHTMLElements["div"];
export interface TileProps extends RestProps {
type $Props = {
/**
* Set to `true` to enable the light variant
* @default false
@ -11,7 +11,9 @@ export interface TileProps extends RestProps {
light?: boolean;
[key: `data-${string}`]: any;
}
};
export type TileProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Tile extends SvelteComponentTyped<
TileProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["fieldset"];
type $RestProps = SvelteHTMLElements["fieldset"];
export interface TileGroupProps extends RestProps {
type $Props = {
/**
* Specify the selected tile value
* @default undefined
@ -35,7 +35,9 @@ export interface TileGroupProps extends RestProps {
legend?: string;
[key: `data-${string}`]: any;
}
};
export type TileGroupProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TileGroup extends SvelteComponentTyped<
TileGroupProps,