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["ul"];
type $RestProps = SvelteHTMLElements["ul"];
export interface ContextMenuProps extends RestProps {
type $Props = {
/**
* Specify an element or list of elements to trigger the context menu.
* If no element is specified, the context menu applies to the entire window
@ -37,7 +37,9 @@ export interface ContextMenuProps extends RestProps {
ref?: null | HTMLUListElement;
[key: `data-${string}`]: any;
}
};
export type ContextMenuProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ContextMenu extends SvelteComponentTyped<
ContextMenuProps,

View file

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

View file

@ -1,6 +1,6 @@
import type { SvelteComponentTyped } from "svelte";
export interface ContextMenuGroupProps {
export type ContextMenuGroupProps = {
/**
* @default []
*/
@ -11,7 +11,7 @@ export interface ContextMenuGroupProps {
* @default ""
*/
labelText?: string;
}
};
export default class ContextMenuGroup extends SvelteComponentTyped<
ContextMenuGroupProps,

View file

@ -1,9 +1,9 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["li"];
type $RestProps = SvelteHTMLElements["li"];
export interface ContextMenuOptionProps extends RestProps {
type $Props = {
/**
* Specify the kind of option
* @default "default"
@ -70,7 +70,9 @@ export interface ContextMenuOptionProps extends RestProps {
ref?: null | HTMLLIElement;
[key: `data-${string}`]: any;
}
};
export type ContextMenuOptionProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ContextMenuOption extends SvelteComponentTyped<
ContextMenuOptionProps,

View file

@ -1,6 +1,6 @@
import type { SvelteComponentTyped } from "svelte";
export interface ContextMenuRadioGroupProps {
export type ContextMenuRadioGroupProps = {
/**
* Set the selected radio group id
* @default ""
@ -12,7 +12,7 @@ export interface ContextMenuRadioGroupProps {
* @default ""
*/
labelText?: string;
}
};
export default class ContextMenuRadioGroup extends SvelteComponentTyped<
ContextMenuRadioGroupProps,