///
import { EventEmitter } from 'events';
export declare type ModuleType = 'prod' | 'dev' | 'optional';
export declare type RebuildMode = 'sequential' | 'parallel';
export interface RebuildOptions {
buildPath: string;
electronVersion: string;
arch?: string;
extraModules?: string[];
onlyModules?: string[] | null;
force?: boolean;
headerURL?: string;
types?: ModuleType[];
mode?: RebuildMode;
debug?: boolean;
useCache?: boolean;
useElectronClang?: boolean;
cachePath?: string;
prebuildTagPrefix?: string;
projectRootPath?: string;
forceABI?: number;
disablePreGypCopy?: boolean;
}
export declare type HashTree = {
[path: string]: string | HashTree;
};
export interface RebuilderOptions extends RebuildOptions {
lifecycle: EventEmitter;
}
export declare enum BuildType {
Debug = "Debug",
Release = "Release"
}
export declare class Rebuilder {
private ABIVersion;
nodeGypPath: string;
prodDeps: Set;
rebuilds: (() => Promise)[];
realModulePaths: Set;
realNodeModulesPaths: Set;
lifecycle: EventEmitter;
buildPath: string;
electronVersion: string;
platform: string;
arch: string;
extraModules: string[];
onlyModules: string[] | null;
force: boolean;
headerURL: string;
types: ModuleType[];
mode: RebuildMode;
debug: boolean;
useCache: boolean;
cachePath: string;
prebuildTagPrefix: string;
projectRootPath?: string;
msvsVersion?: string;
useElectronClang: boolean;
disablePreGypCopy: boolean;
constructor(options: RebuilderOptions);
get ABI(): string;
get buildType(): BuildType;
rebuild(): Promise;
private hashDirectory;
private dHashTree;
private generateCacheKey;
rebuildModuleAt(modulePath: string): Promise;
rebuildAllModulesIn(nodeModulesPath: string, prefix?: string): Promise;
findModule(moduleName: string, fromDir: string, foundFn: ((p: string) => Promise)): Promise;
markChildrenAsProdDeps(modulePath: string): Promise;
}
export declare type RebuildResult = Promise & {
lifecycle: EventEmitter;
};
export declare function rebuild(options: RebuildOptions): RebuildResult;