Skip to content

Commit 6fbd8ae

Browse files
committed
fix(types): use type alias instead of interface for $$restProps
1 parent 57e99f3 commit 6fbd8ae

File tree

165 files changed

+752
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+752
-463
lines changed

types/Accordion/Accordion.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { AccordionSkeletonProps } from "./AccordionSkeleton.svelte";
33

4-
export interface AccordionProps extends AccordionSkeletonProps {
4+
export type AccordionProps = AccordionSkeletonProps & {
55
/**
66
* Specify alignment of accordion item chevron icon
77
* @default "end"
@@ -25,7 +25,7 @@ export interface AccordionProps extends AccordionSkeletonProps {
2525
* @default false
2626
*/
2727
skeleton?: boolean;
28-
}
28+
};
2929

3030
export default class Accordion extends SvelteComponentTyped<
3131
AccordionProps,

types/Accordion/AccordionItem.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["li"];
4+
type $RestProps = SvelteHTMLElements["li"];
55

6-
export interface AccordionItemProps extends RestProps {
6+
type $Props = {
77
/**
88
* Specify the title of the accordion item heading.
99
* Alternatively, use the "title" slot (e.g., `<div slot="title">...</div>`)
@@ -30,7 +30,9 @@ export interface AccordionItemProps extends RestProps {
3030
iconDescription?: string;
3131

3232
[key: `data-${string}`]: any;
33-
}
33+
};
34+
35+
export type AccordionItemProps = Omit<$RestProps, keyof $Props> & $Props;
3436

3537
export default class AccordionItem extends SvelteComponentTyped<
3638
AccordionItemProps,

types/Accordion/AccordionSkeleton.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["ul"];
4+
type $RestProps = SvelteHTMLElements["ul"];
55

6-
export interface AccordionSkeletonProps extends RestProps {
6+
type $Props = {
77
/**
88
* Specify the number of accordion items to render
99
* @default 4
@@ -29,7 +29,9 @@ export interface AccordionSkeletonProps extends RestProps {
2929
open?: boolean;
3030

3131
[key: `data-${string}`]: any;
32-
}
32+
};
33+
34+
export type AccordionSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
3335

3436
export default class AccordionSkeleton extends SvelteComponentTyped<
3537
AccordionSkeletonProps,

types/AspectRatio/AspectRatio.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface AspectRatioProps extends RestProps {
6+
type $Props = {
77
/**
88
* Specify the aspect ratio
99
* @default "2x1"
@@ -20,7 +20,9 @@ export interface AspectRatioProps extends RestProps {
2020
| "1x2";
2121

2222
[key: `data-${string}`]: any;
23-
}
23+
};
24+
25+
export type AspectRatioProps = Omit<$RestProps, keyof $Props> & $Props;
2426

2527
export default class AspectRatio extends SvelteComponentTyped<
2628
AspectRatioProps,

types/Breadcrumb/Breadcrumb.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { BreadcrumbSkeletonProps } from "./BreadcrumbSkeleton.svelte";
33

4-
export interface BreadcrumbProps extends BreadcrumbSkeletonProps {
4+
export type BreadcrumbProps = BreadcrumbSkeletonProps & {
55
/**
66
* Set to `true` to hide the breadcrumb trailing slash
77
* @default false
@@ -13,7 +13,7 @@ export interface BreadcrumbProps extends BreadcrumbSkeletonProps {
1313
* @default false
1414
*/
1515
skeleton?: boolean;
16-
}
16+
};
1717

1818
export default class Breadcrumb extends SvelteComponentTyped<
1919
BreadcrumbProps,

types/Breadcrumb/BreadcrumbItem.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["li"];
4+
type $RestProps = SvelteHTMLElements["li"];
55

6-
export interface BreadcrumbItemProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set the `href` to use an anchor link
99
* @default undefined
@@ -17,7 +17,9 @@ export interface BreadcrumbItemProps extends RestProps {
1717
isCurrentPage?: boolean;
1818

1919
[key: `data-${string}`]: any;
20-
}
20+
};
21+
22+
export type BreadcrumbItemProps = Omit<$RestProps, keyof $Props> & $Props;
2123

2224
export default class BreadcrumbItem extends SvelteComponentTyped<
2325
BreadcrumbItemProps,

types/Breadcrumb/BreadcrumbSkeleton.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface BreadcrumbSkeletonProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set to `true` to hide the breadcrumb trailing slash
99
* @default false
@@ -17,7 +17,9 @@ export interface BreadcrumbSkeletonProps extends RestProps {
1717
count?: number;
1818

1919
[key: `data-${string}`]: any;
20-
}
20+
};
21+
22+
export type BreadcrumbSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
2123

2224
export default class BreadcrumbSkeleton extends SvelteComponentTyped<
2325
BreadcrumbSkeletonProps,

types/Breakpoint/Breakpoint.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
44

55
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
66

7-
export interface BreakpointProps {
7+
export type BreakpointProps = {
88
/**
99
* Determine the current Carbon grid breakpoint size
1010
* @default undefined
@@ -16,7 +16,7 @@ export interface BreakpointProps {
1616
* @default { sm: false, md: false, lg: false, xlg: false, max: false, }
1717
*/
1818
sizes?: Record<BreakpointSize, boolean>;
19-
}
19+
};
2020

2121
export default class Breakpoint extends SvelteComponentTyped<
2222
BreakpointProps,

types/Button/Button.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type { SvelteHTMLElements } from "svelte/elements";
33

44
import type { ButtonSkeletonProps } from "./ButtonSkeleton.svelte";
55

6-
type RestProps = SvelteHTMLElements["button"] &
6+
type $RestProps = SvelteHTMLElements["button"] &
77
SvelteHTMLElements["a"] &
88
SvelteHTMLElements["div"];
99

10-
export interface ButtonProps extends ButtonSkeletonProps, RestProps {
10+
type $Props = {
1111
/**
1212
* Specify the kind of button
1313
* @default "primary"
@@ -109,7 +109,9 @@ export interface ButtonProps extends ButtonSkeletonProps, RestProps {
109109
ref?: null | HTMLAnchorElement | HTMLButtonElement;
110110

111111
[key: `data-${string}`]: any;
112-
}
112+
};
113+
114+
export type ButtonProps = Omit<$RestProps, keyof $Props> & $Props;
113115

114116
export default class Button extends SvelteComponentTyped<
115117
ButtonProps,

types/Button/ButtonSet.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface ButtonSetProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set to `true` to stack the buttons vertically
99
* @default false
1010
*/
1111
stacked?: boolean;
1212

1313
[key: `data-${string}`]: any;
14-
}
14+
};
15+
16+
export type ButtonSetProps = Omit<$RestProps, keyof $Props> & $Props;
1517

1618
export default class ButtonSet extends SvelteComponentTyped<
1719
ButtonSetProps,

types/Button/ButtonSkeleton.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["a"];
4+
type $RestProps = SvelteHTMLElements["a"];
55

6-
export interface ButtonSkeletonProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set the `href` to use an anchor link
99
* @default undefined
@@ -17,7 +17,9 @@ export interface ButtonSkeletonProps extends RestProps {
1717
size?: "default" | "field" | "small" | "lg" | "xl";
1818

1919
[key: `data-${string}`]: any;
20-
}
20+
};
21+
22+
export type ButtonSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
2123

2224
export default class ButtonSkeleton extends SvelteComponentTyped<
2325
ButtonSkeletonProps,

types/Checkbox/Checkbox.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface CheckboxProps extends RestProps {
6+
type $Props = {
77
/**
88
* Specify the value of the checkbox
99
* @default ""
@@ -89,7 +89,9 @@ export interface CheckboxProps extends RestProps {
8989
ref?: null | HTMLInputElement;
9090

9191
[key: `data-${string}`]: any;
92-
}
92+
};
93+
94+
export type CheckboxProps = Omit<$RestProps, keyof $Props> & $Props;
9395

9496
export default class Checkbox extends SvelteComponentTyped<
9597
CheckboxProps,

types/Checkbox/CheckboxSkeleton.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface CheckboxSkeletonProps extends RestProps {
6+
type $Props = {
77
[key: `data-${string}`]: any;
8-
}
8+
};
9+
10+
export type CheckboxSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
911

1012
export default class CheckboxSkeleton extends SvelteComponentTyped<
1113
CheckboxSkeletonProps,

types/CodeSnippet/CodeSnippet.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SvelteComponentTyped } from "svelte";
22

3-
export interface CodeSnippetProps {
3+
export type CodeSnippetProps = {
44
/**
55
* Set the type of code snippet
66
* @default "single"
@@ -122,7 +122,7 @@ export interface CodeSnippetProps {
122122
* @default null
123123
*/
124124
ref?: null | HTMLPreElement;
125-
}
125+
};
126126

127127
export default class CodeSnippet extends SvelteComponentTyped<
128128
CodeSnippetProps,

types/CodeSnippet/CodeSnippetSkeleton.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface CodeSnippetSkeletonProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set the type of code snippet
99
* @default "single"
1010
*/
1111
type?: "single" | "multi";
1212

1313
[key: `data-${string}`]: any;
14-
}
14+
};
15+
16+
export type CodeSnippetSkeletonProps = Omit<$RestProps, keyof $Props> & $Props;
1517

1618
export default class CodeSnippetSkeleton extends SvelteComponentTyped<
1719
CodeSnippetSkeletonProps,

types/ComboBox/ComboBox.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export interface ComboBoxItem {
99
disabled?: boolean;
1010
}
1111

12-
type RestProps = SvelteHTMLElements["input"];
12+
type $RestProps = SvelteHTMLElements["input"];
1313

14-
export interface ComboBoxProps extends RestProps {
14+
type $Props = {
1515
/**
1616
* Set the combobox items
1717
* @default []
@@ -155,7 +155,9 @@ export interface ComboBoxProps extends RestProps {
155155
listRef?: null | HTMLDivElement;
156156

157157
[key: `data-${string}`]: any;
158-
}
158+
};
159+
160+
export type ComboBoxProps = Omit<$RestProps, keyof $Props> & $Props;
159161

160162
export default class ComboBox extends SvelteComponentTyped<
161163
ComboBoxProps,

types/ComposedModal/ComposedModal.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface ComposedModalProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set the size of the composed modal
99
* @default undefined
@@ -47,7 +47,9 @@ export interface ComposedModalProps extends RestProps {
4747
ref?: null | HTMLDivElement;
4848

4949
[key: `data-${string}`]: any;
50-
}
50+
};
51+
52+
export type ComposedModalProps = Omit<$RestProps, keyof $Props> & $Props;
5153

5254
export default class ComposedModal extends SvelteComponentTyped<
5355
ComposedModalProps,

types/ComposedModal/ModalBody.svelte.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SvelteComponentTyped } from "svelte";
22
import type { SvelteHTMLElements } from "svelte/elements";
33

4-
type RestProps = SvelteHTMLElements["div"];
4+
type $RestProps = SvelteHTMLElements["div"];
55

6-
export interface ModalBodyProps extends RestProps {
6+
type $Props = {
77
/**
88
* Set to `true` if the modal contains form elements
99
* @default false
@@ -17,7 +17,9 @@ export interface ModalBodyProps extends RestProps {
1717
hasScrollingContent?: boolean;
1818

1919
[key: `data-${string}`]: any;
20-
}
20+
};
21+
22+
export type ModalBodyProps = Omit<$RestProps, keyof $Props> & $Props;
2123

2224
export default class ModalBody extends SvelteComponentTyped<
2325
ModalBodyProps,

0 commit comments

Comments
 (0)