Exemple #1
0
        public static TsFile[] Convert(IEnumerable <Type> types,
                                       IEnumerable <ICoder> coders,
                                       ICoder defaultCoder = null,
                                       IEnumerable <ICustomTypeConverter> customTypeConverters =
                                       null)
        {
            if (customTypeConverters != null)
            {
                TsType.RegisterCustomTypeConverters(customTypeConverters);
            }

            var csDeclarations = CsDeclarationFactory.Create(types).ToArray();

            var writtenTsFiles = coders.SelectMany(coder => coder.Rewrite(csDeclarations))
                                 .Where(x => x.Declarations.Any())
                                 .ToArray();

            return(FixBuild(writtenTsFiles,
                            defaultCoder ?? new DefaultCoder(),
                            csDeclarations));
        }