When calling listFiles the return type of the call is always FileObject | FolderObject regardless of the parameters passed to the listFiles call. This requires some extra type guards to process the response correctly in typescript, because some properties are exclusively present on files or folders.
For example:
// I would expect the type of resources here to be only FolderObject[]
const resources = await imagekit.listFiles({
path: "/",
type: "folder",
});
If I want to map over resources from above I will have to write some superfluous type guards to make sure TS knows we are working with Folders only. Yes, type-casting could be used, but I think this could be improved in the SDK types definitions