fix(examples): TypeScript in with-svelte example (#10450)
### Description
Inspired by @DoctorRyner in #10437, a set of changes to make TypeScript
work better for the `with-svelte` example.
### Testing Instructions
This set of changes works correctly in my editor.
---------
Co-authored-by: Rainer Reinhardt <drryner@icloud.com>