1 |
|
2 | import { Buffer } from 'buffer';
|
3 | import { ReadStream } from 'fs';
|
4 | import { Logger } from './logger';
|
5 | import { NexeOptions } from './options';
|
6 | import { NexeTarget } from './target';
|
7 | import { Bundle } from './fs/bundle';
|
8 | import { File } from 'resolve-dependencies';
|
9 | declare type StringReplacer = (match: string) => string;
|
10 | export interface NexeFile {
|
11 | filename: string;
|
12 | absPath: string;
|
13 | contents: string | Buffer;
|
14 | }
|
15 | export { NexeOptions };
|
16 | export declare class NexeError extends Error {
|
17 | constructor(m: string);
|
18 | }
|
19 | export declare class NexeCompiler {
|
20 | options: NexeOptions;
|
21 | |
22 |
|
23 |
|
24 | private start;
|
25 | private compileStep;
|
26 | log: Logger;
|
27 | |
28 |
|
29 |
|
30 | env: {
|
31 | [x: string]: string | undefined;
|
32 | TZ?: string | undefined;
|
33 | };
|
34 | |
35 |
|
36 |
|
37 | bundle: Bundle;
|
38 | |
39 |
|
40 |
|
41 | src: string;
|
42 | |
43 |
|
44 |
|
45 | files: NexeFile[];
|
46 | |
47 |
|
48 |
|
49 | shims: string[];
|
50 | |
51 |
|
52 |
|
53 | startup: string;
|
54 | |
55 |
|
56 |
|
57 | entrypoint: string | undefined;
|
58 | |
59 |
|
60 |
|
61 | targets: NexeTarget[];
|
62 | |
63 |
|
64 |
|
65 | target: NexeTarget;
|
66 | |
67 |
|
68 |
|
69 | output: string;
|
70 | |
71 |
|
72 |
|
73 | stdinUsed: boolean;
|
74 | |
75 |
|
76 |
|
77 | configureScript: string;
|
78 | |
79 |
|
80 |
|
81 | nodeSrcBinPath: string;
|
82 | |
83 |
|
84 |
|
85 | remoteAsset: string;
|
86 | constructor(options: NexeOptions);
|
87 | addResource(absoluteFileName: string, content?: Buffer | string | File): Promise<number>;
|
88 | readFileAsync(file: string): Promise<NexeFile>;
|
89 | writeFileAsync(file: string, contents: string | Buffer): Promise<void>;
|
90 | replaceInFileAsync(file: string, replace: string | RegExp, value: string | StringReplacer): Promise<void>;
|
91 | setFileContentsAsync(file: string, contents: string | Buffer): Promise<void>;
|
92 | quit(error?: any): Promise<unknown>;
|
93 | assertBuild(): void;
|
94 | getNodeExecutableLocation(target?: NexeTarget): string;
|
95 | private _runBuildCommandAsync;
|
96 | private _configureAsync;
|
97 | build(): Promise<ReadStream>;
|
98 | private _shouldCompileBinaryAsync;
|
99 | compileAsync(target: NexeTarget): Promise<any>;
|
100 | code(): string;
|
101 | private _assembleDeliverable;
|
102 | }
|