first commit
This commit is contained in:
14
resources/js/types/auth.ts
Normal file
14
resources/js/types/auth.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export type User = {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
avatar?: string;
|
||||
email_verified_at: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type Auth = {
|
||||
user: User;
|
||||
};
|
||||
33
resources/js/types/global.d.ts
vendored
Normal file
33
resources/js/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { Auth } from '@/types/auth';
|
||||
|
||||
// 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' {
|
||||
export interface InertiaConfig {
|
||||
sharedPageProps: {
|
||||
name: string;
|
||||
auth: Auth;
|
||||
sidebarOpen: boolean;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$inertia: typeof Router;
|
||||
$page: Page;
|
||||
$headManager: ReturnType<typeof createHeadManager>;
|
||||
}
|
||||
}
|
||||
1
resources/js/types/index.ts
Normal file
1
resources/js/types/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './auth';
|
||||
27
resources/js/types/naive.d.ts
vendored
Normal file
27
resources/js/types/naive.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import type {
|
||||
DialogApi,
|
||||
LoadingBarApi,
|
||||
MessageApi,
|
||||
NotificationApi,
|
||||
} from 'naive-ui';
|
||||
|
||||
// Discrete API NaiveUI, доступные глобально (см. plugins/naive.ts).
|
||||
declare global {
|
||||
interface Window {
|
||||
$message: MessageApi;
|
||||
$notification: NotificationApi;
|
||||
$dialog: DialogApi;
|
||||
$loadingBar: LoadingBarApi;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$message: MessageApi;
|
||||
$notification: NotificationApi;
|
||||
$dialog: DialogApi;
|
||||
$loadingBar: LoadingBarApi;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
5
resources/js/types/vue-shims.d.ts
vendored
Normal file
5
resources/js/types/vue-shims.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent;
|
||||
export default component;
|
||||
}
|
||||
Reference in New Issue
Block a user