UNPKG

1.97 kBTypeScriptView Raw
1// Type definitions for rollup-plugin-visualizer 4.2
2// Project: https://github.com/doesdev/rollup-plugin-analyzer#readme
3// Definitions by: Nick <https://github.com/fobdy>,
4// Max Boguslavskiy <https://github.com/maxbogus>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 4.2
7
8/// <reference types="node" />
9import { Plugin } from "rollup";
10
11declare namespace visualizer {
12 interface PluginVisualizerOptions {
13 /**
14 * Name of the file with diagram to generate
15 * @default "stats.html"
16 */
17 filename?: string | undefined;
18 /**
19 * Title tag value
20 * @default "Rollup Visualizer"
21 */
22 title?: string | undefined;
23 /**
24 * Use sourcemaps to calculate sizes (e.g. after UglifyJs or Terser)
25 * @default false
26 */
27 sourcemap?: boolean | undefined;
28 /**
29 * Open generated file in default user agent
30 * @default false
31 */
32 open?: boolean | undefined;
33 /**
34 * Which diagram type to use
35 * @default "treemap"
36 */
37 template?: "treemap" | "sunburst" | "network" | undefined;
38 /**
39 * Product portable json file that can be used with
40 * plugin CLI util to generate graph from several json files.
41 * Every UI property ignored in this case.
42 * @default false
43 */
44 json?: boolean | undefined;
45 /**
46 * Collect gzip size from source code and display it at chart
47 * @default false
48 */
49 gzipSize?: boolean | undefined;
50 /**
51 * Collect brotli size from source code and display it at chart.
52 * Only if current node version supports it
53 * @default false
54 */
55 brotliSize?: boolean | undefined;
56 }
57}
58
59declare function visualizer(options?: visualizer.PluginVisualizerOptions): Plugin;
60
61export = visualizer;