"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../../Class/Holder");
const _ids_1 = require("../../../_ids");
class Pin_ extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['unit', 'name', 'type'],
            fo: ['pin'],
            i: [],
        }, {
            input: {
                unit: {
                    ref: true,
                },
            },
            output: {
                pin: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_PIN);
    }
    async f({ unit, name, type }, done) {
        try {
            const pin = unit.getPin(type, name);
            done({ pin });
        }
        catch (err) {
            done(undefined, err.message);
        }
    }
}
exports.default = Pin_;
//# sourceMappingURL=index.js.map