index.d.cts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import * as path from 'node:path';
  2. import path__default from 'node:path';
  3. /**
  4. * Constant for path separator.
  5. *
  6. * Always equals to `"/"`.
  7. */
  8. declare const sep = "/";
  9. declare const normalize: typeof path__default.normalize;
  10. declare const join: typeof path__default.join;
  11. declare const resolve: typeof path__default.resolve;
  12. /**
  13. * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
  14. *
  15. * @param path - The path to normalise.
  16. * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
  17. * @returns the normalised path string.
  18. */
  19. declare function normalizeString(path: string, allowAboveRoot: boolean): string;
  20. declare const isAbsolute: typeof path__default.isAbsolute;
  21. declare const toNamespacedPath: typeof path__default.toNamespacedPath;
  22. declare const extname: typeof path__default.extname;
  23. declare const relative: typeof path__default.relative;
  24. declare const dirname: typeof path__default.dirname;
  25. declare const format: typeof path__default.format;
  26. declare const basename: typeof path__default.basename;
  27. declare const parse: typeof path__default.parse;
  28. /**
  29. * The `path.matchesGlob()` method determines if `path` matches the `pattern`.
  30. * @param path The path to glob-match against.
  31. * @param pattern The glob to check the path against.
  32. */
  33. declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
  34. type NodePath = typeof path;
  35. /**
  36. * The platform-specific file delimiter.
  37. *
  38. * Equals to `";"` in windows and `":"` in all other platforms.
  39. */
  40. declare const delimiter: ";" | ":";
  41. declare const posix: NodePath["posix"];
  42. declare const win32: NodePath["win32"];
  43. declare const _default: NodePath;
  44. export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };