"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../../../Class/$");
const Element_1 = require("../../../Class/Element");
const _ids_1 = require("../../_ids");
class Client extends Element_1.Element_ {
    constructor(system) {
        super({
            i: ['graph', 'done'],
            o: ['hub'],
        }, {
            input: {},
            output: {
                hub: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_CLIENT);
    }
    // TODO implement Semifunctional logic
    onDataInputData(name, data) {
        super.onDataInputData(name, data);
        console.log('Client', name, data);
        if (name === 'graph') {
            const hub = new (class _Hub extends _1.$ {
                read() {
                    throw new Error('Method not implemented.');
                }
                write(data) {
                    throw new Error('Method not implemented.');
                }
                get(name) {
                    throw new Error('Method not implemented.');
                }
                set(name, data) {
                    throw new Error('Method not implemented.');
                }
                delete(name) {
                    throw new Error('Method not implemented.');
                }
                hasKey(name) {
                    throw new Error('Method not implemented.');
                }
                keys() {
                    throw new Error('Method not implemented.');
                }
                pathGet(path, name) {
                    throw new Error('Method not implemented.');
                }
                pathSet(path, name, data) {
                    throw new Error('Method not implemented.');
                }
                pathDelete(path, name) {
                    throw new Error('Method not implemented.');
                }
                subscribe(path, key, listener) {
                    throw new Error('Method not implemented.');
                }
            })(this.__system);
            this._output.hub.push(hub);
        }
        else if (name === 'done') {
            this._forward_empty('hub');
            this._backward('graph');
            this._backward('done');
        }
    }
    onDataInputDrop(name) {
        if (name === 'graph') {
            this._forward_empty('hub');
        }
    }
    onIterDataInputData(name) {
        // if (name === 'done') {
        this._forward_empty('hub');
        this._backward('done');
        // }
    }
}
exports.default = Client;
//# sourceMappingURL=index.js.map