Skip to content

Converting a lot of *.d.ts files #2

Description

@ts2kt

There are such large projects, written directly in TypeScript and contains complex directory structure with a lot of files (hundreds). Such projects are compiled with option --declaration (which autogenerate *.d.ts for each *.ts files) and published directly to npm
Trying to convert typings of such project, I ran into a number of problems. Here are some of them:

  1. Need option to specify directory, from which dukat will take *.d.ts files recursively and put result to destination directory keeping source directory structure. It could be resolved with some scripting, but...
  2. I've tried to specify 200+ *.d.ts files via $ dukat /path/to/**/*.d.ts. It takes > 1 hour to convert them (2-4 files per minute)
  3. Option -b some_package_name gave no effect. Each file get same package name as it file name. It also don't work for single file. I expect that I can specify same package name for all files. Ability to specify @file:JsModule("path-to-module") would be also useful.
  4. Interface names like 'T$0' will be duplicated, because each file converted independently.
  5. If one external class implement interface from another file, there are no override modifier, because each file converted independently.
  6. Notice: as mentioned here package.json could contain types property or index.d.ts at the root of the package. It would be nice if also it were ability to analyze dependencies starting from index.d.ts before just converting all files from npm package.
    Also mainly index.d.ts contains re-exports.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions