protected ClosureExternsGenerator(IEnumerable <Type> types, ClosureExternsOptions options)
 {
     this._options    = options;
     this._types      = (types ?? new Type[] { }).Select(MapType).ToArray();
     this._assemblies = this._types.GroupBy(x => x.Assembly)
                        .Select(x => x.Key)
                        .ToArray();
 }
        /// <summary>
        /// Generates closure externs using the given options.
        /// </summary>
        /// <param name="types">A set of base types to generate. Any dependencies will also be included recursively
        /// <para>(e.g. if a property of a type is of some type not in the list, that type will be generated as well)</para>
        /// </param>
        /// <returns></returns>
        public static string Generate(IEnumerable <Type> types, ClosureExternsOptions options)
        {
            var generator = new ClosureExternsGenerator(types, options);

            return(generator.Generate());
        }