fix: resolve all typescript errors in sv check (#715)
This commit is contained in:
1 parent
2a5fb886ae
commit
7bddf16559
38 files changed
+233
-287
No files matched your search
@@ -2,11 +2,7 @@
|
||||
import { Spinner } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import { type IconSource, Icon } from 'svelte-hero-icons/dist'
|
||||
import type {
|
||||
ClassValue,
|
||||
HTMLAnchorAttributes,
|
||||
HTMLButtonAttributes,
|
||||
} from 'svelte/elements'
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
export type ButtonColor = keyof typeof buttonColor
|
||||
export type ButtonAlignment = keyof typeof buttonAlignment
|
||||
@@ -77,8 +73,7 @@
|
||||
}
|
||||
type ButtonGap = keyof typeof buttonGap
|
||||
|
||||
interface Props
|
||||
extends Omit<HTMLButtonAttributes | HTMLAnchorAttributes, 'prefix'> {
|
||||
interface Props extends Record<string, any> {
|
||||
loading?: boolean
|
||||
submit?: boolean
|
||||
type?: 'button' | 'none'
|
||||
@@ -94,7 +89,7 @@
|
||||
prefix?: Snippet
|
||||
children?: Snippet
|
||||
suffix?: Snippet
|
||||
onclick?: HTMLButtonAttributes['onclick']
|
||||
onclick?: any
|
||||
icon?: IconSource
|
||||
weight?: ButtonWeight
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
title={$shownModal.title}
|
||||
dismissable={$shownModal.dismissable}
|
||||
ondismissed={() => shownModal.set(undefined)}
|
||||
bind:open={$shownModal}
|
||||
open={!!$shownModal}
|
||||
>
|
||||
{#if $shownModal.snippet}
|
||||
{@render $shownModal.snippet?.()}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
selected?: T | undefined
|
||||
search: (query: string) => Promise<T[]>
|
||||
extractName: (item: T) => string
|
||||
select?: (item: T) => void
|
||||
select?: (item?: T) => void
|
||||
input?: import('svelte').Snippet
|
||||
noresults?: import('svelte').Snippet
|
||||
required?: boolean
|
||||
@@ -43,7 +43,8 @@
|
||||
selected = $bindable(undefined),
|
||||
search,
|
||||
extractName,
|
||||
select = (item: T) => {
|
||||
select = (item?: T) => {
|
||||
if (item == null) return
|
||||
selected = item
|
||||
query = extractName(item)
|
||||
onselect?.(item)
|
||||
|
||||
Reference in new issue
Block a user