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

@ -40,9 +40,9 @@ export interface DataTableCell {
display?: (item: DataTableValue, row: DataTableRow) => DataTableValue;
}
type RestProps = SvelteHTMLElements["div"];
type $RestProps = SvelteHTMLElements["div"];
export interface DataTableProps extends RestProps {
type $Props = {
/**
* Specify the data table headers
* @default []
@ -179,7 +179,9 @@ export interface DataTableProps extends RestProps {
page?: number;
[key: `data-${string}`]: any;
}
};
export type DataTableProps = Omit<$RestProps, keyof $Props> & $Props;
export default class DataTable extends SvelteComponentTyped<
DataTableProps,

View file

@ -3,9 +3,9 @@ import type { SvelteHTMLElements } from "svelte/elements";
import type { DataTableHeader } from "./DataTable.svelte";
type RestProps = SvelteHTMLElements["div"];
type $RestProps = SvelteHTMLElements["div"];
export interface DataTableSkeletonProps extends DataTableHeader, RestProps {
type $Props = {
/**
* Specify the number of columns
* Superseded by `headers` if `headers` is a non-empty array
@ -51,7 +51,9 @@ export interface DataTableSkeletonProps extends DataTableHeader, RestProps {
showToolbar?: boolean;
[key: `data-${string}`]: any;
}
};
export type DataTableSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
export default class DataTableSkeleton extends SvelteComponentTyped<
DataTableSkeletonProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["section"];
type $RestProps = SvelteHTMLElements["section"];
export interface TableProps extends RestProps {
type $Props = {
/**
* Set the size of the table
* @default undefined
@ -41,7 +41,9 @@ export interface TableProps extends RestProps {
tableStyle?: string;
[key: `data-${string}`]: any;
}
};
export type TableProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Table extends SvelteComponentTyped<
TableProps,

View file

@ -1,11 +1,13 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["tbody"];
type $RestProps = SvelteHTMLElements["tbody"];
export interface TableBodyProps extends RestProps {
type $Props = {
[key: `data-${string}`]: any;
}
};
export type TableBodyProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableBody extends SvelteComponentTyped<
TableBodyProps,

View file

@ -1,11 +1,13 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["td"];
type $RestProps = SvelteHTMLElements["td"];
export interface TableCellProps extends RestProps {
type $Props = {
[key: `data-${string}`]: any;
}
};
export type TableCellProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableCell extends SvelteComponentTyped<
TableCellProps,

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 TableContainerProps extends RestProps {
type $Props = {
/**
* Specify the title of the data table
* @default ""
@ -29,7 +29,9 @@ export interface TableContainerProps extends RestProps {
useStaticWidth?: boolean;
[key: `data-${string}`]: any;
}
};
export type TableContainerProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableContainer extends SvelteComponentTyped<
TableContainerProps,

View file

@ -1,11 +1,13 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["thead"];
type $RestProps = SvelteHTMLElements["thead"];
export interface TableHeadProps extends RestProps {
type $Props = {
[key: `data-${string}`]: any;
}
};
export type TableHeadProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableHead extends SvelteComponentTyped<
TableHeadProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["th"];
type $RestProps = SvelteHTMLElements["th"];
export interface TableHeaderProps extends RestProps {
type $Props = {
/**
* Set to `true` for the sortable variant
* @default false
@ -41,7 +41,9 @@ export interface TableHeaderProps extends RestProps {
id?: string;
[key: `data-${string}`]: any;
}
};
export type TableHeaderProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableHeader extends SvelteComponentTyped<
TableHeaderProps,

View file

@ -1,11 +1,13 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["tr"];
type $RestProps = SvelteHTMLElements["tr"];
export interface TableRowProps extends RestProps {
type $Props = {
[key: `data-${string}`]: any;
}
};
export type TableRowProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TableRow extends SvelteComponentTyped<
TableRowProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["section"];
type $RestProps = SvelteHTMLElements["section"];
export interface ToolbarProps extends RestProps {
type $Props = {
/**
* Specify the toolbar size
* @default "default"
@ -11,7 +11,9 @@ export interface ToolbarProps extends RestProps {
size?: "sm" | "default";
[key: `data-${string}`]: any;
}
};
export type ToolbarProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Toolbar extends SvelteComponentTyped<
ToolbarProps,

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 ToolbarBatchActionsProps extends RestProps {
type $Props = {
/**
* Override the total items selected text
* @default (totalSelected) => `${totalSelected} item${totalSelected === 1 ? "" : "s"} selected`
@ -17,7 +17,9 @@ export interface ToolbarBatchActionsProps extends RestProps {
active?: undefined | boolean;
[key: `data-${string}`]: any;
}
};
export type ToolbarBatchActionsProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ToolbarBatchActions extends SvelteComponentTyped<
ToolbarBatchActionsProps,

View file

@ -1,6 +1,6 @@
import type { SvelteComponentTyped } from "svelte";
export interface ToolbarContentProps {}
export type ToolbarContentProps = {};
export default class ToolbarContent extends SvelteComponentTyped<
ToolbarContentProps,

View file

@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { OverflowMenuProps } from "../OverflowMenu/OverflowMenu.svelte";
export interface ToolbarMenuProps extends OverflowMenuProps {}
export type ToolbarMenuProps = OverflowMenuProps & {};
export default class ToolbarMenu extends SvelteComponentTyped<
ToolbarMenuProps,

View file

@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { OverflowMenuItemProps } from "../OverflowMenu/OverflowMenuItem.svelte";
export interface ToolbarMenuItemProps extends OverflowMenuItemProps {}
export type ToolbarMenuItemProps = OverflowMenuItemProps & {};
export default class ToolbarMenuItem extends SvelteComponentTyped<
ToolbarMenuItemProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["input"];
type $RestProps = SvelteHTMLElements["input"];
export interface ToolbarSearchProps extends RestProps {
type $Props = {
/**
* Specify the value of the search input
* @default ""
@ -64,7 +64,9 @@ export interface ToolbarSearchProps extends RestProps {
ref?: null | HTMLInputElement;
[key: `data-${string}`]: any;
}
};
export type ToolbarSearchProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ToolbarSearch extends SvelteComponentTyped<
ToolbarSearchProps,