eny.space Landingpage
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(types): remove unused route and validator type definitions

Sam Sauer d3095ca3 10bde2d8

-242
-82
types/routes.d.ts
··· 1 - // This file is generated automatically by Next.js 2 - // Do not edit this file manually 3 - 4 - type AppRoutes = "/" | "/donate-with-checkout" | "/donate-with-checkout/result" | "/donate-with-elements" | "/donate-with-elements/result" | "/donate-with-embedded-checkout" | "/donate-with-embedded-checkout/result" 5 - type AppRouteHandlerRoutes = "/api/webhooks" 6 - type PageRoutes = never 7 - type LayoutRoutes = "/" | "/donate-with-checkout/result" | "/donate-with-elements/result" | "/donate-with-embedded-checkout/result" 8 - type RedirectRoutes = never 9 - type RewriteRoutes = never 10 - type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes | AppRouteHandlerRoutes 11 - 12 - 13 - interface ParamMap { 14 - "/": {} 15 - "/api/webhooks": {} 16 - "/donate-with-checkout": {} 17 - "/donate-with-checkout/result": {} 18 - "/donate-with-elements": {} 19 - "/donate-with-elements/result": {} 20 - "/donate-with-embedded-checkout": {} 21 - "/donate-with-embedded-checkout/result": {} 22 - } 23 - 24 - 25 - export type ParamsOf<Route extends Routes> = ParamMap[Route] 26 - 27 - interface LayoutSlotMap { 28 - "/": never 29 - "/donate-with-checkout/result": never 30 - "/donate-with-elements/result": never 31 - "/donate-with-embedded-checkout/result": never 32 - } 33 - 34 - 35 - export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap, AppRouteHandlerRoutes } 36 - 37 - declare global { 38 - /** 39 - * Props for Next.js App Router page components 40 - * @example 41 - * ```tsx 42 - * export default function Page(props: PageProps<'/blog/[slug]'>) { 43 - * const { slug } = await props.params 44 - * return <div>Blog post: {slug}</div> 45 - * } 46 - * ``` 47 - */ 48 - interface PageProps<AppRoute extends AppRoutes> { 49 - params: Promise<ParamMap[AppRoute]> 50 - searchParams: Promise<Record<string, string | string[] | undefined>> 51 - } 52 - 53 - /** 54 - * Props for Next.js App Router layout components 55 - * @example 56 - * ```tsx 57 - * export default function Layout(props: LayoutProps<'/dashboard'>) { 58 - * return <div>{props.children}</div> 59 - * } 60 - * ``` 61 - */ 62 - type LayoutProps<LayoutRoute extends LayoutRoutes> = { 63 - params: Promise<ParamMap[LayoutRoute]> 64 - children: React.ReactNode 65 - } & { 66 - [K in LayoutSlotMap[LayoutRoute]]: React.ReactNode 67 - } 68 - 69 - /** 70 - * Context for Next.js App Router route handlers 71 - * @example 72 - * ```tsx 73 - * export async function GET(request: NextRequest, context: RouteContext<'/api/users/[id]'>) { 74 - * const { id } = await context.params 75 - * return Response.json({ id }) 76 - * } 77 - * ``` 78 - */ 79 - interface RouteContext<AppRouteHandlerRoute extends AppRouteHandlerRoutes> { 80 - params: Promise<ParamMap[AppRouteHandlerRoute]> 81 - } 82 - }
-160
types/validator.ts
··· 1 - // This file is generated automatically by Next.js 2 - // Do not edit this file manually 3 - // This file validates that all pages and layouts export the correct types 4 - 5 - import type { AppRoutes, LayoutRoutes, ParamMap, AppRouteHandlerRoutes } from "./routes.js" 6 - import type { ResolvingMetadata, ResolvingViewport } from "next/types.js" 7 - import type { NextRequest } from 'next/server.js' 8 - 9 - type AppPageConfig<Route extends AppRoutes = AppRoutes> = { 10 - default: React.ComponentType<{ params: Promise<ParamMap[Route]> } & any> | ((props: { params: Promise<ParamMap[Route]> } & any) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>) 11 - generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[] 12 - generateMetadata?: ( 13 - props: { params: Promise<ParamMap[Route]> } & any, 14 - parent: ResolvingMetadata 15 - ) => Promise<any> | any 16 - generateViewport?: ( 17 - props: { params: Promise<ParamMap[Route]> } & any, 18 - parent: ResolvingViewport 19 - ) => Promise<any> | any 20 - metadata?: any 21 - viewport?: any 22 - } 23 - 24 - type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = { 25 - default: React.ComponentType<LayoutProps<Route>> | ((props: LayoutProps<Route>) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>) 26 - generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[] 27 - generateMetadata?: ( 28 - props: { params: Promise<ParamMap[Route]> } & any, 29 - parent: ResolvingMetadata 30 - ) => Promise<any> | any 31 - generateViewport?: ( 32 - props: { params: Promise<ParamMap[Route]> } & any, 33 - parent: ResolvingViewport 34 - ) => Promise<any> | any 35 - metadata?: any 36 - viewport?: any 37 - } 38 - 39 - type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRoutes> = { 40 - GET?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 41 - POST?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 42 - PUT?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 43 - PATCH?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 44 - DELETE?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 45 - HEAD?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 46 - OPTIONS?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void 47 - } 48 - 49 - 50 - // Validate ../../app/donate-with-checkout/page.tsx 51 - { 52 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-checkout">> = Specific 53 - const handler = {} as typeof import("../../app/donate-with-checkout/page.js") 54 - type __Check = __IsExpected<typeof handler> 55 - // @ts-ignore 56 - type __Unused = __Check 57 - } 58 - 59 - // Validate ../../app/donate-with-checkout/result/page.tsx 60 - { 61 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-checkout/result">> = Specific 62 - const handler = {} as typeof import("../../app/donate-with-checkout/result/page.js") 63 - type __Check = __IsExpected<typeof handler> 64 - // @ts-ignore 65 - type __Unused = __Check 66 - } 67 - 68 - // Validate ../../app/donate-with-elements/page.tsx 69 - { 70 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-elements">> = Specific 71 - const handler = {} as typeof import("../../app/donate-with-elements/page.js") 72 - type __Check = __IsExpected<typeof handler> 73 - // @ts-ignore 74 - type __Unused = __Check 75 - } 76 - 77 - // Validate ../../app/donate-with-elements/result/page.tsx 78 - { 79 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-elements/result">> = Specific 80 - const handler = {} as typeof import("../../app/donate-with-elements/result/page.js") 81 - type __Check = __IsExpected<typeof handler> 82 - // @ts-ignore 83 - type __Unused = __Check 84 - } 85 - 86 - // Validate ../../app/donate-with-embedded-checkout/page.tsx 87 - { 88 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-embedded-checkout">> = Specific 89 - const handler = {} as typeof import("../../app/donate-with-embedded-checkout/page.js") 90 - type __Check = __IsExpected<typeof handler> 91 - // @ts-ignore 92 - type __Unused = __Check 93 - } 94 - 95 - // Validate ../../app/donate-with-embedded-checkout/result/page.tsx 96 - { 97 - type __IsExpected<Specific extends AppPageConfig<"/donate-with-embedded-checkout/result">> = Specific 98 - const handler = {} as typeof import("../../app/donate-with-embedded-checkout/result/page.js") 99 - type __Check = __IsExpected<typeof handler> 100 - // @ts-ignore 101 - type __Unused = __Check 102 - } 103 - 104 - // Validate ../../app/page.tsx 105 - { 106 - type __IsExpected<Specific extends AppPageConfig<"/">> = Specific 107 - const handler = {} as typeof import("../../app/page.js") 108 - type __Check = __IsExpected<typeof handler> 109 - // @ts-ignore 110 - type __Unused = __Check 111 - } 112 - 113 - // Validate ../../app/api/webhooks/route.ts 114 - { 115 - type __IsExpected<Specific extends RouteHandlerConfig<"/api/webhooks">> = Specific 116 - const handler = {} as typeof import("../../app/api/webhooks/route.js") 117 - type __Check = __IsExpected<typeof handler> 118 - // @ts-ignore 119 - type __Unused = __Check 120 - } 121 - 122 - 123 - 124 - 125 - 126 - // Validate ../../app/donate-with-checkout/result/layout.tsx 127 - { 128 - type __IsExpected<Specific extends LayoutConfig<"/donate-with-checkout/result">> = Specific 129 - const handler = {} as typeof import("../../app/donate-with-checkout/result/layout.js") 130 - type __Check = __IsExpected<typeof handler> 131 - // @ts-ignore 132 - type __Unused = __Check 133 - } 134 - 135 - // Validate ../../app/donate-with-elements/result/layout.tsx 136 - { 137 - type __IsExpected<Specific extends LayoutConfig<"/donate-with-elements/result">> = Specific 138 - const handler = {} as typeof import("../../app/donate-with-elements/result/layout.js") 139 - type __Check = __IsExpected<typeof handler> 140 - // @ts-ignore 141 - type __Unused = __Check 142 - } 143 - 144 - // Validate ../../app/donate-with-embedded-checkout/result/layout.tsx 145 - { 146 - type __IsExpected<Specific extends LayoutConfig<"/donate-with-embedded-checkout/result">> = Specific 147 - const handler = {} as typeof import("../../app/donate-with-embedded-checkout/result/layout.js") 148 - type __Check = __IsExpected<typeof handler> 149 - // @ts-ignore 150 - type __Unused = __Check 151 - } 152 - 153 - // Validate ../../app/layout.tsx 154 - { 155 - type __IsExpected<Specific extends LayoutConfig<"/">> = Specific 156 - const handler = {} as typeof import("../../app/layout.js") 157 - type __Check = __IsExpected<typeof handler> 158 - // @ts-ignore 159 - type __Unused = __Check 160 - }