The kind read-only property of the FileSystemHandle interface returns the type of entry.
kind
MDN Reference