72 lines
1.5 KiB
JavaScript
72 lines
1.5 KiB
JavaScript
"use strict";
|
|
|
|
import {Utils} from "https://anp.gocal/Utils/Utils.ecma.js";
|
|
|
|
/**
|
|
* @typedef {import("https://anp.k3y.pw/ecma/Application/AnP.ecma.js").AnP} AnP
|
|
*/
|
|
|
|
/**
|
|
* @callback kyman_opos_start_callback
|
|
* @param {!boolean} ok
|
|
* @returns {void}
|
|
*/
|
|
|
|
/**
|
|
* @constructs KyMANOpos
|
|
* @param {!AnP} anp
|
|
* @param {?(Object.<string, any|null>|Array.<any|null>)} [inputs = null]
|
|
* @returns {void}
|
|
* @access private
|
|
*/
|
|
export const KyMANOpos = (function(){
|
|
|
|
/**
|
|
* @constructs KyMANOpos
|
|
* @param {!AnP} anp
|
|
* @param {?(Object.<string, any|null>|Array.<any|null>)} [inputs = null]
|
|
* @returns {void}
|
|
* @access private
|
|
*/
|
|
const KyMANOpos = function(anp, inputs = null){
|
|
|
|
/** @type {KyMANOpos} */
|
|
const self = this;
|
|
/** @type {boolean} */
|
|
let started = false;
|
|
|
|
/** @type {AnP} */
|
|
this.anp = anp;
|
|
|
|
/**
|
|
* @returns {void}
|
|
* @access private
|
|
*/
|
|
const constructor = () => {};
|
|
|
|
/**
|
|
* @param {?kyman_opos_start_callback} [callback = null]
|
|
* @returns {boolean}
|
|
* @access public
|
|
*/
|
|
this.start = (callback = null) => {
|
|
|
|
/**
|
|
* @param {!boolean} ok
|
|
* @returns {boolean}
|
|
* @access private
|
|
*/
|
|
const end = ok => {
|
|
Utils.execute(callback, ok);
|
|
return ok;
|
|
};
|
|
|
|
return end(started ? false : started = true);
|
|
};
|
|
|
|
constructor();
|
|
|
|
};
|
|
|
|
return KyMANOpos;
|
|
})(); |