index.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. export type PathTypeFunction = (path: string) => Promise<boolean>;
  2. /**
  3. * Check whether the passed `path` is a file.
  4. *
  5. * @param path - The path to check.
  6. * @returns Whether the `path` is a file.
  7. */
  8. export const isFile: PathTypeFunction;
  9. /**
  10. * Check whether the passed `path` is a directory.
  11. *
  12. * @param path - The path to check.
  13. * @returns Whether the `path` is a directory.
  14. */
  15. export const isDirectory: PathTypeFunction;
  16. /**
  17. * Check whether the passed `path` is a symlink.
  18. *
  19. * @param path - The path to check.
  20. * @returns Whether the `path` is a symlink.
  21. */
  22. export const isSymlink: PathTypeFunction;
  23. export type PathTypeSyncFunction = (path: string) => boolean;
  24. /**
  25. * Synchronously check whether the passed `path` is a file.
  26. *
  27. * @param path - The path to check.
  28. * @returns Whether the `path` is a file.
  29. */
  30. export const isFileSync: PathTypeSyncFunction;
  31. /**
  32. * Synchronously check whether the passed `path` is a directory.
  33. *
  34. * @param path - The path to check.
  35. * @returns Whether the `path` is a directory.
  36. */
  37. export const isDirectorySync: PathTypeSyncFunction;
  38. /**
  39. * Synchronously check whether the passed `path` is a symlink.
  40. *
  41. * @param path - The path to check.
  42. * @returns Whether the `path` is a directory.
  43. */
  44. export const isSymlinkSync: PathTypeSyncFunction;