1.0.4 • Published 10 months ago

types-inertiajs-svelte v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

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

  1. To install this package, use npm or yarn:
npm install --save-dev types-inertiajs-svelte
  1. 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;
}>;
  1. Add to tsconfig.json
    "paths": {
        "@inertiajs/svelte": ["resources/js/types/inertia.d.ts"]
    },
1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago