aboutsummaryrefslogtreecommitdiff
path: root/node_modules/nexe/lib/compiler.d.ts
blob: 37ed5279437e40876cd85f4e62b0b6aa4d9958e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/// <reference types="node" />
import { ReadStream } from 'fs';
import { Logger } from './logger';
import { NexeOptions } from './options';
import { NexeTarget } from './target';
import { Bundle } from './fs/bundle';
import { File } from 'resolve-dependencies';
declare type StringReplacer = (match: string) => string;
export interface NexeFile {
    filename: string;
    absPath: string;
    contents: string | Buffer;
}
export { NexeOptions };
export declare class NexeError extends Error {
    constructor(m: string);
}
export declare class NexeCompiler {
    options: NexeOptions;
    /**
     * Epoch of when compilation started
     */
    private start;
    private compileStep;
    log: Logger;
    /**
     * Copy of process.env
     */
    env: {
        [x: string]: string | undefined;
    };
    /**
     * Virtual FileSystem
     */
    bundle: Bundle;
    /**
     * Root directory for the source of the current build
     */
    src: string;
    /**
     * In memory files that are being manipulated by the compiler
     */
    files: NexeFile[];
    /**
     * Standalone pieces of code run before the application entrypoint
     */
    shims: string[];
    /**
     * The last shim (defaults to "require('module').runMain()")
     */
    startup: string;
    /**
     * The main entrypoint filename for your application - eg. node mainFile.js
     */
    entrypoint: string | undefined;
    /**
     * Not used
     */
    targets: NexeTarget[];
    /**
     * Current target of the compiler
     */
    target: NexeTarget;
    /**
     * Output filename (-o myapp.exe)
     */
    output: string;
    /**
     * Flag to indicate whether or notstdin was used for input
     */
    stdinUsed: boolean;
    /**
     * Path to the configure script
     */
    configureScript: string;
    /**
     * The file path of node binary
     */
    nodeSrcBinPath: string;
    /**
     * Remote asset path if available
     */
    remoteAsset: string;
    constructor(options: NexeOptions);
    addResource(absoluteFileName: string, content?: Buffer | string | File): Promise<number>;
    readFileAsync(file: string): Promise<NexeFile>;
    writeFileAsync(file: string, contents: string | Buffer): Promise<void>;
    replaceInFileAsync(file: string, replace: string | RegExp, value: string | StringReplacer): Promise<void>;
    setFileContentsAsync(file: string, contents: string | Buffer): Promise<void>;
    quit(error?: any): Promise<unknown>;
    assertBuild(): void;
    getNodeExecutableLocation(target?: NexeTarget): string;
    private _runBuildCommandAsync;
    private _configureAsync;
    build(): Promise<ReadStream>;
    private _shouldCompileBinaryAsync;
    compileAsync(target: NexeTarget): Promise<any>;
    code(): string;
    private _assembleDeliverable;
}