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["main"];
type $RestProps = SvelteHTMLElements["main"];
export interface ContentProps extends RestProps {
type $Props = {
/**
* Specify the id for the main element
* @default "main-content"
@ -11,7 +11,9 @@ export interface ContentProps extends RestProps {
id?: string;
[key: `data-${string}`]: any;
}
};
export type ContentProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Content extends SvelteComponentTyped<
ContentProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface HeaderProps extends RestProps {
type $Props = {
/**
* Set to `false` to hide the side nav by default
* @default true
@ -82,7 +82,9 @@ export interface HeaderProps extends RestProps {
iconClose?: typeof import("svelte").SvelteComponent<any>;
[key: `data-${string}`]: any;
}
};
export type HeaderProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Header extends SvelteComponentTyped<
HeaderProps,

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 HeaderActionProps extends RestProps {
type $Props = {
/**
* Set to `true` to open the panel
* @default false
@ -51,7 +51,9 @@ export interface HeaderActionProps extends RestProps {
preventCloseOnClickOutside?: boolean;
[key: `data-${string}`]: any;
}
};
export type HeaderActionProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderAction extends SvelteComponentTyped<
HeaderActionProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface HeaderActionLinkProps extends RestProps {
type $Props = {
/**
* Set to `true` to use the active state
* @default false
@ -29,7 +29,9 @@ export interface HeaderActionLinkProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type HeaderActionLinkProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderActionLink extends SvelteComponentTyped<
HeaderActionLinkProps,

View file

@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { ButtonProps } from "../Button/Button.svelte";
export interface HeaderGlobalActionProps extends ButtonProps {
export type HeaderGlobalActionProps = ButtonProps & {
/**
* Set to `true` to use the active variant
* @default false
@ -19,7 +19,7 @@ export interface HeaderGlobalActionProps extends ButtonProps {
* @default null
*/
ref?: HTMLButtonElement;
}
};
export default class HeaderGlobalAction extends SvelteComponentTyped<
HeaderGlobalActionProps,

View file

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

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface HeaderNavItemProps extends RestProps {
type $Props = {
/**
* Specify the `href` attribute
* @default undefined
@ -29,7 +29,9 @@ export interface HeaderNavItemProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type HeaderNavItemProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderNavItem extends SvelteComponentTyped<
HeaderNavItemProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface HeaderNavMenuProps extends RestProps {
type $Props = {
/**
* Set to `true` to toggle the expanded state
* @default false
@ -29,7 +29,9 @@ export interface HeaderNavMenuProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type HeaderNavMenuProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderNavMenu extends SvelteComponentTyped<
HeaderNavMenuProps,

View file

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

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface HeaderPanelLinkProps extends RestProps {
type $Props = {
/**
* Specify the `href` attribute
* @default undefined
@ -17,7 +17,9 @@ export interface HeaderPanelLinkProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type HeaderPanelLinkProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderPanelLink extends SvelteComponentTyped<
HeaderPanelLinkProps,

View file

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

View file

@ -7,9 +7,9 @@ export interface HeaderSearchResult {
description?: string;
}
type RestProps = SvelteHTMLElements["input"];
type $RestProps = SvelteHTMLElements["input"];
export interface HeaderSearchProps extends RestProps {
type $Props = {
/**
* Specify the search input value
* @default ""
@ -41,7 +41,9 @@ export interface HeaderSearchProps extends RestProps {
selectedResultIndex?: number;
[key: `data-${string}`]: any;
}
};
export type HeaderSearchProps = Omit<$RestProps, keyof $Props> & $Props;
export default class HeaderSearch extends SvelteComponentTyped<
HeaderSearchProps,

View file

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

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["nav"];
type $RestProps = SvelteHTMLElements["nav"];
export interface SideNavProps extends RestProps {
type $Props = {
/**
* Set to `true` to use the fixed variant
* @default false
@ -41,7 +41,9 @@ export interface SideNavProps extends RestProps {
expansionBreakpoint?: number;
[key: `data-${string}`]: any;
}
};
export type SideNavProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SideNav extends SvelteComponentTyped<
SideNavProps,

View file

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

View file

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

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface SideNavLinkProps extends RestProps {
type $Props = {
/**
* Set to `true` to select the current link
* @default false
@ -35,7 +35,9 @@ export interface SideNavLinkProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type SideNavLinkProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SideNavLink extends SvelteComponentTyped<
SideNavLinkProps,

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 SideNavMenuProps extends RestProps {
type $Props = {
/**
* Set to `true` to toggle the expanded state
* @default false
@ -29,7 +29,9 @@ export interface SideNavMenuProps extends RestProps {
ref?: null | HTMLButtonElement;
[key: `data-${string}`]: any;
}
};
export type SideNavMenuProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SideNavMenu extends SvelteComponentTyped<
SideNavMenuProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface SideNavMenuItemProps extends RestProps {
type $Props = {
/**
* Set to `true` to select the item
* @default false
@ -29,7 +29,9 @@ export interface SideNavMenuItemProps extends RestProps {
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}
};
export type SideNavMenuItemProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SideNavMenuItem extends SvelteComponentTyped<
SideNavMenuItemProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"];
type $RestProps = SvelteHTMLElements["a"];
export interface SkipToContentProps extends RestProps {
type $Props = {
/**
* Specify the `href` attribute
* @default "#main-content"
@ -17,7 +17,9 @@ export interface SkipToContentProps extends RestProps {
tabindex?: string;
[key: `data-${string}`]: any;
}
};
export type SkipToContentProps = Omit<$RestProps, keyof $Props> & $Props;
export default class SkipToContent extends SvelteComponentTyped<
SkipToContentProps,