import moment from 'moment'; import * as PropTypes from 'prop-types'; declare module 'react-moment-proptypes'; export const momentObj: ReactMomentProptypes.RequireableValidator; export const momentString: ReactMomentProptypes.RequireableValidator; export const momentDurationObj: ReactMomentProptypes.RequireableValidator; /** * Constructs specific to 'react-moment-proptypes' that are not top-level, but need to be exposed. */ export namespace ReactMomentProptypes { /** * A prop-type validator with can be extended with a validation predicate. */ export interface Validator extends PropTypes.Validator { withPredicate(isValidMoment: ValidMomentPredicate): Validator, } /** * A prop-type validator that allows for forcing requirement of the corresponding prop. */ export interface RequireableValidator extends Validator { isRequired: Validator>; } /** * Predicate to determine if the specific Moment is valid according to our desired characteristics * * @param moment The moment being validated * @returns true if the Moment is valid */ type ValidMomentPredicate = (moment: moment.Moment) => boolean; }