-
-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Labels
component: toastChanges related to the toast component.Changes related to the toast component.typescript
Description
Not sure if this is a bug or a misconfiguration on my part so please move this issue to discussion if the behavior is as expected
I would like to constraint the type in Toast actions to only have a few string literals so I have the following type declaration in my base-ui.d.ts
/** biome-ignore-all lint/correctness/noUnusedVariables: safe, only augmenting types */
import '@base-ui-components/react'
declare module '@base-ui-components/react/toast' {
interface ToastObject<Data extends object> {
type?: 'default' | 'info' | 'error' | 'success'
}
}But the hints from toast.add({ type: /**/ }) is still showing as the default string | undefined, even though when press the "Go to definition" key from the IDE, the editor shows both the library code and my d.ts file, which means the LSP properly picked up my types file

Metadata
Metadata
Assignees
Labels
component: toastChanges related to the toast component.Changes related to the toast component.typescript