101 lines
3.5 KiB
TypeScript
101 lines
3.5 KiB
TypeScript
// This file is generated automatically by Next.js
|
|
// Do not edit this file manually
|
|
|
|
type AppRoutes = "/" | "/auth/register" | "/auth/signin" | "/help" | "/members" | "/members/[id]" | "/members/new" | "/relationship" | "/settings" | "/timeline" | "/tree" | "/trees/new"
|
|
type AppRouteHandlerRoutes = "/api/auth/[...nextauth]" | "/api/auth/register" | "/api/trees" | "/api/trees/[treeId]" | "/api/trees/[treeId]/activity-logs" | "/api/trees/[treeId]/collaborators" | "/api/trees/[treeId]/import" | "/api/trees/[treeId]/invite" | "/api/trees/[treeId]/members" | "/api/trees/[treeId]/members/[memberId]" | "/api/trees/[treeId]/members/[memberId]/history" | "/api/trees/[treeId]/relationship" | "/api/upload" | "/api/user/activity-logs" | "/api/user/change-password" | "/api/user/profile" | "/uploads/[filename]"
|
|
type PageRoutes = never
|
|
type LayoutRoutes = "/"
|
|
type RedirectRoutes = never
|
|
type RewriteRoutes = never
|
|
type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes | AppRouteHandlerRoutes
|
|
|
|
|
|
interface ParamMap {
|
|
"/": {}
|
|
"/api/auth/[...nextauth]": { "nextauth": string[]; }
|
|
"/api/auth/register": {}
|
|
"/api/trees": {}
|
|
"/api/trees/[treeId]": { "treeId": string; }
|
|
"/api/trees/[treeId]/activity-logs": { "treeId": string; }
|
|
"/api/trees/[treeId]/collaborators": { "treeId": string; }
|
|
"/api/trees/[treeId]/import": { "treeId": string; }
|
|
"/api/trees/[treeId]/invite": { "treeId": string; }
|
|
"/api/trees/[treeId]/members": { "treeId": string; }
|
|
"/api/trees/[treeId]/members/[memberId]": { "treeId": string; "memberId": string; }
|
|
"/api/trees/[treeId]/members/[memberId]/history": { "treeId": string; "memberId": string; }
|
|
"/api/trees/[treeId]/relationship": { "treeId": string; }
|
|
"/api/upload": {}
|
|
"/api/user/activity-logs": {}
|
|
"/api/user/change-password": {}
|
|
"/api/user/profile": {}
|
|
"/auth/register": {}
|
|
"/auth/signin": {}
|
|
"/help": {}
|
|
"/members": {}
|
|
"/members/[id]": { "id": string; }
|
|
"/members/new": {}
|
|
"/relationship": {}
|
|
"/settings": {}
|
|
"/timeline": {}
|
|
"/tree": {}
|
|
"/trees/new": {}
|
|
"/uploads/[filename]": { "filename": string; }
|
|
}
|
|
|
|
|
|
export type ParamsOf<Route extends Routes> = ParamMap[Route]
|
|
|
|
interface LayoutSlotMap {
|
|
"/": never
|
|
}
|
|
|
|
|
|
export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap, AppRouteHandlerRoutes }
|
|
|
|
declare global {
|
|
/**
|
|
* Props for Next.js App Router page components
|
|
* @example
|
|
* ```tsx
|
|
* export default function Page(props: PageProps<'/blog/[slug]'>) {
|
|
* const { slug } = await props.params
|
|
* return <div>Blog post: {slug}</div>
|
|
* }
|
|
* ```
|
|
*/
|
|
interface PageProps<AppRoute extends AppRoutes> {
|
|
params: Promise<ParamMap[AppRoute]>
|
|
searchParams: Promise<Record<string, string | string[] | undefined>>
|
|
}
|
|
|
|
/**
|
|
* Props for Next.js App Router layout components
|
|
* @example
|
|
* ```tsx
|
|
* export default function Layout(props: LayoutProps<'/dashboard'>) {
|
|
* return <div>{props.children}</div>
|
|
* }
|
|
* ```
|
|
*/
|
|
type LayoutProps<LayoutRoute extends LayoutRoutes> = {
|
|
params: Promise<ParamMap[LayoutRoute]>
|
|
children: React.ReactNode
|
|
} & {
|
|
[K in LayoutSlotMap[LayoutRoute]]: React.ReactNode
|
|
}
|
|
|
|
/**
|
|
* Context for Next.js App Router route handlers
|
|
* @example
|
|
* ```tsx
|
|
* export async function GET(request: NextRequest, context: RouteContext<'/api/users/[id]'>) {
|
|
* const { id } = await context.params
|
|
* return Response.json({ id })
|
|
* }
|
|
* ```
|
|
*/
|
|
interface RouteContext<AppRouteHandlerRoute extends AppRouteHandlerRoutes> {
|
|
params: Promise<ParamMap[AppRouteHandlerRoute]>
|
|
}
|
|
}
|