1 |
|
2 | import { EventEmitter } from "events";
|
3 | import { ModuleFormat as RollupModuleFormat, OutputOptions as RollupOutputOptions, Plugin, RollupOptions } from "rollup";
|
4 | export declare type ExcludeProps<T, X extends keyof T> = Pick<T, Exclude<keyof T, X>>;
|
5 | export declare type OutputExtra = ExcludeProps<RollupOutputOptions, "file" | "format" | "sourcemap" | "esModule" | "interop">;
|
6 | export declare type FilterablePlugins = Array<Plugin | null | false>;
|
7 | export declare type ConfigExtra = ExcludeProps<RollupOptions, "input" | "output" | "external" | "plugins">;
|
8 | export declare type ModuleBuildFormat = Extract<RollupModuleFormat, "cjs" | "es">;
|
9 | export declare type BrowserBuildFormat = Extract<RollupModuleFormat, "iife" | "amd" | "umd">;
|
10 | export declare type BuildFormat = ModuleBuildFormat | BrowserBuildFormat;
|
11 | export interface BundlibOptions {
|
12 | |
13 |
|
14 |
|
15 |
|
16 | dev?: boolean;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | watch?: boolean;
|
22 | silent?: boolean;
|
23 | }
|
24 | export declare type EventBuilding = "BUILDING";
|
25 | export declare type EventBuilt = "BUILT";
|
26 | export declare type EventWriting = "WRITING";
|
27 | export declare type EventWritten = "WRITTEN";
|
28 | export declare type EventError = "ERROR";
|
29 | export interface BuildEventEmitter extends EventEmitter {
|
30 | on(event: EventWriting | EventWritten, listener: (filename: string) => void): this;
|
31 | on(event: EventError, listener: (error: Error) => void): this;
|
32 | on(event: EventBuilding | EventBuilt, listener: () => void): this;
|
33 | emit(event: EventWriting | EventWritten, filename: string): boolean;
|
34 | emit(event: EventError, error: Error): boolean;
|
35 | emit(event: EventBuilding | EventBuilt): boolean;
|
36 | }
|
37 | export declare type BuildEventEmitterOrPromise = BuildEventEmitter | Promise<BuildEventEmitter>;
|
38 | export declare type BuldFunction = (configs: RollupOptions[]) => BuildEventEmitterOrPromise;
|