{"id":18355421,"url":"https://github.com/charto/autodts-generator","last_synced_at":"2025-04-10T01:37:26.079Z","repository":{"id":36591822,"uuid":"40897823","full_name":"charto/autodts-generator","owner":"charto","description":"DEPRECATED (TypeScript 1.8 includes all functionality) fork of https://github.com/SitePen/dts-generator","archived":false,"fork":false,"pushed_at":"2017-04-19T12:29:36.000Z","size":109,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T08:47:39.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-17T13:40:17.000Z","updated_at":"2017-04-19T12:29:38.000Z","dependencies_parsed_at":"2022-09-08T21:11:36.001Z","dependency_job_id":null,"html_url":"https://github.com/charto/autodts-generator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charto","download_url":"https://codeload.github.com/charto/autodts-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248141394,"owners_count":21054449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T22:06:52.316Z","updated_at":"2025-04-10T01:37:26.052Z","avatar_url":"https://github.com/charto.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"DEPRECATED\n==========\n\nThis module will no longer be updated, since TypeScript 1.8 already includes the same functionality.\n\n.d.ts generator\n===============\n\nThis is a fork of [dts-generator](https://github.com/SitePen/dts-generator) patched to work better with [autodts](https://github.com/charto/autodts).\n\nGenerates a single .d.ts bundle containing external module declarations generated from TypeScript files.\n\n## What does this mean?\n\nIf you have a project with lots of individual TypeScript files that are designed to be consumed as external modules,\nthe TypeScript compiler doesn’t allow you to actually create a single bundle out of them. This package leverages the\nTypeScript language services in TypeScript 1.4+ to generate a single .d.ts file containing multiple\n`declare module 'foo'` declarations. This allows you to distribute a single .d.ts file along with your compiled\nJavaScript that users can simply reference from the TypeScript compiler using a `/// \u003creference path /\u003e` comment.\n\n.d.ts generator will also correctly merge non-external-module files, and any already-existing .d.ts files.\n\n## Usage\n\n1. `npm install dts-generator`\n\n2. Generate your d.ts bundle:\n\n   Programmatically:\n\n```js\nrequire('dts-generator').generate({\n\tname: 'package-name',\n\tbaseDir: '/path/to/package-directory',\n  files: [ 'a.ts', 'b.ts', ... ]\n\tout: 'package-name.d.ts'\n});\n```\n\n   Command-line:\n\n```bash\ndts-generator --name package-name --baseDir /path/to/package-directory --out package-name.d.ts a.ts b.ts ...\n```\n\n   Grunt:\n\n```js\nmodule.exports = function (grunt) {\n\tgrunt.loadNpmTasks('dts-generator');\n\tgrunt.initConfig({\n\t\tdtsGenerator: {\n\t\t\toptions: {\n\t\t\t\tname: 'package-name',\n\t\t\t\tbaseDir: '/path/to/package-directory',\n\t\t\t\tout: 'package-name.d.ts'\n\t\t\t},\n\t\t\tdefault: {\n\t\t\t\tsrc: [ '/path/to/package-directory/**/*.ts' ]\n\t\t\t}\n\t\t}\n\t});\n};\n```\n\n3. Reference your generated d.ts bundle from somewhere in your consumer module and import away!:\n\n```ts\n/// \u003creference path=\"typings/package-name.d.ts\" /\u003e\n\nimport Foo = require('package-name/Foo');\n\n// ...\n```\n\n## Options\n\n* `baseDir: string`: The base directory for the package being bundled. Any dependencies discovered outside this\n  directory will be excluded from the bundle.\n* `excludes?: string[]`: A list of files, relative to `baseDir`, that should be excluded from the bundle. Use the\n  `--exclude` flag one or more times on the command-line.\n* `externs?: string[]`: A list of external module reference paths that should be inserted as reference comments. Use\n  the `--extern` flag one or more times on the command-line.\n* `files: string[]`: A list of files from the baseDir to bundle.\n* `eol?: string`: The end-of-line character that should be used when outputting code. Defaults to `os.EOL`.\n* `indent?: string`: The character(s) that should be used to indent the declarations in the output. Defaults to `\\t`.\n* `main?: string`: The module ID that should be used as the exported value of the package’s “main” module.\n* `name: string`: The name of the package. Used to determine the correct exported package name for modules.\n* `out: string`: The filename where the generated bundle will be created.\n* `target?: ts.ScriptTarget`: The target environment for generated code. Defaults to `ts.ScriptTarget.Latest`.\n\n## Known issues\n\n* Output bundle code formatting is not perfect yet\n\n## Thanks\n\n@fdecampredon for the idea to dump output from the compiler emitter back into the compiler parser instead of trying to\nfigure out how to influence the code emitter.\n\n## Licensing\n\n© 2015 SitePen, Inc. New BSD License.\n© 2015 BusFaster Ltd. New BSD License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fautodts-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharto%2Fautodts-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fautodts-generator/lists"}