"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupServiceInterfaces = exports.NO_INTERFACE_CHANGES = void 0;
exports.NO_INTERFACE_CHANGES = {};
const setupServiceInterfaces = (fn) => {
    return (async (effects) => {
        const bindings = [];
        const interfaces = [];
        await fn({
            effects: {
                ...effects,
                bind: (params) => {
                    bindings.push({ id: params.id, internalPort: params.internalPort });
                    return effects.bind(params);
                },
                exportServiceInterface: (params) => {
                    interfaces.push(params.id);
                    return effects.exportServiceInterface(params);
                },
            },
        });
        await effects.clearBindings({ except: bindings });
        await effects.clearServiceInterfaces({ except: interfaces });
        return null;
    });
};
exports.setupServiceInterfaces = setupServiceInterfaces;
//# sourceMappingURL=setupInterfaces.js.map