class InvalidArgsNamesException extends Error {
    constructor(name, method) {
        super(`An argument with the name '${name}' already exists in the method '${method}'`);
    }
}

class MethodArgsRegistry {
    constructor() {
        this.argumentsIndexMap = new Map();
    }
    get size() {
        return this.argumentsIndexMap.size;
    }
    getNameByIndex(index) {
        var _a, _b;
        return (_b = (_a = this.argumentsIndexMap.get(index)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null;
    }
    getIndexByKey(key) {
        var _a, _b;
        return (_b = (_a = this.argumentsIndexMap.get(key)) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : null;
    }
    putIndexByName(name, method, paramIndex) {
        const info = { key: name, index: paramIndex };
        this.checkDuplicateName(name, method);
        this.argumentsIndexMap.set(paramIndex, info);
        this.argumentsIndexMap.set(name, info);
    }
    checkDuplicateName(name, method) {
        if (this.argumentsIndexMap.has(name)) {
            throw new InvalidArgsNamesException(name, method);
        }
    }
}

/**
 * Generated bundle index. Do not edit.
 */

export { InvalidArgsNamesException, MethodArgsRegistry };
//# sourceMappingURL=angular-ru-cdk-runtime.js.map
