types-inertiajs-svelte
v1.0.4
Published
Typescript declarations for @inertia/svelte
Downloads
48
Readme
Inertia Svelte Type Definitions
This package provides TypeScript type definitions for @inertiajs/svelte
, enhancing type safety and developer experience when working with Inertia.js in Svelte applications.
Installation
- To install this package, use npm or yarn:
npm install --save-dev types-inertiajs-svelte
- Create inertia.d.ts file at resources/js/types/inertia.d.ts
import type { Page as DefaultPage } from '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;
}>;
- Add to tsconfig.json
"paths": {
"@inertiajs/svelte": ["resources/js/types/inertia.d.ts"]
},