index.d.ts 1.2 KB

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