// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // This file will be automatically regenerated when your Next.js server is running. // nextjs-routes version: 2.0.1 /* eslint-disable */ // prettier-ignore declare module "nextjs-routes" { import type { GetServerSidePropsContext as NextGetServerSidePropsContext, GetServerSidePropsResult as NextGetServerSidePropsResult } from "next"; export type Route = | DynamicRoute<"/api/auth/[...nextauth]", { "nextauth": string[] }> | DynamicRoute<"/api/trpc/[trpc]", { "trpc": string }> | DynamicRoute<"/experiments/[id]", { "id": string }> | StaticRoute<"/">; interface StaticRoute { pathname: Pathname; query?: Query | undefined; hash?: string | null | undefined; } interface DynamicRoute { pathname: Pathname; query: Parameters & Query; hash?: string | null | undefined; } interface Query { [key: string]: string | string[] | undefined; }; export type RoutedQuery

= Extract< Route, { pathname: P } >["query"]; export type Locale = | "en"; /** * A typesafe utility function for generating paths in your application. * * route({ pathname: "/foos/[foo]", query: { foo: "bar" }}) will produce "/foos/bar". */ export declare function route(r: Route): string; /** * Nearly identical to GetServerSidePropsContext from next, but further narrows * types based on nextjs-route's route data. */ export type GetServerSidePropsContext< Pathname extends Route["pathname"] = Route["pathname"], Preview extends NextGetServerSidePropsContext["previewData"] = NextGetServerSidePropsContext["previewData"] > = Omit & { params: Extract["query"]; query: Query; defaultLocale: "en"; locale: Locale; locales: [ "en" ]; }; /** * Nearly identical to GetServerSideProps from next, but further narrows * types based on nextjs-route's route data. */ export type GetServerSideProps< Props extends { [key: string]: any } = { [key: string]: any }, Pathname extends Route["pathname"] = Route["pathname"], Preview extends NextGetServerSideProps["previewData"] = NextGetServerSideProps["previewData"] > = ( context: GetServerSidePropsContext ) => Promise> } // prettier-ignore declare module "next/link" { import type { Route } from "nextjs-routes"; import type { LinkProps as NextLinkProps } from "next/dist/client/link"; import type { AnchorHTMLAttributes, DetailedReactHTMLElement, MouseEventHandler, PropsWithChildren, } from "react"; export * from "next/dist/client/link"; type StaticRoute = Exclude["pathname"]; export interface LinkProps extends Omit, AnchorHTMLAttributes { href: Route | StaticRoute | Omit locale?: Locale | false; } type LinkReactElement = DetailedReactHTMLElement< { onMouseEnter?: MouseEventHandler | undefined; onClick: MouseEventHandler; href?: string | undefined; ref?: any; }, HTMLElement >; declare function Link(props: PropsWithChildren): LinkReactElement; export default Link; } // prettier-ignore declare module "next/router" { import type { Locale, Route, RoutedQuery } from "nextjs-routes"; import type { NextRouter as Router } from "next/dist/client/router"; export * from "next/dist/client/router"; export { default } from "next/dist/client/router"; type NextTransitionOptions = NonNullable[2]>; type StaticRoute = Exclude["pathname"]; interface TransitionOptions extends Omit { locale?: Locale | false; } type PathnameAndQuery = Required< Pick, "pathname" | "query"> >; type AutomaticStaticOptimizedQuery = Omit & { query: Partial; }; type BaseRouter = | ({ isReady: false } & AutomaticStaticOptimizedQuery) | ({ isReady: true } & PaQ); export type NextRouter

= BaseRouter> & Omit< Router, | "defaultLocale" | "domainLocales" | "isReady" | "locale" | "locales" | "pathname" | "push" | "query" | "replace" | "route" > & { defaultLocale: "en"; domainLocales?: undefined; locale: Locale; locales: [ "en" ]; push( url: Route | StaticRoute | Omit, as?: string, options?: TransitionOptions ): Promise; replace( url: Route | StaticRoute | Omit, as?: string, options?: TransitionOptions ): Promise; route: P; }; export function useRouter

(): NextRouter

; }