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["li"];
type $RestProps = SvelteHTMLElements["li"];
export interface TabProps extends RestProps {
type $Props = {
/**
* Specify the tab label.
* Alternatively, use the default slot (e.g., `<Tab><span>Label</span></Tab>`)
@ -42,7 +42,9 @@ export interface TabProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type TabProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Tab extends SvelteComponentTyped<
TabProps,

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 TabContentProps extends RestProps {
type $Props = {
/**
* Set an id for the top-level element
* @default "ccs-" + Math.random().toString(36)
@ -11,7 +11,9 @@ export interface TabContentProps extends RestProps {
id?: string;
[key: `data-${string}`]: any;
}
};
export type TabContentProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TabContent extends SvelteComponentTyped<
TabContentProps,

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 TabsProps extends RestProps {
type $Props = {
/**
* Specify the selected tab index
* @default 0
@ -35,7 +35,9 @@ export interface TabsProps extends RestProps {
triggerHref?: string;
[key: `data-${string}`]: any;
}
};
export type TabsProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Tabs extends SvelteComponentTyped<
TabsProps,

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 TabsSkeletonProps extends RestProps {
type $Props = {
/**
* Specify the number of tabs to render
* @default 4
@ -17,7 +17,9 @@ export interface TabsSkeletonProps extends RestProps {
type?: "default" | "container";
[key: `data-${string}`]: any;
}
};
export type TabsSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TabsSkeleton extends SvelteComponentTyped<
TabsSkeletonProps,