2024-07-21 19:05:48 +00:00
|
|
|
import { ApiClient } from './lib/server/api';
|
|
|
|
|
import type { User } from 'lucia';
|
|
|
|
|
import { parseApiResponse } from '$lib/utils/api';
|
|
|
|
|
|
2022-04-19 02:43:54 +00:00
|
|
|
// See https://kit.svelte.dev/docs/types#app
|
|
|
|
|
// for information about these interfaces
|
2022-07-07 19:30:14 +00:00
|
|
|
// and what to do when importing types
|
2023-06-20 18:54:47 +00:00
|
|
|
|
2023-05-21 05:18:04 +00:00
|
|
|
// src/app.d.ts
|
|
|
|
|
declare global {
|
|
|
|
|
namespace App {
|
2023-05-29 06:34:39 +00:00
|
|
|
interface PageData {
|
2024-04-05 23:10:12 +00:00
|
|
|
flash?: {
|
|
|
|
|
type: 'success' | 'error' | 'info';
|
|
|
|
|
message: string;
|
|
|
|
|
data?: Record<string, unknown>;
|
|
|
|
|
};
|
2023-05-29 06:34:39 +00:00
|
|
|
}
|
2023-05-21 05:18:04 +00:00
|
|
|
interface Locals {
|
2024-07-21 19:05:48 +00:00
|
|
|
api: ApiClient['api'];
|
|
|
|
|
parseApiResponse: typeof parseApiResponse;
|
|
|
|
|
getAuthedUser: () => Promise<Returned<User> | null>;
|
|
|
|
|
getAuthedUserOrThrow: () => Promise<Returned<User>>;
|
2023-07-30 05:00:51 +00:00
|
|
|
auth: import('lucia').AuthRequest;
|
2023-12-15 01:53:15 +00:00
|
|
|
user: import('lucia').User | null;
|
2024-01-31 01:57:36 +00:00
|
|
|
session: import('lucia').Session | null;
|
2023-05-29 06:34:39 +00:00
|
|
|
startTimer: number;
|
2024-01-19 00:57:15 +00:00
|
|
|
ip: string;
|
|
|
|
|
country: string;
|
2023-05-29 06:34:39 +00:00
|
|
|
error: string;
|
|
|
|
|
errorId: string;
|
|
|
|
|
errorStackTrace: string;
|
|
|
|
|
message: unknown;
|
|
|
|
|
track: unknown;
|
|
|
|
|
}
|
|
|
|
|
interface Error {
|
|
|
|
|
code?: string;
|
|
|
|
|
errorId?: string;
|
2023-05-21 05:18:04 +00:00
|
|
|
}
|
2022-09-29 22:22:01 +00:00
|
|
|
}
|
2023-11-05 06:20:34 +00:00
|
|
|
|
|
|
|
|
interface Document {
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
|
|
startViewTransition: (callback: any) => void; // Add your custom property/method here
|
|
|
|
|
}
|
2023-05-21 05:18:04 +00:00
|
|
|
}
|
2022-09-29 22:22:01 +00:00
|
|
|
|
2023-05-21 05:18:04 +00:00
|
|
|
// THIS IS IMPORTANT!!!
|
|
|
|
|
export {};
|