Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation, clean up code #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import Foo = require('package-name/Foo');
## Options

* `baseDir?: string`: The base directory for the package being bundled. Any dependencies discovered outside this
directory will be excluded from the bundle. *Note* this is no longer the preferred way to configure `dts-generator`,
directory will be excluded from the bundle. *Note* this is no longer the preferred way to configure `dts-generator`,
it automatically gets its value from compiler option `rootDir` if specified in `tsconfig.json`, otherwise it gets value from `project`. Please see option `project`.
* `exclude?: string[]`: A list of glob patterns, relative to `baseDir`, that should be excluded from the bundle. Use
the `--exclude` flag one or more times on the command-line. Defaults to `[ "node_modules/**/*.d.ts" ]`.
Expand All @@ -86,9 +86,11 @@ import Foo = require('package-name/Foo');
* `name: string`: The name of the package. Used to determine the correct exported package name for modules.
* `out: string`: The filename where the generated bundle will be created.
* `project?: string`: The base directory for the project being bundled. It is assumed that this directory contains a `tsconfig.json` which will be parsed to determine the files that should be bundled as well as other configuration information like `target`
* `sendMessage?: function`: When using dts-generator programmatically this option can specify a function to receive logging messages from dts-generator.
* `target?: ts.ScriptTarget`: The target environment for generated code. Defaults to `ts.ScriptTarget.Latest`.
* `resolveModuleId: (params: ResolveModuleIdParams) => string`: An optional callback provided by the invoker to customize the declared module ids the output d.ts files. For details see [resolving module ids](docs/resolving-module-ids.md).
* `resolveModuleImport: (params: ResolveModuleImportParams) => string`: An optional callback provided by the invoker to customize the imported module ids in the output d.ts files. For details see [resolving module ids](docs/resolving-module-ids.md).
* `verbose?: boolean=false`: If `true` additional output is generated during processing.

## Known issues

Expand Down
2 changes: 0 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ export interface Options {
externs?: string[];
types?: string[];
eol?: string;
includes?: string[];
indent?: string;
main?: string;
moduleResolution?: ts.ModuleResolutionKind;
name?: string;
out: string;
outDir?: string;
prefix?: string;
rootDir?: string;
target?: ts.ScriptTarget;
sendMessage?: (message: any, ...optionalParams: any[]) => void;
resolveModuleId?: (params: ResolveModuleIdParams) => string;
Expand Down