import { BuildOptions, Plugin } from 'esbuild'; import { LibrariesOptions, OutputOptions } from 'dts-bundle-generator'; /** adds spaces from left so that all lines are visually in line vertically */ export declare const getPadLeft: (str: string, width: number, char?: string) => string; /** formats the byte/kByte sizes with coloring */ export declare const formatSize: (size: number, filename: string, type?: string, raw?: boolean) => string; /** returns the text of all file sizes per compression */ export declare const getSizeInfo: (code: string, filename: string, raw: boolean) => Promise; /** adds all node_module imports to external so that --bundle in esbuild is not bundling them in */ export declare const makeAllPackagesExternalPlugin: Plugin; /** makes sure that all __dirname and __filename occurances are replaced why the actual filenames */ export declare const esmDirnamePlugin: Plugin; /** default baseConfig for esbuild */ export declare const baseConfig: BuildOptions; /** rewrites the outfile name from e.g. ./dist/index.js to ./dist/index.esm.js, ./dist/index.iife.js */ export declare const getOutfileName: (fileName: string, subType: BuildOptions['format']) => string; /** options applied, when debug is enabled */ export declare const debugBuildOptions: Partial; /** calls esbuild with a dynamic configuration per format */ export declare const genericBuild: ({ outputFormats, entryPoint, outfile, esBuildOptions, debug: isDebug, dts, tsConfigPath, dtsLibOptions, dtsOutputOptions, }: BundleConfig) => Promise; export interface BundleConfig { /** allows to customize the output formats that esbuild would generate. default: ['iife', 'esm', 'cjs'] */ outputFormats?: Array; /** shall the output not be minified and treeShaked but left readable? default: false */ debug?: boolean; /** a file to start bundling for. e.g. ./src/index.ts */ entryPoint: string; /** a file to write to. e.g. ./dist/index.js */ outfile: string; /** shall the output include .d.ts type declarations? (takes much longer to compile); default: true */ dts?: boolean; /** allows to inline types of libraries etc. */ dtsLibOptions?: LibrariesOptions; /** allows to control .d.ts. bundle specifics */ dtsOutputOptions?: OutputOptions; /** path to a tsconfig.json file, if existing; default: 'tsconfig.json' */ tsConfigPath?: string; /** esbuild BuildConfig to override internal configuration */ esBuildOptions?: BuildOptions; } export declare const genericDefaultBundleConifg: Partial; export declare const defaultBundleConfigBrowser: Partial; export declare const defaultBundleConfigNode: Partial; /** configures esbuild to build one file for a browser environment; defaults: defaultBundleConfigBrowser */ export declare const buildForBrowser: (config: BundleConfig) => Promise; /** configures esbuild to build one file for a Node.js environment; defaults: defaultBundleConfigNode */ export declare const buildForNode: (config: BundleConfig) => Promise;