"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class RemoveChild extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['parent', 'at'],
            o: [],
        }, {
            input: {
                parent: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_REMOVE_CHILD);
    }
    f({ parent, at }, done, fail) {
        try {
            const child = parent.removeChild(at);
            child.destroy();
        }
        catch (err) {
            fail(err.message);
            return;
        }
        done({});
    }
}
exports.default = RemoveChild;
//# sourceMappingURL=index.js.map