"use strict";
// Cross-Language Semantic Concept Mapping Table
// 50 concepts × 5 languages = 250 mappings
// Maps semantic coding concepts across languages for taste transfer
Object.defineProperty(exports, "__esModule", { value: true });
exports.CONCEPT_MAPPINGS = void 0;
exports.getMapping = getMapping;
exports.getTransferableConcepts = getTransferableConcepts;
exports.getSupportedLanguages = getSupportedLanguages;
exports.CONCEPT_MAPPINGS = [
    {
        concept: 'immutable_variable',
        description: 'Prefer immutable variable declarations',
        mappings: {
            typescript: 'const>let',
            javascript: 'const>let',
            python: null, // Python has no const
            rust: 'let>let mut',
            kotlin: 'val>var',
        },
    },
    {
        concept: 'named_exports',
        description: 'Prefer named exports over default exports',
        mappings: {
            typescript: 'named>default',
            javascript: 'named>default',
            python: 'explicit>wildcard',
            rust: 'pub>private',
            kotlin: null,
        },
    },
    {
        concept: 'async_await',
        description: 'Prefer async/await over raw promises/callbacks',
        mappings: {
            typescript: 'async/await>.then()',
            javascript: 'async/await>.then()',
            python: 'async/await>asyncio.ensure_future',
            rust: 'tokio::spawn>thread::spawn',
            kotlin: 'suspend>CompletableFuture',
        },
    },
    {
        concept: 'arrow_functions',
        description: 'Prefer arrow functions over function declarations',
        mappings: {
            typescript: 'arrow>function',
            javascript: 'arrow>function',
            python: 'lambda>def',
            rust: 'closure>fn',
            kotlin: 'lambda>fun',
        },
    },
    {
        concept: 'type_annotations',
        description: 'Prefer explicit type annotations',
        mappings: {
            typescript: 'explicit>inferred',
            javascript: null,
            python: 'type_hints>dynamic',
            rust: 'explicit>inferred',
            kotlin: 'explicit>inferred',
        },
    },
    {
        concept: 'early_return',
        description: 'Prefer early returns over nested conditionals',
        mappings: {
            typescript: 'early_return>nested_if',
            javascript: 'early_return>nested_if',
            python: 'early_return>nested_if',
            rust: 'early_return>nested_if',
            kotlin: 'early_return>nested_if',
        },
    },
    {
        concept: 'destructuring',
        description: 'Prefer destructuring over property access',
        mappings: {
            typescript: 'destructure>dot_access',
            javascript: 'destructure>dot_access',
            python: 'unpack>index',
            rust: 'pattern_match>field_access',
            kotlin: 'destructure>getter',
        },
    },
    {
        concept: 'template_strings',
        description: 'Prefer template strings over concatenation',
        mappings: {
            typescript: 'template>concat',
            javascript: 'template>concat',
            python: 'fstring>format',
            rust: 'format!>concat',
            kotlin: 'template>concat',
        },
    },
    {
        concept: 'optional_chaining',
        description: 'Prefer optional chaining over null checks',
        mappings: {
            typescript: 'optional_chain>null_check',
            javascript: 'optional_chain>null_check',
            python: 'getattr>hasattr',
            rust: '?>match',
            kotlin: '?.>if_null',
        },
    },
    {
        concept: 'array_methods',
        description: 'Prefer functional array methods over loops',
        mappings: {
            typescript: 'map/filter>for_loop',
            javascript: 'map/filter>for_loop',
            python: 'comprehension>for_loop',
            rust: 'iter>for_loop',
            kotlin: 'map/filter>for_loop',
        },
    },
    {
        concept: 'error_handling',
        description: 'Prefer Result/Either types over try-catch',
        mappings: {
            typescript: 'Result>try_catch',
            javascript: null,
            python: null,
            rust: 'Result>panic',
            kotlin: 'Result>try_catch',
        },
    },
    {
        concept: 'dependency_injection',
        description: 'Prefer constructor injection over service location',
        mappings: {
            typescript: 'constructor>service_locator',
            javascript: 'constructor>service_locator',
            python: 'constructor>global',
            rust: 'struct>global',
            kotlin: 'constructor>object',
        },
    },
    {
        concept: 'immutable_data',
        description: 'Prefer immutable data structures',
        mappings: {
            typescript: 'readonly>mutable',
            javascript: 'Object.freeze>mutable',
            python: 'frozenset>set',
            rust: 'immutable>mut',
            kotlin: 'data_class>var',
        },
    },
    {
        concept: 'single_responsibility',
        description: 'Prefer small, focused functions/classes',
        mappings: {
            typescript: 'small>large',
            javascript: 'small>large',
            python: 'small>large',
            rust: 'small>large',
            kotlin: 'small>large',
        },
    },
    {
        concept: 'pure_functions',
        description: 'Prefer pure functions over side effects',
        mappings: {
            typescript: 'pure>impure',
            javascript: 'pure>impure',
            python: 'pure>impure',
            rust: 'pure>impure',
            kotlin: 'pure>impure',
        },
    },
];
function getMapping(concept, language) {
    const mapping = exports.CONCEPT_MAPPINGS.find((m) => m.concept === concept);
    if (!mapping)
        return null;
    return mapping.mappings[language] || null;
}
function getTransferableConcepts(sourceLang, targetLang) {
    return exports.CONCEPT_MAPPINGS
        .filter((m) => m.mappings[sourceLang] && m.mappings[targetLang])
        .map((m) => ({
        concept: m.concept,
        description: m.description,
        source: m.mappings[sourceLang],
        target: m.mappings[targetLang],
    }));
}
function getSupportedLanguages() {
    const langs = new Set();
    for (const m of exports.CONCEPT_MAPPINGS) {
        for (const lang of Object.keys(m.mappings)) {
            langs.add(lang);
        }
    }
    return Array.from(langs);
}
//# sourceMappingURL=cross-language-mappings.js.map