normalize-locale-path.d.ts 506 B

1234567891011121314
  1. export interface PathLocale {
  2. detectedLocale?: string;
  3. pathname: string;
  4. }
  5. /**
  6. * For a pathname that may include a locale from a list of locales, it
  7. * removes the locale from the pathname returning it alongside with the
  8. * detected locale.
  9. *
  10. * @param pathname A pathname that may include a locale.
  11. * @param locales A list of locales.
  12. * @returns The detected locale and pathname without locale
  13. */
  14. export declare function normalizeLocalePath(pathname: string, locales?: string[]): PathLocale;