mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +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
|
@ -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 InlineNotificationProps extends RestProps {
|
||||
type $Props = {
|
||||
/**
|
||||
* Specify the kind of notification
|
||||
* @default "error"
|
||||
|
@ -65,7 +65,9 @@ export interface InlineNotificationProps extends RestProps {
|
|||
closeButtonDescription?: string;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
};
|
||||
|
||||
export type InlineNotificationProps = Omit<$RestProps, keyof $Props> & $Props;
|
||||
|
||||
export default class InlineNotification extends SvelteComponentTyped<
|
||||
InlineNotificationProps,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
import type { ButtonProps } from "../Button/Button.svelte";
|
||||
|
||||
export interface NotificationActionButtonProps extends ButtonProps {}
|
||||
export type NotificationActionButtonProps = ButtonProps & {};
|
||||
|
||||
export default class NotificationActionButton extends SvelteComponentTyped<
|
||||
NotificationActionButtonProps,
|
||||
|
|
|
@ -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 NotificationButtonProps extends RestProps {
|
||||
type $Props = {
|
||||
/**
|
||||
* Set the type of notification
|
||||
* @default "toast"
|
||||
|
@ -29,7 +29,9 @@ export interface NotificationButtonProps extends RestProps {
|
|||
iconDescription?: string;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
};
|
||||
|
||||
export type NotificationButtonProps = Omit<$RestProps, keyof $Props> & $Props;
|
||||
|
||||
export default class NotificationButton extends SvelteComponentTyped<
|
||||
NotificationButtonProps,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface NotificationIconProps {
|
||||
export type NotificationIconProps = {
|
||||
/**
|
||||
* Specify the kind of notification icon
|
||||
* @default "error"
|
||||
|
@ -24,7 +24,7 @@ export interface NotificationIconProps {
|
|||
* @default undefined
|
||||
*/
|
||||
iconDescription: undefined;
|
||||
}
|
||||
};
|
||||
|
||||
export default class NotificationIcon extends SvelteComponentTyped<
|
||||
NotificationIconProps,
|
||||
|
|
|
@ -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 ToastNotificationProps extends RestProps {
|
||||
type $Props = {
|
||||
/**
|
||||
* Specify the kind of notification
|
||||
* @default "error"
|
||||
|
@ -78,7 +78,9 @@ export interface ToastNotificationProps extends RestProps {
|
|||
fullWidth?: boolean;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
}
|
||||
};
|
||||
|
||||
export type ToastNotificationProps = Omit<$RestProps, keyof $Props> & $Props;
|
||||
|
||||
export default class ToastNotification extends SvelteComponentTyped<
|
||||
ToastNotificationProps,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue