Type definitions flattening options.

Contains options for rollup-plugin-flat-dts plugin.

Accepted by emitFlatDts function.

interface Options {
    compilerOptions?: CompilerOptions;
    entries?: {
        [name: string]: EntryDecl | undefined;
    };
    external?: string | readonly string[];
    file?: string;
    internal?: string | readonly string[];
    lib?: string | boolean | readonly string[];
    moduleName?: string;
    refs?: boolean;
    tsconfig?: unknown;
}

Properties

compilerOptions?: CompilerOptions

TypeScript compiler options to apply.

Override the options from tsconfig.

entries?: {
    [name: string]: EntryDecl | undefined;
}

Module entries.

A map of entry name declarations. Each key is an original name of module entry as it present in non-flattened .d.ts file, which is typically a relative path to original typescript file without .ts extension.

external?: string | readonly string[]

External module names.

An array of external module names and their glob patterns. These names won't be changed during flattening process.

This is useful for external module augmentation.

file?: string

Output .d.ts file name relative to output directory.

index.d.ts

internal?: string | readonly string[]

Internal module names.

An array of internal module names and their glob patterns. Internal module type definitions are excluded from generated .d.ts files.

lib?: string | boolean | readonly string[]

Whether to add triple-slash directives to refer the libraries used.

Allowed values:

  • true to add an entry for each referred library from lib compiler option,
  • false (the default) to not add any library references,
  • an explicit list of libraries to refer.

false

moduleName?: string

The module name to replace flattened module declarations with.

Package name extracted from package.json found in current directory.

refs?: boolean

Whether to add file references.

A file reference is added when one entry refers another one.

true

tsconfig?: unknown

Either tsconfig.json file location relative to working directory, or parsed tsconfig.json contents.

"tsconfig.json"