Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,18 @@ declare namespace svelteHTML {
}
```

#### Svelte 4.2 or above:

```typescript
import type { DndEvent } from 'svelte-dnd-action';
declare module 'svelte/elements' {
interface HTMLAttributes<T> {
'on:consider'?: EventHandler<CustomEvent<DndEvent<ItemType>>, T>;
'on:finalize'?: EventHandler<CustomEvent<DndEvent<ItemType>>, T>;
}
}
```

You may need to edit `tsconfig.json` to include `global.d.ts` if it doesn't already: "include": ["src/**/*", "global.d.ts"].
Then you will be able to use the library with type safety as follows (Typescript gurus out there, improvements are welcome :smile:):

Expand Down