/**
 * @since Last modified: 2024-08-13 20:16:45
 * @function elProps
 * @description Operate on the ax propperty of the node.
 * @param {getEl} el  - Target node or node selector, please refer to the util : getEl.
 * @returns {null|object} - Return the operation methods.
 * @see {@link https://codepen.io/axui/pen/rNPmEqz|demo @ codepen}
 * @example
 * ax.elProps('#demo').add('isBoy');
 * <!--return target dom-->
 */
'use strict';
import getEl from './getEl';
import Observe from '../modules/Observe';
import { T_el } from '../../../types/ax';
import isEmpty from './isEmpty';
interface Return {
    add: Function;
    remove: Function;
    observer: Object;
}
const elProps = (el: any): null | Return => {
    let target = (getEl(el) as T_el), result: any = null;
    if (target) {
        !target.hasOwnProperty('ax') ? target.ax = {} : null;
        result = {
            add: (key: string, value: any = true) => {
                key && (target.ax[key] = value);
                return target;
            },
            remove: (key: string) => {
                key && (delete target.ax[key]);
                return target;
            }
        }
    }
    return result;
}
export default elProps;
