Skip to content

Commit

Permalink
use builtin inertia types
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmajor committed Oct 10, 2024
1 parent 1f6f775 commit c63aa6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 80 deletions.
1 change: 1 addition & 0 deletions resources/js/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ document.startViewTransition ??= (cb: () => void) => cb();
createInertiaApp({
resolve,
setup({ el, App, props }) {
// @ts-expect-error
mount(App, { target: el, props });
},
progress: {
Expand Down
7 changes: 4 additions & 3 deletions resources/js/common.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type Component } from 'svelte';
import type { ResolvedComponent } from '@inertiajs/svelte';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import Layout from '@/Layouts/Layout.svelte';

export async function resolve(name: string) {
export async function resolve(name: string): Promise<ResolvedComponent> {
const page = await resolvePageComponent(
`./Pages/${name}.svelte`,
import.meta.glob<{ default: Component }>('./Pages/*/*.svelte'),
import.meta.glob<ResolvedComponent>('./Pages/*/*.svelte'),
);
// @ts-expect-error
return { default: page.default, layout: Layout };
}
77 changes: 0 additions & 77 deletions resources/js/types/inertia.d.ts

This file was deleted.

0 comments on commit c63aa6e

Please sign in to comment.