utils.d.ts 830 B

1234567891011121314151617
  1. import { Route } from 'vitepress';
  2. export declare const hashRE: RegExp;
  3. export declare const extRE: RegExp;
  4. export declare const endingSlashRE: RegExp;
  5. export declare const outboundRE: RegExp;
  6. export declare function withBase(path: string): string;
  7. export declare function isExternal(path: string): boolean;
  8. export declare function isActive(route: Route, path?: string): boolean;
  9. export declare function normalize(path: string): string;
  10. export declare function joinUrl(base: string, path: string): string;
  11. /**
  12. * get the path without filename (the last segment). for example, if the given
  13. * path is `/guide/getting-started.html`, this method will return `/guide/`.
  14. * Always with a trailing slash.
  15. */
  16. export declare function getPathDirName(path: string): string;
  17. export declare function ensureEndingSlash(path: string): string;