import PropTypes from 'prop-types';
import VideoPlayerPropTypes from '../video-player/prop-types';
export const TYPE_IMAGE = 'img';
export const TYPE_VIDEO = 'video';
export const TYPE_AUDIO = 'audio';
const isType = name => PropTypes.oneOf([name]);
const videoPropType = PropTypes.shape({
  ...VideoPlayerPropTypes,
  type: isType(TYPE_VIDEO).isRequired
});
const imgPropType = PropTypes.shape({
  type: isType(TYPE_IMAGE).isRequired,
  url: PropTypes.string.isRequired
});
const audioPropType = PropTypes.shape({
  type: isType(TYPE_AUDIO).isRequired,
  mediaUrl: PropTypes.string.isRequired
});
export const MediaViewPropTypes = {
  media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])
};
const SelectOptionsPropTypes = PropTypes.shape({
  name: PropTypes.string,
  selected: PropTypes.bool,
  validOption: PropTypes.bool,
  value: PropTypes.string
});
const AnswerPropTypes = PropTypes.shape({
  title: PropTypes.string.isRequired,
  'aria-label': PropTypes.string,
  onClick: PropTypes.func,
  onChange: PropTypes.func,
  selected: PropTypes.bool,
  image: PropTypes.string,
  options: PropTypes.arrayOf(SelectOptionsPropTypes),
  type: PropTypes.oneOf(['text', 'select']),
  name: PropTypes.string
});
const propTypes = {
  model: PropTypes.shape({
    type: PropTypes.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired,
    answer: PropTypes.arrayOf(AnswerPropTypes)
  }).isRequired,
  help: PropTypes.string,
  question: PropTypes.string,
  media: MediaViewPropTypes.media
};
export default propTypes;
//# sourceMappingURL=prop-types.js.map