import PropTypes from 'prop-types';
import { SoftObserver } from '../SoftObserver';
class SoftMutationObserver extends SoftObserver {
    constructor(...args) {
        super(...args);
        // @ts-ignore
        this.beginObserve = () => {
            // @ts-ignore
            this.observer = new MutationObserver(this.props.onMutation);
            // @ts-ignore
            this.observer.observe(this.childNode, this.props.observerOptions);
        };
        this.name = 'SoftMutationObserver';
    }
}
SoftMutationObserver.propTypes = {
    children: PropTypes.func.isRequired,
    observerOptions: PropTypes.shape({
        attributeFilter: PropTypes.arrayOf(PropTypes.string),
        attributeOldValue: PropTypes.bool,
        attributes: PropTypes.bool,
        characterData: PropTypes.bool,
        characterDataOldValue: PropTypes.bool,
        childList: PropTypes.bool,
        subtree: PropTypes.bool,
    }).isRequired,
    onMutation: PropTypes.func.isRequired,
};
export { SoftMutationObserver };
//# sourceMappingURL=SoftMutationObserver.js.map