This package provides TypeScript type definitions for @inertiajs/svelte
, enhancing type safety and developer experience when working with Inertia.js in Svelte applications.
npm install --save-dev types-inertiajs-svelte
export type User = { id: number; name: string; username: string; };
export type Page = DefaultPage<{ auth: { user?: User; }; flash: { message?: string; error?: string; }; errors: object; }>;
3. Add to tsconfig.json
```json
"paths": {
"@inertiajs/svelte": ["resources/js/types/inertia.d.ts"]
},