'use strict';

/**
 * Expose `Interfaces`.
 */
module.exports = Interfaces;

/**
 * Module dependencies.
 */
var utils = require('../../../utils'),
    SectionProcessor = require('../../../configuration/section-processor')
;

utils.extend(SectionProcessor, Interfaces);

/**
 * Initialize a new section processor interfaces for the config.
 */
function Interfaces() {
    SectionProcessor.call(this);

    this.contract = {
        __any: {
            extends: {
                type: 'string'
            },
            methods: {
                type: 'embedded_object',
                embed: {
                    arguments: {
                        type: 'string_array',
                        default: []
                    },
                    returns: {
                        type: 'string'
                    }
                },
                default: {}
            },
            getters: {
                type: 'string_object',
                default: {}
            },
            setters: {
                type: 'string_object',
                default: {}
            }
        },
        type: 'embedded',
        namespace: true
    };
}
@@ -1162,8 +1162,2297 @@
     %7D;%0A%7D
+%0A%0A/**%0A * @interface %7Bdanf:configuration.sectionProcessor%7D%0A */%0AInterfaces.prototype.interpretModuleConfig = function(config, module, modulesTree) %7B%0A    for (var interfaceName in config) %7B%0A        var interface_ = config%5BinterfaceName%5D;%0A%0A        // Handle method arguments namespacing.%0A        if (interface_.methods) %7B%0A            for (var name in interface_.methods) %7B%0A                var method = interface_.methods%5Bname%5D;%0A%0A                if (method.arguments) %7B%0A                    for (var i = 0; i %3C method.arguments.length; i++) %7B%0A                        method.arguments%5Bi%5D = namespaceType.call(%0A                            this,%0A                            method.arguments%5Bi%5D,%0A                            module,%0A                            modulesTree%0A                        );%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A        // Handle getters namespacing.%0A        if (interface_.getters) %7B%0A            for (var name in interface_.getters) %7B%0A                interface_.getters%5Bname%5D = namespaceType.call(%0A                    this,%0A                    interface_.getters%5Bname%5D,%0A                    module,%0A                    modulesTree%0A                );%0A            %7D%0A        %7D%0A%0A        // Handle setters namespacing.%0A        if (interface_.setters) %7B%0A            for (var name in interface_.setters) %7B%0A                interface_.setters%5Bname%5D = namespaceType.call(%0A                    this,%0A                    interface_.setters%5Bname%5D,%0A                    module,%0A                    modulesTree%0A                );%0A            %7D%0A        %7D%0A    %7D%0A%0A    return config;%0A%7D%0A%0A/**%0A * Namespace a type.%0A *%0A * @param %7Bstring%7D type The type.%0A * @param %7Bdanf:configuration.module%7D module The module.%0A * @param %7Bdanf:configuration.modulesTree%7D modulesTree The modules tree.%0A * @return %7Bstring%7D The namespaced type.%0A * @api private%0A */%0Avar namespaceType = function(type, module, modulesTree) %7B%0A    var argument = type.split('/'),%0A        types = argument%5B0%5D.split('%7C')%0A    ;%0A%0A    for (var i = 0; i %3C types.length; i++) %7B%0A        if (Object.isInterfaceType(types%5Bi%5D)) %7B%0A            types%5Bi%5D = this._namespacer.prefix(types%5Bi%5D, module, modulesTree);%0A        %7D%0A    %7D%0A%0A    type = types.join('%7C');%0A%0A    return argument%5B1%5D ? '%7B0%7D/%7B1%7D'.format(type, argument%5B1%5D) : type;%0A%7D

Add interfaces types namespacing