mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(types): use type alias instead of interface for $$restProps
This commit is contained in:
parent
57e99f3a4c
commit
6fbd8ae6a9
165 changed files with 752 additions and 463 deletions
8
types/DataTable/DataTable.svelte.d.ts
vendored
8
types/DataTable/DataTable.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
8
types/DataTable/Table.svelte.d.ts
vendored
8
types/DataTable/Table.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableBody.svelte.d.ts
vendored
8
types/DataTable/TableBody.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableCell.svelte.d.ts
vendored
8
types/DataTable/TableCell.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableContainer.svelte.d.ts
vendored
8
types/DataTable/TableContainer.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableHead.svelte.d.ts
vendored
8
types/DataTable/TableHead.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableHeader.svelte.d.ts
vendored
8
types/DataTable/TableHeader.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/TableRow.svelte.d.ts
vendored
8
types/DataTable/TableRow.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/Toolbar.svelte.d.ts
vendored
8
types/DataTable/Toolbar.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
2
types/DataTable/ToolbarContent.svelte.d.ts
vendored
2
types/DataTable/ToolbarContent.svelte.d.ts
vendored
|
@ -1,6 +1,6 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ToolbarContentProps {}
|
||||
export type ToolbarContentProps = {};
|
||||
|
||||
export default class ToolbarContent extends SvelteComponentTyped<
|
||||
ToolbarContentProps,
|
||||
|
|
2
types/DataTable/ToolbarMenu.svelte.d.ts
vendored
2
types/DataTable/ToolbarMenu.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
2
types/DataTable/ToolbarMenuItem.svelte.d.ts
vendored
2
types/DataTable/ToolbarMenuItem.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
8
types/DataTable/ToolbarSearch.svelte.d.ts
vendored
8
types/DataTable/ToolbarSearch.svelte.d.ts
vendored
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue