8000 Fix TypeScript errors in ssr.ts & when using vue-tsc by TimKunze96 · Pull Request #87 · laravel/vue-starter-kit · GitHub
[go: up one dir, main page]

Skip to content

Fix TypeScript errors in ssr.ts & when using vue-tsc #87

New issue

Have a question about this project? Sign up fo 8000 r a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix route params type
  • Loading branch information
TimKunze96 committed Mar 18, 2025
commit cea7a0a912f98ae08b87f3474b95586ff7c6f1a8
6 changes: 3 additions & 3 deletions resources/js/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import createServer from '@inertiajs/vue3/server';
import { renderToString } from '@vue/server-renderer';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { createSSRApp, DefineComponent, h } from 'vue';
import { route, Router } from 'ziggy-js';
import { route, RouteParams, Router } from 'ziggy-js';

const appName = import.meta.env.VITE_APP_NAME || 'Laravel';

Expand All @@ -24,8 +24,8 @@ createServer((page) =>

// bind config to ziggyRoute function
function appRoute(): Router;
function appRoute(name: string, params?: any, absolute?: boolean): string;
function appRoute(name?: string, params?: any, absolute?: boolean): Router | string {
function appRoute(name: string, params?: RouteParams<typeof name>, absolute?: boolean): string;
function appRoute(name?: string, params?: RouteParams<string>, absolute?: boolean): Router | string {
if (name === undefined) {
return route();
}
Expand Down
4 changes: 2 additions & 2 deletions resources/js/types/ziggy.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Router as ZiggyRouter } from 'ziggy-js';
import { Router as ZiggyRouter, RouteParams } from 'ziggy-js';

type AppRouter = {
(): ZiggyRouter;
(name: string, params?: any, absolute?: boolean): string;
(name: string, params?: RouteParams<typeof name> | undefined, absolute?: boolean): string;
};

declare global {
Expand Down
0