From 4430dc0293f725c41c7aa6ac3e585d5951bb0e23 Mon Sep 17 00:00:00 2001 From: unurled Date: Mon, 7 Jul 2025 18:40:26 +0000 Subject: [PATCH] switch to types.ts file --- src/app.d.ts | 23 ------------------- src/lib/components/app-layout.svelte | 2 +- src/lib/components/nav.svelte | 2 +- src/lib/components/rounds/create-round.svelte | 2 +- src/lib/components/rounds/create-schema.ts | 1 + src/routes/+page.svelte | 2 +- src/types.ts | 22 ++++++++++++++++++ 7 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 src/types.ts diff --git a/src/app.d.ts b/src/app.d.ts index 651c570..e3dda87 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -15,26 +15,3 @@ declare global { // interface Platform {} export {}; - -export interface BreadcrumbItem { - title: string; - href: string; -} - -export type BreadcrumbItemType = BreadcrumbItem; - -export interface NavItem { - title: string; - href: string; - icon?: any; - isActive?: boolean; - requireAdmin?: boolean; -} - -export enum SchedulingMode { - single = 'signle', - double = 'double', - swiss = 'swiss', - round_robin = 'round_robin', - double_round_robin = 'double_round_robin' -} diff --git a/src/lib/components/app-layout.svelte b/src/lib/components/app-layout.svelte index acacb84..f8c6b54 100644 --- a/src/lib/components/app-layout.svelte +++ b/src/lib/components/app-layout.svelte @@ -5,7 +5,7 @@ BreadcrumbList, BreadcrumbSeparator } from '$lib/components/ui/breadcrumb'; - import type { BreadcrumbItem as BreadcrumbItemType } from '../../app'; + import type { BreadcrumbItem as BreadcrumbItemType } from '@/types'; import { cn } from '$lib/utils'; import { getContext } from 'svelte'; import Nav from '$lib/components/nav.svelte'; diff --git a/src/lib/components/nav.svelte b/src/lib/components/nav.svelte index 359dd7f..628dddb 100644 --- a/src/lib/components/nav.svelte +++ b/src/lib/components/nav.svelte @@ -2,7 +2,7 @@ import { getContext } from 'svelte'; import { cn } from '$lib/utils'; import { Button } from '$lib/components/ui/button'; - import type { NavItem } from '../../app'; + import type { NavItem } from '@/types'; import { Home, Trophy, Calendar, UserCircle, Settings } from 'lucide-svelte'; import type { User } from '$lib/server/db/schema/users'; import { type Role } from '$lib/server/db/schema/roles'; diff --git a/src/lib/components/rounds/create-round.svelte b/src/lib/components/rounds/create-round.svelte index 2e9b5f9..3069ea9 100644 --- a/src/lib/components/rounds/create-round.svelte +++ b/src/lib/components/rounds/create-round.svelte @@ -9,7 +9,7 @@ import { zodClient } from 'sveltekit-superforms/adapters'; import RadioGroup from '../ui/radio-group/radio-group.svelte'; import RadioGroupItem from '../ui/radio-group/radio-group-item.svelte'; - import { SchedulingMode } from '@/app'; + import { SchedulingMode } from '@/types'; let { data }: { data: { form: SuperValidated> } } = $props(); diff --git a/src/lib/components/rounds/create-schema.ts b/src/lib/components/rounds/create-schema.ts index 89b1b97..d76c88b 100644 --- a/src/lib/components/rounds/create-schema.ts +++ b/src/lib/components/rounds/create-schema.ts @@ -1,3 +1,4 @@ +import { SchedulingMode } from '@/types'; import z from 'zod'; export const formSchema = z.object({ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 896d7ad..b3f55da 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -12,7 +12,7 @@ } from '$lib/components/ui/card'; import { Badge } from '$lib/components/ui/badge'; import { Calendar, Users, MapPin } from 'lucide-svelte'; - import type { BreadcrumbItem } from '../app'; + import type { BreadcrumbItem } from '@/types'; import { Skeleton } from '$lib/components/ui/skeleton'; import type { PageProps } from './$types.js'; import { toast } from 'svelte-sonner'; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..c79f477 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,22 @@ +export interface BreadcrumbItem { + title: string; + href: string; +} + +export type BreadcrumbItemType = BreadcrumbItem; + +export interface NavItem { + title: string; + href: string; + icon?: any; + isActive?: boolean; + requireAdmin?: boolean; +} + +export enum SchedulingMode { + single = 'signle', + double = 'double', + swiss = 'swiss', + round_robin = 'round_robin', + double_round_robin = 'double_round_robin' +}