neon-cli
Version:
Build and load native Rust/Neon modules.
48 lines (47 loc) • 1.45 kB
TypeScript
import BuildSettings from "./build-settings";
import * as JSON from "ts-typed-json";
/**
* The current state of build artifacts, for all targets.
*/
export default class Artifacts {
/**
* The relative path within the `target` directory to the current active build,
* i.e., the build that was most recently copied as the main `.node` addon.
*/
private active;
/**
* A table tracking the state of any build artifacts in the `target`
* directory.
*
* On Windows, this table has the type:
*
* ```json
* {
* "i686-pc-windows-msvc\\debug"?: BuildSettings,
* "i686-pc-windows-msvc\\release"?: BuildSettings,
* "x86_64-pc-windows-msvc\\debug"?: BuildSettings,
* "x86_64-pc-windows-msvc\\release"?: BuildSettings
* }
* ```
*
* On Linux and macOS, this table has the type:
*
* ```json
* {
* "debug"?: BuildSettings,
* "release"?: BuildSettings
* }
* ```
*/
private targets;
constructor(active?: string | null, targets?: Record<string, BuildSettings>);
static load(file: string): Artifacts;
static fromJSON(json: JSON.Value): Artifacts;
toJSON(): JSON.Object;
save(file: string): void;
lookup(path: string): BuildSettings;
activate(path: string, settings: BuildSettings): void;
haveActivated(path: string): boolean;
delete(path: string): void;
reset(): void;
}