import * as PropTypes from "prop-types";
var MorePropTypes = /** @class */ (function () {
    function MorePropTypes() {
    }
    MorePropTypes.makeRequirable = function (propType) {
        propType.isRequired = function (props, propName, componentName) {
            var value = props[propName];
            if (value === null || value === undefined) {
                return new Error("Missing required prop `" + propName + "` in " + componentName + ".");
            }
            return propType(props, propName, componentName);
        };
        return propType;
    };
    MorePropTypes.instanceOfComponent = function (componentClass) {
        return MorePropTypes.makeRequirable(function (props, propName, parentComponentName) {
            var value = props[propName];
            if (!value) {
                return null;
            }
            if (value.type !== componentClass) {
                return new Error("Invalid prop `" + propName + "` supplied to " + parentComponentName + ". " +
                    ("Must be of type " + componentClass + "."));
            }
            return null;
        });
    };
    MorePropTypes.oneOrManyOf = function (propType) {
        return PropTypes.oneOfType([propType, PropTypes.arrayOf(propType)]);
    };
    return MorePropTypes;
}());
export default MorePropTypes;
