chore: add consistent type imports

This commit is contained in:
Christian Andolf
2024-12-09 14:36:56 +01:00
parent 9867a56cc8
commit e08e960209
172 changed files with 587 additions and 333 deletions

View File

@@ -1,4 +1,4 @@
import { NextRequest, NextResponse } from "next/server"
import { type NextRequest, NextResponse } from "next/server"
import { AuthError } from "next-auth"
import { Lang } from "@/constants/languages"

View File

@@ -4,7 +4,7 @@ import Breadcrumbs from "@/components/Breadcrumbs"
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function AllBreadcrumbs({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -6,7 +6,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function CommunicationSlot({
params,

View File

@@ -9,7 +9,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function CreditCardSlot({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -9,7 +9,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function MembershipCardSlot({
params,

View File

@@ -3,7 +3,7 @@ import { getProfile } from "@/lib/trpc/memoizedRequests"
import Form from "@/components/Forms/Edit/Profile"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function EditProfileSlot({
params,

View File

@@ -20,7 +20,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function Profile({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -5,7 +5,7 @@ import { serverClient } from "@/lib/trpc/server"
import TrackingSDK from "@/components/TrackingSDK"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export { generateMetadata } from "@/utils/generateMetadata"

View File

@@ -4,7 +4,7 @@ import Breadcrumbs from "@/components/Breadcrumbs"
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function PageBreadcrumbs({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -2,7 +2,7 @@ import { setPreviewData } from "@/lib/previewContext"
import InitLivePreview from "@/components/LivePreview"
import { PageArgs, UIDParams } from "@/types/params"
import type { PageArgs, UIDParams } from "@/types/params"
export default function PreviewPage({
searchParams,

View File

@@ -1,6 +1,6 @@
import styles from "./layout.module.css"
import {
import type {
ContentTypeParams,
LangParams,
LayoutArgs,

View File

@@ -11,7 +11,7 @@ import CollectionPage from "@/components/ContentType/StaticPages/CollectionPage"
import ContentPage from "@/components/ContentType/StaticPages/ContentPage"
import { setLang } from "@/i18n/serverContext"
import {
import type {
ContentTypeParams,
LangParams,
PageArgs,

View File

@@ -1,6 +1,6 @@
import styles from "./layout.module.css"
import { LangParams, LayoutArgs } from "@/types/params"
import type { LangParams, LayoutArgs } from "@/types/params"
export default function PaymentCallbackLayout({
children,

View File

@@ -12,7 +12,7 @@ import { serverClient } from "@/lib/trpc/server"
import PaymentCallback from "@/components/HotelReservation/EnterDetails/Payment/PaymentCallback"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function PaymentCallbackPage({
params,

View File

@@ -1,6 +1,6 @@
import styles from "./layout.module.css"
import { LangParams, LayoutArgs } from "@/types/params"
import type { LangParams, LayoutArgs } from "@/types/params"
export default function HotelReservationLayout({
children,

View File

@@ -1,6 +1,6 @@
import styles from "./layout.module.css"
import { LangParams, LayoutArgs } from "@/types/params"
import type { LangParams, LayoutArgs } from "@/types/params"
export default function HotelReservationLayout({
children,

View File

@@ -1,7 +1,7 @@
import { Dayjs } from "dayjs"
import { dt } from "@/lib/dt"
import type { Dayjs } from "dayjs"
/**
* Get valid dates from stringFromDate and stringToDate making sure that they are not in the past and chronologically correct
* @example const { fromDate, toDate} = getValidDates("2021-01-01", "2021-01-02")

View File

@@ -29,7 +29,7 @@ import EnterDetailsProvider from "@/providers/EnterDetailsProvider"
import styles from "./page.module.css"
import { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
import { StepEnum } from "@/types/enums/step"
import type { LangParams, PageArgs } from "@/types/params"

View File

@@ -1,4 +1,4 @@
import { NextRequest, NextResponse } from "next/server"
import { type NextRequest, NextResponse } from "next/server"
import { AuthError } from "next-auth"
import { Lang } from "@/constants/languages"

View File

@@ -1,14 +1,13 @@
import { NextRequest, NextResponse } from "next/server"
import { type NextRequest, NextResponse } from "next/server"
import { AuthError } from "next-auth"
import { Lang } from "@/constants/languages"
import { login } from "@/constants/routes/handleAuth"
import { env } from "@/env/server"
import { badRequest, internalServerError } from "@/server/errors/next"
import { getPublicURL } from "@/server/utils"
import { signIn } from "@/auth"
import type { Lang } from "@/constants/languages"
export async function GET(
request: NextRequest,
context: { params: { lang: Lang } }

View File

@@ -2,7 +2,7 @@ import { env } from "@/env/server"
import BookingWidget, { preload } from "@/components/BookingWidget"
import { PageArgs } from "@/types/params"
import type { PageArgs } from "@/types/params"
export default async function BookingWidgetPage({
searchParams,

View File

@@ -3,7 +3,7 @@ import { serverClient } from "@/lib/trpc/server"
import BookingWidget, { preload } from "@/components/BookingWidget"
import { PageArgs } from "@/types/params"
import type { PageArgs } from "@/types/params"
export default async function BookingWidgetPage({
searchParams,

View File

@@ -4,7 +4,7 @@ import CurrentFooter from "@/components/Current/Footer"
import Footer, { preload } from "@/components/Footer"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function FooterSlot({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -7,7 +7,7 @@ import HeaderFallback from "@/components/Current/Header/HeaderFallback"
import Header from "@/components/Header"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function HeaderPage({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -16,7 +16,7 @@ import { findLang } from "@/utils/languages"
import styles from "./error.module.css"
import { LangParams } from "@/types/params"
import type { LangParams } from "@/types/params"
export default function Error({
error,

View File

@@ -1,7 +1,7 @@
import NotFound from "@/components/Current/NotFound"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function NotFoundPage({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -2,7 +2,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, LayoutArgs, StatusParams } from "@/types/params"
import type { LangParams, LayoutArgs, StatusParams } from "@/types/params"
export default function MiddlewareError({
params,

View File

@@ -1,7 +1,7 @@
import Header from "@/components/Current/Header"
import { setLang } from "@/i18n/serverContext"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function HeaderPage({ params }: PageArgs<LangParams>) {
setLang(params.lang)

View File

@@ -7,7 +7,7 @@ import AccountPage from "@/components/Webviews/AccountPage"
import LoyaltyPage from "@/components/Webviews/LoyaltyPage"
import { setLang } from "@/i18n/serverContext"
import {
import type {
ContentTypeWebviewParams,
LangParams,
PageArgs,

View File

@@ -3,7 +3,7 @@ import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default function Refresh({ params }: PageArgs<LangParams>) {
setLang(params.lang)