response.d.ts 905 B

12345678910111213141516171819202122232425
  1. import type { I18NConfig } from '../../config-shared';
  2. import { NextURL } from '../next-url';
  3. import { NextCookies } from './cookies';
  4. declare const INTERNALS: unique symbol;
  5. export declare class NextResponse extends Response {
  6. [INTERNALS]: {
  7. cookies: NextCookies;
  8. url?: NextURL;
  9. };
  10. constructor(body?: BodyInit | null, init?: ResponseInit);
  11. get cookies(): NextCookies;
  12. static json(body: any, init?: ResponseInit): NextResponse;
  13. static redirect(url: string | NextURL | URL, init?: number | ResponseInit): NextResponse;
  14. static rewrite(destination: string | NextURL | URL, init?: ResponseInit): NextResponse;
  15. static next(init?: ResponseInit): NextResponse;
  16. }
  17. interface ResponseInit extends globalThis.ResponseInit {
  18. nextConfig?: {
  19. basePath?: string;
  20. i18n?: I18NConfig;
  21. trailingSlash?: boolean;
  22. };
  23. url?: string;
  24. }
  25. export {};