feat(typescript)!: support svelte 4 (#1773)

Closes #1753 

The minimum Svelte version required for TypeScript users is now 3.55.
This commit is contained in:
Eric Liu 2023-07-19 09:44:56 -07:00 committed by GitHub
commit 2f026f792a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
192 changed files with 941 additions and 712 deletions

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
export interface ContextMenuProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ul"]> {
type RestProps = SvelteHTMLElements["ul"];
export interface ContextMenuProps extends RestProps {
/**
* 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

View file

@ -1,10 +1,9 @@
/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
export interface ContextMenuDividerProps {}
export default class ContextMenuDivider extends SvelteComponentTyped<
ContextMenuDividerProps,
{},
Record<string, any>,
{}
> {}

View file

@ -1,4 +1,3 @@
/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
export interface ContextMenuGroupProps {
@ -16,6 +15,6 @@ export interface ContextMenuGroupProps {
export default class ContextMenuGroup extends SvelteComponentTyped<
ContextMenuGroupProps,
{},
Record<string, any>,
{ default: {} }
> {}

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
export interface ContextMenuOptionProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
type RestProps = SvelteHTMLElements["li"];
export interface ContextMenuOptionProps extends RestProps {
/**
* Specify the kind of option
* @default "default"
@ -26,7 +27,7 @@ export interface ContextMenuOptionProps
* Icon is rendered to the left of the label text
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;
icon?: typeof import("svelte").SvelteComponent<any>;
/**
* Specify the label text

View file

@ -1,4 +1,3 @@
/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
export interface ContextMenuRadioGroupProps {
@ -17,6 +16,6 @@ export interface ContextMenuRadioGroupProps {
export default class ContextMenuRadioGroup extends SvelteComponentTyped<
ContextMenuRadioGroupProps,
{},
Record<string, any>,
{ default: {} }
> {}