Basic Laravel project
This commit is contained in:
26
resources/js/types/globals.d.ts
vendored
Normal file
26
resources/js/types/globals.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { AppPageProps } from '@/types/index';
|
||||
|
||||
// Extend ImportMeta interface for Vite...
|
||||
declare module 'vite/client' {
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_NAME: string;
|
||||
[key: string]: string | boolean | undefined;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
readonly glob: <T>(pattern: string) => Record<string, () => Promise<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@inertiajs/core' {
|
||||
interface PageProps extends InertiaPageProps, AppPageProps {}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$inertia: typeof Router;
|
||||
$page: Page;
|
||||
$headManager: ReturnType<typeof createHeadManager>;
|
||||
}
|
||||
}
|
||||
38
resources/js/types/index.d.ts
vendored
Normal file
38
resources/js/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { LucideIcon } from 'lucide-vue-next';
|
||||
import type { Config } from 'ziggy-js';
|
||||
|
||||
export interface Auth {
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface BreadcrumbItem {
|
||||
title: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
export interface NavItem {
|
||||
title: string;
|
||||
href: string;
|
||||
icon?: LucideIcon;
|
||||
isActive?: boolean;
|
||||
}
|
||||
|
||||
export type AppPageProps<T extends Record<string, unknown> = Record<string, unknown>> = T & {
|
||||
name: string;
|
||||
quote: { message: string; author: string };
|
||||
auth: Auth;
|
||||
ziggy: Config & { location: string };
|
||||
sidebarOpen: boolean;
|
||||
};
|
||||
|
||||
export interface User {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
avatar?: string;
|
||||
email_verified_at: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export type BreadcrumbItemType = BreadcrumbItem;
|
||||
11
resources/js/types/ziggy.d.ts
vendored
Normal file
11
resources/js/types/ziggy.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { route } from 'ziggy-js';
|
||||
|
||||
declare global {
|
||||
let route: typeof route;
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
route: typeof route;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user