-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypeScript support to Inertia Svelte Stack
The Svelte stack within the Inertia console install script has been updated to handle TypeScript options. This includes an updated package.json script including the "tsc" command, copying over important .ts and .d.ts files, and handling the SSR option correctly.
- Loading branch information
1 parent
07ff1a0
commit a353f44
Showing
5 changed files
with
61 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { PageProps as InertiaPageProps } from '@inertiajs/core'; | ||
import { AxiosInstance } from 'axios'; | ||
import { route as ziggyRoute } from 'ziggy-js'; | ||
import { PageProps as AppPageProps } from './'; | ||
|
||
declare global { | ||
interface Window { | ||
axios: AxiosInstance; | ||
Ziggy: any; | ||
} | ||
|
||
// noinspection ES6ConvertVarToLetConst | ||
var route: typeof ziggyRoute; | ||
} | ||
|
||
declare module '@inertiajs/core' { | ||
interface PageProps extends InertiaPageProps, AppPageProps {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface User { | ||
id: number; | ||
name: string; | ||
email: string; | ||
email_verified_at: string; | ||
} | ||
|
||
export type PageProps<T extends Record<string, unknown> = Record<string, unknown>> = T & { | ||
auth: { | ||
user: User; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |