dts-bundle-generator

  • Version 10.0.0
  • Published
  • 189 kB
  • 2 dependencies
  • MIT license

Install

npm i dts-bundle-generator
yarn add dts-bundle-generator
pnpm add dts-bundle-generator

Overview

DTS Bundle Generator

Index

Functions

function generateDtsBundle

generateDtsBundle: (
entries: readonly EntryPointConfig[],
options?: CompilationOptions
) => string[];

    Interfaces

    interface CompilationOptions

    interface CompilationOptions {}

      property allowUnresolvedImportTypes

      allowUnresolvedImportTypes?: boolean;
      • If enabled, import() types whose module cannot be resolved (e.g. import('optional-module').Type) are kept as is in the output and a warning is printed. This is useful for libraries that intentionally check for optional modules in their typings. By default (when disabled) generation fails in such case.

        false

      followSymlinks?: boolean;
      • EXPERIMENTAL! Allows disable resolving of symlinks to the original path. By default following is enabled.

        See Also

        • https://github.com/timocov/dts-bundle-generator/issues/39

      property preferredConfigPath

      preferredConfigPath?: string;
      • Path to the tsconfig file that will be used for the compilation.

      interface EntryPointConfig

      interface EntryPointConfig {}

        property failOnClass

        failOnClass?: boolean;
        • Fail if generated dts contains class declaration.

        property filePath

        filePath: string;
        • Path to input file.

        property libraries

        libraries?: LibrariesOptions;

          property output

          output?: OutputOptions;

            interface LibrariesOptions

            interface LibrariesOptions {}

              property allowedTypesLibraries

              allowedTypesLibraries?: string[];
              • Array of package names from to import typings from via the triple-slash reference directive. By default all packages are allowed and will be used according to their usages.

              property importedLibraries

              importedLibraries?: string[];
              • Array of package names from node_modules to import typings from. Used types will be imported using import { First, Second } from 'library-name';. By default all libraries will be imported (except inlined libraries and libraries from @types).

              property inlinedLibraries

              inlinedLibraries?: string[];
              • Array of package names from node_modules to inline typings from. Used types will be inlined into the output file.

              interface OutputOptions

              interface OutputOptions {}

                property exportReferencedTypes

                exportReferencedTypes?: boolean;
                • If enabled, all interfaces, types and const enums are marked as exported even if they aren't exported directly. By default (when disabled) a node will be exported only if it is exported from the root source file.

                  If a referenced type cannot be exported because it was renamed due to name collisions, generation fails. Export such types explicitly from the root source file or disable this option.

                  false

                property inlineDeclareExternals

                inlineDeclareExternals?: boolean;
                • Enables inlining of declare module statements of the global modules (e.g. declare module 'external-module' {}, but NOT declare module './internal-module' {}) contained in files which should be inlined (all local files and packages from inlined libraries)

                property inlineDeclareGlobals

                inlineDeclareGlobals?: boolean;
                • Enables inlining of declare global statements contained in files which should be inlined (all local files and packages from inlined libraries).

                property noBanner

                noBanner?: boolean;
                • Allows remove "Generated by dts-bundle-generator" comment from the output

                property respectPreserveConstEnum

                respectPreserveConstEnum?: boolean;
                • Enables stripping the const keyword from every direct-exported (or re-exported) from entry file const enum. This allows you "avoid" the issue described in https://github.com/microsoft/TypeScript/issues/37774.

                property sortNodes

                sortNodes?: boolean;
                • Sort output nodes in ascendant order.

                property umdModuleName

                umdModuleName?: string;
                • Name of the UMD module. If specified then export as namespace ModuleName; will be emitted.

                Package Files (1)

                Dependencies (2)

                Dev Dependencies (0)

                No dev dependencies.

                Peer Dependencies (0)

                No peer dependencies.

                Badge

                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/dts-bundle-generator.

                • Markdown
                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/dts-bundle-generator)
                • HTML
                  <a href="https://www.jsdocs.io/package/dts-bundle-generator"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>