boredgame/src/app.d.ts

48 lines
1.2 KiB
TypeScript
Raw Normal View History

import type { ApiClient } from '$lib/server/api';
import type { parseApiResponse } from '$lib/utils/api';
import type { User } from 'lucia';
2024-07-21 19:05:48 +00:00
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
// and what to do when importing types
2023-05-21 05:18:04 +00:00
// src/app.d.ts
declare global {
namespace App {
interface PageData {
flash?: {
type: 'success' | 'error' | 'info';
message: string;
data?: Record<string, unknown>;
};
}
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>>;
}
namespace Superforms {
type Message = {
type: 'error' | 'success' | 'info';
text: string;
};
}
interface Error {
code?: string;
errorId?: string;
2023-05-21 05:18:04 +00:00
}
2022-09-29 22:22:01 +00:00
}
interface Document {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
startViewTransition: (callback: never) => 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!!!
// biome-ignore lint/complexity/noUselessEmptyExport: <explanation>
// biome-ignore lint/style/useExportType: <explanation>
2023-05-21 05:18:04 +00:00
export {};