@markw65/monkeyc-optimizer 1.0.8 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import { mctree } from "@markw65/prettier-plugin-monkeyc";
2
+ export declare function getApiMapping(state?: ProgramState): Promise<ProgramStateNode | null>;
3
+ export declare function hasProperty(obj: unknown, prop: string): any;
4
+ export declare function isStateNode(node: StateNodeDecl): node is StateNode;
5
+ export declare function variableDeclarationName(node: mctree.TypedIdentifier): string;
6
+ export declare function collectNamespaces(ast: mctree.Program, state: ProgramState): ProgramStateNode;
7
+ export declare function traverseAst(node: mctree.Node, pre?: (node: mctree.Node) => void | null | false | (keyof mctree.NodeAll)[], post?: (node: mctree.Node) => void | null | false | mctree.Node): false | void | null | mctree.Node;
8
+ export declare function formatAst(node: mctree.Node, monkeyCSource?: string): string;
@@ -0,0 +1,6 @@
1
+ export declare function build_project(product: string, options: BuildConfig, lineCallback?: (line: string) => void): Promise<{
2
+ exe: string;
3
+ args: string[];
4
+ program: string;
5
+ product: string;
6
+ }>;
@@ -0,0 +1,324 @@
1
+ declare type InclusiveUnionKeys<U> = U extends unknown ? keyof U : never;
2
+ declare type InclusiveUnion<U> = {
3
+ [K in InclusiveUnionKeys<U>]: U extends any ? K extends keyof U ? U[K] : never : never;
4
+ };
5
+ declare type SubfieldsOfType<T, U> = {
6
+ [K in keyof T as T[K] extends U ? K : never]: T[K];
7
+ };
8
+ export declare type NodeAll = InclusiveUnion<Node>;
9
+ export declare type NodeSubFields = SubfieldsOfType<NodeAll, Node>;
10
+ export declare type NodeSubArrays = SubfieldsOfType<NodeAll, Node[]>;
11
+ interface BaseNode {
12
+ type: string;
13
+ loc?: SourceLocation | null | undefined;
14
+ start?: number;
15
+ end?: number;
16
+ range?: [number, number] | undefined;
17
+ }
18
+ export declare type Node = Identifier | Literal | Program | SwitchCase | CatchClause | VariableDeclarator | EnumStringBody | EnumStringMember | Statement | Expression | Property | Declaration | ImportStatement | AsTypeSpec | TypeSpecList | ClassElement | ClassBody | Comment;
19
+ export interface Comment extends BaseNode {
20
+ type: "Line" | "Block";
21
+ value: string;
22
+ }
23
+ interface SourceLocation {
24
+ source?: string | null | undefined;
25
+ start: Position;
26
+ end: Position;
27
+ }
28
+ export interface Position {
29
+ /** >= 1 */
30
+ line: number;
31
+ /** >= 0 */
32
+ column: number;
33
+ }
34
+ export interface Program extends BaseNode {
35
+ type: "Program";
36
+ body: Array<Declaration | ImportStatement>;
37
+ comments?: Array<Comment> | undefined;
38
+ }
39
+ export interface ModuleDeclaration extends BaseDeclaration {
40
+ type: "ModuleDeclaration";
41
+ body: Array<Declaration | ImportStatement>;
42
+ id: Identifier;
43
+ }
44
+ interface BaseFunction extends BaseNode {
45
+ params: Array<Identifier | AsExpression>;
46
+ body: BlockStatement;
47
+ }
48
+ export declare type Statement = ExpressionStatement | BlockStatement | ReturnStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | Declaration;
49
+ interface BaseStatement extends BaseNode {
50
+ }
51
+ export interface BlockStatement extends BaseStatement {
52
+ type: "BlockStatement";
53
+ body: Array<Statement>;
54
+ innerComments?: Array<Comment> | undefined;
55
+ }
56
+ export interface ExpressionStatement extends BaseStatement {
57
+ type: "ExpressionStatement";
58
+ expression: Expression;
59
+ }
60
+ export interface IfStatement extends BaseStatement {
61
+ type: "IfStatement";
62
+ test: Expression;
63
+ consequent: Statement;
64
+ alternate?: Statement | null | undefined;
65
+ }
66
+ export interface BreakStatement extends BaseStatement {
67
+ type: "BreakStatement";
68
+ }
69
+ export interface ContinueStatement extends BaseStatement {
70
+ type: "ContinueStatement";
71
+ }
72
+ export interface SwitchStatement extends BaseStatement {
73
+ type: "SwitchStatement";
74
+ discriminant: Expression;
75
+ cases: Array<SwitchCase>;
76
+ }
77
+ export interface ReturnStatement extends BaseStatement {
78
+ type: "ReturnStatement";
79
+ argument?: Expression | null | undefined;
80
+ }
81
+ export interface ThrowStatement extends BaseStatement {
82
+ type: "ThrowStatement";
83
+ argument: Expression;
84
+ }
85
+ export interface TryStatement extends BaseStatement {
86
+ type: "TryStatement";
87
+ block: BlockStatement;
88
+ handler?: CatchClause | CatchClauses | null | undefined;
89
+ finalizer?: BlockStatement | null | undefined;
90
+ }
91
+ export interface WhileStatement extends BaseStatement {
92
+ type: "WhileStatement";
93
+ test: Expression;
94
+ body: Statement;
95
+ }
96
+ export interface DoWhileStatement extends BaseStatement {
97
+ type: "DoWhileStatement";
98
+ body: Statement;
99
+ test: Expression;
100
+ }
101
+ export interface ForStatement extends BaseStatement {
102
+ type: "ForStatement";
103
+ init?: VariableDeclaration | Expression | null | undefined;
104
+ test?: Expression | null | undefined;
105
+ update?: Expression | null | undefined;
106
+ body: Statement;
107
+ }
108
+ export declare type Declaration = ClassDeclaration | EnumDeclaration | FunctionDeclaration | ModuleDeclaration | TypedefDeclaration | VariableDeclaration;
109
+ interface BaseDeclaration extends BaseStatement {
110
+ attrs?: AttributeList;
111
+ }
112
+ export interface FunctionDeclaration extends BaseFunction, BaseDeclaration {
113
+ type: "FunctionDeclaration";
114
+ id: Identifier;
115
+ body: BlockStatement;
116
+ optimizable?: boolean;
117
+ hasOverride?: boolean;
118
+ }
119
+ export interface VariableDeclaration extends BaseDeclaration {
120
+ type: "VariableDeclaration";
121
+ declarations: Array<VariableDeclarator>;
122
+ kind: "var" | "const";
123
+ }
124
+ export interface VariableDeclarator extends BaseNode {
125
+ type: "VariableDeclarator";
126
+ id: Identifier | AsExpression;
127
+ init?: Expression | null | undefined;
128
+ kind: "var" | "const";
129
+ }
130
+ declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | Literal | UnaryExpression | UpdateExpression | BinaryExpression | AsExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier;
131
+ export interface BaseExpression extends BaseNode {
132
+ enumType?: string | Node;
133
+ }
134
+ export interface ThisExpression extends BaseExpression {
135
+ type: "ThisExpression";
136
+ text: string;
137
+ }
138
+ export interface ArrayExpression extends BaseExpression {
139
+ type: "ArrayExpression";
140
+ elements: Array<Expression>;
141
+ }
142
+ export interface ObjectExpression extends BaseExpression {
143
+ type: "ObjectExpression";
144
+ properties: Array<Property>;
145
+ }
146
+ export interface Property extends BaseNode {
147
+ type: "Property";
148
+ key: Expression;
149
+ value: Expression;
150
+ kind: "init";
151
+ }
152
+ export interface SequenceExpression extends BaseExpression {
153
+ type: "SequenceExpression";
154
+ expressions: Array<Expression>;
155
+ }
156
+ interface BaseUnaryExpression extends BaseExpression {
157
+ type: "UnaryExpression";
158
+ prefix: true;
159
+ }
160
+ interface TrueUnaryExpression extends BaseUnaryExpression {
161
+ operator: UnaryOperator;
162
+ argument: Expression;
163
+ }
164
+ interface SymbolExpression extends BaseUnaryExpression {
165
+ operator: ":";
166
+ argument: Identifier;
167
+ }
168
+ export declare type UnaryExpression = TrueUnaryExpression | SymbolExpression;
169
+ export interface BinaryExpression extends BaseExpression {
170
+ type: "BinaryExpression";
171
+ operator: BinaryOperator;
172
+ left: Expression;
173
+ right: Expression;
174
+ }
175
+ export interface AsExpression extends BaseExpression {
176
+ type: "BinaryExpression";
177
+ operator: "as";
178
+ left: Expression;
179
+ right: TypeSpecList;
180
+ }
181
+ export interface AssignmentExpression extends BaseExpression {
182
+ type: "AssignmentExpression";
183
+ operator: AssignmentOperator;
184
+ left: Identifier | MemberExpression;
185
+ right: Expression;
186
+ }
187
+ export interface UpdateExpression extends BaseExpression {
188
+ type: "UpdateExpression";
189
+ operator: UpdateOperator;
190
+ argument: Expression;
191
+ prefix: boolean;
192
+ }
193
+ export interface LogicalExpression extends BaseExpression {
194
+ type: "LogicalExpression";
195
+ operator: LogicalOperator;
196
+ left: Expression;
197
+ right: Expression;
198
+ }
199
+ export interface ConditionalExpression extends BaseExpression {
200
+ type: "ConditionalExpression";
201
+ test: Expression;
202
+ alternate: Expression;
203
+ consequent: Expression;
204
+ }
205
+ interface BaseCallExpression extends BaseExpression {
206
+ callee: Expression;
207
+ arguments: Array<Expression>;
208
+ }
209
+ export declare type CallExpression = SimpleCallExpression | NewExpression;
210
+ export interface SimpleCallExpression extends BaseCallExpression {
211
+ type: "CallExpression";
212
+ }
213
+ export interface NewExpression extends BaseCallExpression {
214
+ type: "NewExpression";
215
+ }
216
+ export interface MemberExpression extends BaseExpression {
217
+ type: "MemberExpression";
218
+ object: Expression;
219
+ property: Expression;
220
+ computed: boolean;
221
+ }
222
+ export interface SwitchCase extends BaseNode {
223
+ type: "SwitchCase";
224
+ test?: Expression | null | undefined;
225
+ consequent: Array<Statement>;
226
+ }
227
+ export interface CatchClause extends BaseNode {
228
+ type: "CatchClause";
229
+ param: Identifier | null;
230
+ body: BlockStatement;
231
+ }
232
+ export interface CatchClauses extends BaseNode {
233
+ type: "CatchClauses";
234
+ catches: CatchClause[];
235
+ }
236
+ export interface Identifier extends BaseNode, BaseExpression {
237
+ type: "Identifier";
238
+ name: string;
239
+ }
240
+ export interface Literal extends BaseNode, BaseExpression {
241
+ type: "Literal";
242
+ value: string | boolean | number | null;
243
+ raw?: string | undefined;
244
+ }
245
+ export declare type UnaryOperator = "-" | "+" | "!" | "~" | " as";
246
+ export declare type BinaryOperator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "has" | "instanceof";
247
+ export declare type LogicalOperator = "||" | "&&";
248
+ export declare type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | "|=" | "^=" | "&=";
249
+ export declare type UpdateOperator = "++" | "--";
250
+ export interface ClassDeclaration extends BaseDeclaration {
251
+ type: "ClassDeclaration";
252
+ id: Identifier;
253
+ superClass?: Expression | null | undefined;
254
+ body: ClassBody;
255
+ }
256
+ export interface ClassBody extends BaseStatement {
257
+ type: "ClassBody";
258
+ body: Array<ClassElement>;
259
+ }
260
+ export interface ClassElement extends BaseStatement {
261
+ type: "ClassElement";
262
+ item: Omit<Declaration, "ModuleDeclaration">;
263
+ }
264
+ export interface EnumDeclaration extends BaseDeclaration {
265
+ type: "EnumDeclaration";
266
+ id?: Identifier | null;
267
+ body: EnumStringBody;
268
+ }
269
+ export interface EnumStringBody extends BaseNode {
270
+ type: "EnumStringBody";
271
+ members: Array<EnumStringMember | Identifier>;
272
+ enumType?: string | Node;
273
+ }
274
+ export interface EnumStringMember extends BaseNode {
275
+ type: "EnumStringMember";
276
+ id: Identifier;
277
+ init: Expression;
278
+ enumType?: string | Node;
279
+ }
280
+ export interface TypedefDeclaration extends BaseDeclaration {
281
+ type: "TypedefDeclaration";
282
+ id: Identifier;
283
+ ts: AsTypeSpec;
284
+ }
285
+ export interface AsTypeSpec extends Omit<UnaryExpression, "operator" | "argument"> {
286
+ operator: " as";
287
+ argument: TypeSpecList;
288
+ }
289
+ export interface TypeSpecList extends BaseNode {
290
+ type: "TypeSpecList";
291
+ ts: Array<TypeSpecPart>;
292
+ }
293
+ export interface TypeSpecPart extends BaseNode {
294
+ type: "TypeSpecPart";
295
+ name: Identifier | MemberExpression;
296
+ body?: BlockStatement;
297
+ callspec?: MethodDefinition;
298
+ generics?: Array<TypeSpecList>;
299
+ }
300
+ export interface MethodDefinition extends BaseNode {
301
+ type: "MethodDefinition";
302
+ kind: "method";
303
+ key: "";
304
+ params: Array<Identifier | AsExpression>;
305
+ returnType: AsTypeSpec;
306
+ }
307
+ export declare type AccessSpecifier = "static" | "private" | "protected" | "hidden" | "public";
308
+ export interface AttributeList extends BaseNode {
309
+ type: "AttributeList";
310
+ attrs?: Attribute[];
311
+ access?: AccessSpecifier[];
312
+ }
313
+ declare type Attribute = SymbolExpression | CallExpression;
314
+ export declare type ImportStatement = ImportModule | Using;
315
+ export interface ImportModule extends BaseNode {
316
+ type: "ImportModule";
317
+ id: MemberExpression;
318
+ }
319
+ export interface Using extends BaseNode {
320
+ type: "Using";
321
+ id: MemberExpression;
322
+ as: Identifier;
323
+ }
324
+ export {};
@@ -0,0 +1,51 @@
1
+ import { ManifestXML } from "./manifest";
2
+ export declare type Target = {
3
+ product: string;
4
+ qualifier: JungleQualifier;
5
+ shape?: string;
6
+ group?: {
7
+ optimizerConfig: JungleQualifier;
8
+ dir?: string;
9
+ key?: string;
10
+ };
11
+ };
12
+ declare type LangResourcePaths = {
13
+ [key: string]: string[];
14
+ };
15
+ declare type BarrelAnnotations = {
16
+ [key: string]: string[];
17
+ };
18
+ declare type BarrelMap = {
19
+ [key: string]: ResolvedBarrel;
20
+ };
21
+ declare type OptBarrelMap = Record<string, {
22
+ rawBarrelDir: string;
23
+ manifest: string;
24
+ jungleFiles: string[];
25
+ optBarrelDir: string;
26
+ }>;
27
+ export declare type JungleQualifier = {
28
+ sourcePath?: string[];
29
+ sourceExcludes?: string[];
30
+ excludeAnnotations?: string[];
31
+ resourcePath?: string[];
32
+ lang?: LangResourcePaths;
33
+ barrelPath?: (string | string[])[];
34
+ annotations?: BarrelAnnotations;
35
+ barrelMap?: BarrelMap;
36
+ optBarrels?: OptBarrelMap;
37
+ };
38
+ declare type JungleInfoBase = {
39
+ jungles: string[];
40
+ manifest: string;
41
+ xml: ManifestXML;
42
+ annotations?: string[];
43
+ };
44
+ export declare type ResolvedJungle = JungleInfoBase & {
45
+ targets: Target[];
46
+ };
47
+ export declare type ResolvedBarrel = JungleInfoBase & {
48
+ qualifier: JungleQualifier;
49
+ };
50
+ export declare function get_jungle(jungles: string, options: BuildConfig): Promise<ResolvedJungle>;
51
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function launchSimulator(): Promise<void>;
2
+ export declare function simulateProgram(prg: string, device: string, test?: boolean): Promise<void>;
@@ -0,0 +1,71 @@
1
+ declare type iqApplication = {
2
+ $: {
3
+ id: string;
4
+ entry: string;
5
+ launcherIcon: string;
6
+ minSdkVersion: string;
7
+ name: string;
8
+ type: string;
9
+ version: string;
10
+ };
11
+ "iq:products"?: Array<{
12
+ "iq:product"?: Array<{
13
+ $: {
14
+ id: string;
15
+ };
16
+ }>;
17
+ }>;
18
+ "iq:barrels"?: Array<{
19
+ "iq:depends"?: Array<{
20
+ $: {
21
+ name: string;
22
+ version: string;
23
+ };
24
+ }>;
25
+ }>;
26
+ "iq:permissions"?: Array<{
27
+ "iq:uses-permission"?: Array<{
28
+ $: {
29
+ id: string;
30
+ };
31
+ }>;
32
+ }>;
33
+ "iq:languages"?: Array<{
34
+ "iq:language"?: Array<string>;
35
+ }>;
36
+ };
37
+ declare type iqBarrel = {
38
+ $: {
39
+ id: string;
40
+ module: string;
41
+ version: string;
42
+ };
43
+ "iq:products"?: Array<{
44
+ "iq:product"?: Array<{
45
+ $: {
46
+ id: string;
47
+ };
48
+ }>;
49
+ }>;
50
+ "iq:annotations"?: Array<{
51
+ "iq:annotation"?: Array<string>;
52
+ }>;
53
+ };
54
+ export declare type ManifestXML = {
55
+ "iq:manifest": {
56
+ $: {
57
+ "xmlns:iq": string;
58
+ };
59
+ "iq:application": Array<iqApplication>;
60
+ "iq:barrel": Array<iqBarrel>;
61
+ };
62
+ };
63
+ export declare function readManifest(manifest: string): Promise<ManifestXML>;
64
+ export declare function writeManifest(filename: string, xml: ManifestXML): Promise<void>;
65
+ export declare function manifestProducts(manifest: ManifestXML): string[];
66
+ export declare function manifestBarrels(manifest: ManifestXML): string[];
67
+ export declare function manifestDropBarrels(manifest: ManifestXML): void;
68
+ export declare function manifestBarrelName(manifestName: string, manifest: ManifestXML): string;
69
+ export declare function manifestAnnotations(manifest: ManifestXML): string[];
70
+ export declare function checkManifest(manifest: ManifestXML, products: string[]): Promise<boolean>;
71
+ export {};
@@ -0,0 +1,7 @@
1
+ import { mctree } from "@markw65/prettier-plugin-monkeyc";
2
+ export declare function getFileSources(fnMap: FilesToOptimizeMap): Promise<void>;
3
+ export declare function getFileASTs(fnMap: FilesToOptimizeMap): Promise<boolean>;
4
+ export declare function analyze(fnMap: FilesToOptimizeMap): Promise<ProgramState>;
5
+ export declare function getLiteralFromDecls(decls: StateNodeDecl[]): mctree.Literal | mctree.AsExpression;
6
+ export declare function getLiteralNode(node: mctree.Node): null | mctree.Literal | mctree.AsExpression;
7
+ export declare function optimizeMonkeyC(fnMap: FilesToOptimizeMap): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const negativeFixups: string[];
@@ -0,0 +1,177 @@
1
+ import { get_jungle, Target, ResolvedJungle } from "./jungles";
2
+ import { launchSimulator, simulateProgram } from "./launch";
3
+ import { copyRecursiveAsNeeded } from "./util";
4
+ import { mctree } from "@markw65/prettier-plugin-monkeyc";
5
+ export { copyRecursiveAsNeeded, launchSimulator, simulateProgram, get_jungle, ResolvedJungle, mctree, };
6
+ export declare const defaultConfig: {
7
+ outputPath: string;
8
+ workspace: string;
9
+ };
10
+ declare global {
11
+ type BuildConfig = {
12
+ workspace?: string;
13
+ jungleFiles?: string;
14
+ developerKeyPath?: string;
15
+ typeCheckLevel?: string;
16
+ compilerOptions?: string;
17
+ compilerWarnings?: boolean;
18
+ simulatorBuild?: boolean;
19
+ releaseBuild?: boolean;
20
+ testBuild?: boolean;
21
+ products?: string[];
22
+ buildDir?: string;
23
+ outputPath?: string;
24
+ program?: string;
25
+ skipOptimization?: boolean;
26
+ checkManifest?: boolean;
27
+ device?: string;
28
+ ignoredExcludeAnnotations?: string;
29
+ ignoredAnnotations?: string;
30
+ ignoredSourcePaths?: string;
31
+ returnCommand?: boolean;
32
+ _cache?: {
33
+ barrels?: Record<string, ResolvedJungle>;
34
+ barrelMap?: Record<string, Record<string, ResolvedJungle>>;
35
+ };
36
+ };
37
+ type StateNodeDecl = StateNode | mctree.EnumStringMember | mctree.TypedIdentifier | mctree.EnumDeclaration | mctree.TypedefDeclaration | mctree.VariableDeclarator;
38
+ type StateNodeDecls = {
39
+ [key: string]: StateNodeDecl[];
40
+ };
41
+ type ProgramStateNode = {
42
+ type: "Program";
43
+ node: null | undefined;
44
+ name: "$";
45
+ fullName: "$";
46
+ decls?: StateNodeDecls;
47
+ stack?: null | undefined;
48
+ };
49
+ type ModuleStateNode = {
50
+ type: "ModuleDeclaration";
51
+ name: string;
52
+ fullName: string;
53
+ node: mctree.ModuleDeclaration;
54
+ stack?: ProgramStateStack;
55
+ decls?: StateNodeDecls;
56
+ };
57
+ type ClassStateNode = {
58
+ type: "ClassDeclaration";
59
+ name: string;
60
+ fullName: string;
61
+ node: mctree.ClassDeclaration;
62
+ decls?: StateNodeDecls;
63
+ stack?: ProgramStateStack;
64
+ superClass: ClassStateNode[] | true;
65
+ };
66
+ type FunctionStateNode = {
67
+ type: "FunctionDeclaration";
68
+ name: string;
69
+ fullName: string;
70
+ node: mctree.FunctionDeclaration;
71
+ stack?: ProgramStateStack;
72
+ decls?: undefined;
73
+ };
74
+ type BlockStateNode = {
75
+ type: "BlockStatement";
76
+ name?: null | undefined;
77
+ fullName?: null | undefined;
78
+ node: mctree.BlockStatement;
79
+ decls?: StateNodeDecls;
80
+ stack?: null | undefined;
81
+ };
82
+ type StateNode = ProgramStateNode | FunctionStateNode | BlockStateNode | ClassStateNode | ModuleStateNode;
83
+ type ProgramStateStack = StateNode[];
84
+ export type ProgramState = {
85
+ allFunctions?: FunctionStateNode[];
86
+ allClasses?: ClassStateNode[];
87
+ stack?: ProgramStateStack;
88
+ shouldExclude?: (node: any) => any;
89
+ pre?: (node: mctree.Node) => null | false | (keyof mctree.NodeAll)[];
90
+ post?: (node: mctree.Node) => null | false | mctree.Node;
91
+ lookup?: (node: mctree.Node, name?: string | null, stack?: ProgramStateStack) => [string, StateNodeDecl[], ProgramStateStack];
92
+ traverse?: (node: mctree.Node) => void | boolean | mctree.Node;
93
+ exposed?: {
94
+ [key: string]: true;
95
+ };
96
+ calledFunctions?: {
97
+ [key: string]: unknown[];
98
+ };
99
+ localsStack?: {
100
+ node?: mctree.Node;
101
+ map?: {
102
+ [key: string]: true | string;
103
+ };
104
+ inners?: {
105
+ [key: string]: true;
106
+ };
107
+ }[];
108
+ index?: {
109
+ [key: string]: unknown[];
110
+ };
111
+ constants?: {
112
+ [key: string]: mctree.Literal;
113
+ };
114
+ };
115
+ type ExcludeAnnotationsMap = {
116
+ [key: string]: boolean;
117
+ };
118
+ type FilesToOptimizeMap = {
119
+ [key: string]: {
120
+ output: string;
121
+ excludeAnnotations: ExcludeAnnotationsMap;
122
+ monkeyCSource?: string;
123
+ ast?: mctree.Program;
124
+ parserError?: Error;
125
+ hasTests?: boolean;
126
+ };
127
+ };
128
+ var lastModifiedSource: number;
129
+ }
130
+ /**
131
+ *
132
+ * @param {string | null} product
133
+ * @param {BuildConfig} options
134
+ * @returns
135
+ */
136
+ export declare function buildOptimizedProject(product: string | null, options: BuildConfig): Promise<{
137
+ exe: string;
138
+ args: string[];
139
+ program: string;
140
+ product: string;
141
+ hasTests: boolean;
142
+ }>;
143
+ /**
144
+ *
145
+ * @param {BuildConfig} options
146
+ * @returns
147
+ */
148
+ export declare function generateOptimizedProject(options: BuildConfig): Promise<{
149
+ jungleFiles: string;
150
+ program: string;
151
+ hasTests?: undefined;
152
+ } | {
153
+ jungleFiles: string;
154
+ program: string;
155
+ hasTests: boolean;
156
+ }>;
157
+ export declare type PreAnalysis = {
158
+ fnMap: FilesToOptimizeMap;
159
+ paths: string[];
160
+ };
161
+ declare type RequiredNonNull<T> = {
162
+ [K1 in keyof T]-?: {
163
+ [K2 in keyof T[K1]]-?: NonNullable<T[K1][K2]>;
164
+ };
165
+ };
166
+ export declare type Analysis = {
167
+ fnMap: RequiredNonNull<FilesToOptimizeMap>;
168
+ paths: string[];
169
+ state: ProgramState;
170
+ };
171
+ export declare function getProjectAnalysis(targets: Target[], analysis: PreAnalysis | null, options: BuildConfig): Promise<Analysis | PreAnalysis>;
172
+ /**
173
+ *
174
+ * @param {BuildConfig} options
175
+ * @returns
176
+ */
177
+ export declare function generateApiMirTests(options: BuildConfig): Promise<void>;
@@ -0,0 +1,14 @@
1
+ export declare const isWin: boolean;
2
+ export declare const appSupport: string;
3
+ export declare const connectiq: string;
4
+ export declare function getSdkPath(): Promise<string>;
5
+ export declare function getDeviceInfo(): Promise<{
6
+ [key: string]: {
7
+ appTypes: {
8
+ memoryLimit: number;
9
+ type: string;
10
+ }[];
11
+ deviceFamily: string;
12
+ };
13
+ }>;
14
+ export declare function getLanguages(): Promise<any>;
@@ -0,0 +1,14 @@
1
+ export declare function globa(pattern: string, options?: {
2
+ [key: string]: unknown;
3
+ }): Promise<Array<string>>;
4
+ export declare function last_modified(inputs: string[]): Promise<number>;
5
+ export declare function first_modified(inputs: string[]): Promise<number>;
6
+ export declare function pushUnique<T>(arr: T[], value: T): void;
7
+ declare type LineHandler = (line: string) => void;
8
+ export declare function spawnByLine(command: string, args: string[], lineHandlers: LineHandler | LineHandler[], options?: {
9
+ [key: string]: unknown;
10
+ }): Promise<void>;
11
+ export declare function readByLine(file: string, lineHandler: LineHandler): Promise<unknown>;
12
+ export declare function promiseAll<T>(promiseFn: (i: number) => Promise<T>, parallelism: number): Promise<T[]>;
13
+ export declare function copyRecursiveAsNeeded(source: string, target: string, filter?: (src: string, tgt: string) => boolean): Promise<void>;
14
+ export {};