import { TYPE_FILE, TYPE_FOLDER } from '../../../constants';
export const fetchCollaborators = async ({
  api,
  itemId,
  itemType
}) => {
  let collabApiInstance;
  if (itemType === TYPE_FILE) {
    collabApiInstance = api.getFileCollaborationsAPI(false);
  } else if (itemType === TYPE_FOLDER) {
    collabApiInstance = api.getFolderCollaborationsAPI(false);
  }
  if (!collabApiInstance) {
    return null;
  }
  return new Promise((resolve, reject) => {
    collabApiInstance.getCollaborations(itemId, resolve, reject);
  });
};
//# sourceMappingURL=fetchCollaborators.js.map