next-url.d.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import type { DomainLocale, I18NConfig } from '../config-shared';
  2. interface Options {
  3. base?: string | URL;
  4. headers?: {
  5. [key: string]: string | string[] | undefined;
  6. };
  7. forceLocale?: boolean;
  8. nextConfig?: {
  9. basePath?: string;
  10. i18n?: I18NConfig | null;
  11. trailingSlash?: boolean;
  12. };
  13. }
  14. declare const Internal: unique symbol;
  15. export declare class NextURL {
  16. [Internal]: {
  17. basePath: string;
  18. buildId?: string;
  19. flightSearchParameters?: Record<string, string>;
  20. defaultLocale?: string;
  21. domainLocale?: DomainLocale;
  22. locale?: string;
  23. options: Options;
  24. trailingSlash?: boolean;
  25. url: URL;
  26. };
  27. constructor(input: string | URL, base?: string | URL, opts?: Options);
  28. constructor(input: string | URL, opts?: Options);
  29. private analyzeUrl;
  30. private formatPathname;
  31. private formatSearch;
  32. get buildId(): string | undefined;
  33. set buildId(buildId: string | undefined);
  34. get flightSearchParameters(): Record<string, string> | undefined;
  35. set flightSearchParameters(flightSearchParams: Record<string, string> | undefined);
  36. get locale(): string;
  37. set locale(locale: string);
  38. get defaultLocale(): string | undefined;
  39. get domainLocale(): DomainLocale | undefined;
  40. get searchParams(): URLSearchParams;
  41. get host(): string;
  42. set host(value: string);
  43. get hostname(): string;
  44. set hostname(value: string);
  45. get port(): string;
  46. set port(value: string);
  47. get protocol(): string;
  48. set protocol(value: string);
  49. get href(): string;
  50. set href(url: string);
  51. get origin(): string;
  52. get pathname(): string;
  53. set pathname(value: string);
  54. get hash(): string;
  55. set hash(value: string);
  56. get search(): string;
  57. set search(value: string);
  58. get password(): string;
  59. set password(value: string);
  60. get username(): string;
  61. set username(value: string);
  62. get basePath(): string;
  63. set basePath(value: string);
  64. toString(): string;
  65. toJSON(): string;
  66. clone(): NextURL;
  67. }
  68. export {};