package ryo:transform@0.1.0;

interface types {
    /// API version for compatibility checking
    type api-version = u32;

    /// AST node kinds (Rust-specific)
    variant node-kind {
        fn-call,
        method-call,
        match-expr,
        if-expr,
        if-let-expr,
        loop-expr,
        for-expr,
        while-expr,
        block,
        ident,
        literal,
        binary-expr,
        unary-expr,
        field-access,
        index-expr,
        closure,
        struct-expr,
        tuple-expr,
        array-expr,
        path,
        type-path,
    }

    /// Captured node from pattern match
    record capture {
        name: string,
        start-byte: u64,
        end-byte: u64,
        text: string,
    }

    /// Pattern match result
    record match-result {
        kind: node-kind,
        start-byte: u64,
        end-byte: u64,
        captures: list<capture>,
    }

    /// Type information hint (from syn analysis)
    record type-hint {
        node-id: u64,
        type-name: string,
        is-result: bool,
        is-option: bool,
        is-copy: bool,
        is-iterator: bool,
    }

    /// Text edit operation (atomic change)
    record text-edit {
        start-byte: u64,
        end-byte: u64,
        replacement: string,
    }
}
