pqina/svelte-filepond

Typescript Support

AgarwalPragy opened this issue · 4 comments

Using svelte-filepond with typescript causes the error Cannot resolve definitions for module 'svelte-filepond'. The type definitions aren't available at @types/svelte-filepond either.

A definitions file will be very helpful. Thanks.

Hopefully will add those in the near future, if anyone feels like adding them, a PR is very welcome.

Thank you @rikschennink !

I get the same errors and fix by vscode suggestion (the docs in github repo get errors):
With import in +page.svelte
import FilePond, { registerPlugin, supported } from 'svelte-filepond'; import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation'; import FilePondPluginImagePreview from 'filepond-plugin-image-preview'; import 'filepond/dist/filepond.min.css'; import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css'

in app.d.ts add this line:
declare module 'svelte-filepond';