cloudflare/vinext
Publicmirrored from https://github.com/cloudflare/vinextAvailable
tests/fixtures/app-basic/next-shims.d.ts
36lines · modecode
| 1 | declare module "next/link" { |
| 2 | import type { ComponentType, AnchorHTMLAttributes, ReactNode } from "react"; |
| 3 | interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> { |
| 4 | href: string | { pathname?: string; query?: Record<string, string> }; |
| 5 | as?: string; |
| 6 | replace?: boolean; |
| 7 | prefetch?: boolean; |
| 8 | scroll?: boolean; |
| 9 | children?: ReactNode; |
| 10 | } |
| 11 | const Link: ComponentType<LinkProps>; |
| 12 | export default Link; |
| 13 | } |
| 14 | |
| 15 | declare module "next/navigation" { |
| 16 | export function usePathname(): string; |
| 17 | export function useSearchParams(): URLSearchParams; |
| 18 | export function useParams<T = Record<string, string | string[]>>(): T; |
| 19 | export function useRouter(): { |
| 20 | push(href: string, options?: { scroll?: boolean }): void; |
| 21 | replace(href: string, options?: { scroll?: boolean }): void; |
| 22 | back(): void; |
| 23 | forward(): void; |
| 24 | refresh(): void; |
| 25 | prefetch(href: string): void; |
| 26 | }; |
| 27 | export function redirect(url: string, type?: "replace" | "push"): never; |
| 28 | export function permanentRedirect(url: string): never; |
| 29 | export function notFound(): never; |
| 30 | } |
| 31 | |
| 32 | declare module "next/headers" { |
| 33 | export function headers(): Promise<Headers>; |
| 34 | export function cookies(): Promise<any>; |
| 35 | export function draftMode(): Promise<{ isEnabled: boolean }>; |
| 36 | } |
| 37 | |