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["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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

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 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,