server-route-utils.d.ts 1.0 KB

12345678910111213141516171819202122232425262728
  1. import type { Header, Redirect, Rewrite, RouteType } from '../lib/load-custom-routes';
  2. import type { Route } from './router';
  3. import type { BaseNextRequest } from './base-http';
  4. import type { ParsedUrlQuery } from 'querystring';
  5. export declare function getCustomRoute(params: {
  6. rule: Header;
  7. type: RouteType;
  8. restrictedRedirectPaths: string[];
  9. }): Route & Header;
  10. export declare function getCustomRoute(params: {
  11. rule: Rewrite;
  12. type: RouteType;
  13. restrictedRedirectPaths: string[];
  14. }): Route & Rewrite;
  15. export declare function getCustomRoute(params: {
  16. rule: Redirect;
  17. type: RouteType;
  18. restrictedRedirectPaths: string[];
  19. }): Route & Redirect;
  20. export declare const createHeaderRoute: ({ rule, restrictedRedirectPaths, }: {
  21. rule: Header;
  22. restrictedRedirectPaths: string[];
  23. }) => Route;
  24. export declare const stringifyQuery: (req: BaseNextRequest, query: ParsedUrlQuery) => string;
  25. export declare const createRedirectRoute: ({ rule, restrictedRedirectPaths, }: {
  26. rule: Redirect;
  27. restrictedRedirectPaths: string[];
  28. }) => Route;