@@ -114,6 +114,8 @@ type-checking features.
114
114
115
115
### How does TypeScript work inside Svelte-Components?
116
116
117
+ > Svelte has added a [ ` TypeScript ` -section] ( https://svelte.dev/docs/typescript ) to their official docs.
118
+
117
119
Per default the ` Svelte ` -compiler only understands plain ` HTML ` , ` CSS ` and ` JavaScript ` . But we can
118
120
add support for other languages to the compiler via custom
119
121
[ ` preprocessors ` ] ( https://svelte.dev/docs#compile-time-svelte-preprocess ) . Luckily, we don't have to
@@ -322,7 +324,7 @@ This chapter shows how you can define events that a component emits.
322
324
323
325
#### external components
324
326
325
- - ** [ SvelteComponentTyped ] ( https://github.com/ivanhofer/sveltekit-typescript-showcase/tree/main/src/05-external-components ) ** :
327
+ - ** [ SvelteComponent ] ( https://github.com/ivanhofer/sveltekit-typescript-showcase/tree/main/src/05-external-components ) ** :
326
328
how to write type definitions for external components
327
329
- ** [ ` svelte-kit package ` ] ( https://github.com/ivanhofer/sveltekit-typescript-showcase/tree/main/src/lib ) ** :
328
330
how to create a ` Svelte ` component library
@@ -565,10 +567,6 @@ splitting the model into two different interfaces and then use an union type to.
565
567
566
568
#### #2 extend existing type definitions
567
569
568
- > [ Example] ( https://github.com/ivanhofer/sveltekit-typescript-showcase/blob/main/src/createEventDispatcher.d.ts ) \
569
- > a more complex example you don't need to fully understand. But this example can show you what is possible
570
- > with ` TypeScript ` if you know how to use it ;)
571
-
572
570
Sometimes it is possible that a library contains missing or incomplete type definitions. You could
573
571
either use ` // @ts-ignore ` comments and live with it or you can write the type declaration yourself.
574
572
0 commit comments