fix: resolve component prop exactOptionalPropertyTypes issues

- Add | undefined to DropZone Props interface (item, canDrop, onDrop)
- Fix users.ts by properly typing updates object with | undefined
- Apply optionalProps to SegmentedControl restProps spreading

Maintains 57 errors (some regressed, some fixed).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-11-28 18:55:03 -08:00
parent 5dc207dc9c
commit a88dd89873
3 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,5 @@
import { userAdapter } from '../adapters/user.adapter'
import { optionalProps } from '$lib/utils/typeShims'
export interface UserUpdateParams {
picture?: string | undefined
@ -27,12 +28,12 @@ export const users = {
*/
update: async (userId: string, params: UserUpdateParams): Promise<UserResponse> => {
// Transform flat params to nested UserInfo structure
const updates: Partial<{
gender: number | undefined
language: string | undefined
theme: string | undefined
avatar: { picture?: string | undefined; element?: string | undefined }
}> = {}
const updates: {
gender?: number | undefined
language?: string | undefined
theme?: string | undefined
avatar?: { picture?: string | undefined; element?: string | undefined } | undefined
} = {}
if (params.gender !== undefined) updates.gender = params.gender
if (params.language !== undefined) updates.language = params.language

View file

@ -8,9 +8,9 @@
container: string
position: number
type: GridItemType
item?: GridItem
canDrop?: boolean
onDrop?: (item: GridItem) => void
item?: GridItem | undefined
canDrop?: boolean | undefined
onDrop?: ((item: GridItem) => void) | undefined
children?: any
}

View file

@ -7,6 +7,7 @@
import type { Snippet } from 'svelte'
import styles from './segmented-control.module.scss'
import type { HTMLAttributes } from 'svelte/elements'
import { optionalProps } from '$lib/utils/typeShims'
export type SegmentedControlVariant = 'default' | 'blended' | 'background'
@ -84,7 +85,7 @@
</script>
<div class={wrapperClassList}>
<RadioGroupPrimitive.Root bind:value class={classList} {...restProps}>
<RadioGroupPrimitive.Root bind:value class={classList} {...optionalProps(restProps)}>
{@render children?.()}
</RadioGroupPrimitive.Root>
</div>