/**
 * @since Last modified: 2024/03/19 09:17:07
 * @function show
 * @description Let the hidden element be displayed.
 * @param {object} options  - The parameters of show.
 * @param {getEl} [options.el]  - The target node.The writing is the same as getEl.
 * @param {string} [options.display=block]  - The show method of box.Can be filled in:'block'|'inline-block'|'flex'|'inline-flex'|'grid'.can also be "visible".
 * @param {function} [options.done]  - The call back after completion.No parameters.
 * @returns {*} - The the target dom.
 * @see {@link https://codepen.io/axui/pen/Rwvdqza|demo @ codepen}
 * @example
 * ax.show({el:'#demo'});
 * <!--return the target dom-->
 */





'use strict';

import getEl from "./getEl";

type Options = { el: any, display?: string, done?: Function }
let show = ({ el, display = 'block', done }: Options) => {
    let target = getEl(el);
    if (!target) {
        throw new Error('The target node does not exist!');
    }
    if (display == 'visible') {
        target.style.visibility = 'visible';
    } else {
        
        target.style.display = display;
    }
    done && done.call(target);
    return target;
};
export default show;
