Skip to content

Commit 3ee3c0e

Browse files
authored
Merge pull request #414 from spences10/fix/add-custom-type-for-action
2 parents aa66ee6 + e67c510 commit 3ee3c0e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# SvelteKit Embed
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4+
45
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
6+
57
<!-- ALL-CONTRIBUTORS-BADGE:END -->
68

79
[![MadeWithSvelte.com shield](https://madewithsvelte.com/storage/repo-shields/3786-shield.svg)](https://madewithsvelte.com/p/sveltekit-embed/shield-link)
@@ -47,7 +49,7 @@ Create an
4749

4850
- [ ] Add more components
4951
- [ ] Tests... need adding
50-
- [ ] If you know how to type a custom action in Svelte, please submit
52+
- [x] If you know how to type a custom action in Svelte, please submit
5153
a PR
5254

5355
## Developing locally

src/app.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ declare namespace App {
88
// interface Session {}
99
// interface Stuff {}
1010
}
11+
12+
// https://stackoverflow.com/questions/73025100/svelte-svelte-kit-type-custom-action-event-with-typescript
13+
// https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
14+
declare namespace svelteHTML {
15+
interface HTMLAttributes<T> {
16+
'on:enterViewport'?: (event: any) => any
17+
}
18+
}

0 commit comments

Comments
 (0)