@idlizer/core 2.1.2 → 2.1.7
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.
- package/build/lib/src/LanguageWriters/ArgConvertors.d.ts +3 -4
- package/build/lib/src/LanguageWriters/ArgConvertors.js +43 -32
- package/build/lib/src/LanguageWriters/LanguageWriter.d.ts +35 -17
- package/build/lib/src/LanguageWriters/LanguageWriter.js +30 -56
- package/build/lib/src/LanguageWriters/convertors/CJConvertors.d.ts +3 -1
- package/build/lib/src/LanguageWriters/convertors/CJConvertors.js +32 -11
- package/build/lib/src/LanguageWriters/convertors/CppConvertors.d.ts +5 -2
- package/build/lib/src/LanguageWriters/convertors/CppConvertors.js +71 -62
- package/build/lib/src/LanguageWriters/convertors/ETSConvertors.d.ts +1 -1
- package/build/lib/src/LanguageWriters/convertors/ETSConvertors.js +9 -19
- package/build/lib/src/LanguageWriters/convertors/InteropConvertors.d.ts +4 -2
- package/build/lib/src/LanguageWriters/convertors/InteropConvertors.js +10 -3
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.d.ts +2 -1
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.js +24 -4
- package/build/lib/src/LanguageWriters/convertors/TSConvertors.d.ts +8 -4
- package/build/lib/src/LanguageWriters/convertors/TSConvertors.js +87 -33
- package/build/lib/src/LanguageWriters/nameConvertor.d.ts +3 -1
- package/build/lib/src/LanguageWriters/nameConvertor.js +5 -1
- package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.d.ts +19 -11
- package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.js +34 -47
- package/build/lib/src/LanguageWriters/writers/CLikeLanguageWriter.d.ts +4 -1
- package/build/lib/src/LanguageWriters/writers/CLikeLanguageWriter.js +1 -1
- package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.d.ts +9 -9
- package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.js +15 -24
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.d.ts +17 -8
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.js +48 -23
- package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.d.ts +4 -6
- package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.js +15 -14
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.d.ts +13 -8
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.js +33 -52
- package/build/lib/src/LibraryInterface.d.ts +1 -4
- package/build/lib/src/config.d.ts +813 -110
- package/build/lib/src/config.js +25 -3
- package/build/lib/src/configDescriber.d.ts +31 -4
- package/build/lib/src/configDescriber.js +101 -3
- package/build/lib/src/from-idl/DtsPrinter.js +31 -18
- package/build/lib/src/from-idl/IDLLinter.d.ts +40 -7
- package/build/lib/src/from-idl/IDLLinter.js +211 -25
- package/build/lib/src/from-idl/common.js +1 -1
- package/build/lib/src/from-idl/deserialize.d.ts +10 -1
- package/build/lib/src/from-idl/deserialize.js +486 -352
- package/build/lib/src/idl.d.ts +29 -19
- package/build/lib/src/idl.js +404 -119
- package/build/lib/src/idlize.d.ts +2 -1
- package/build/lib/src/idlize.js +82 -26
- package/build/lib/src/index.d.ts +4 -3
- package/build/lib/src/index.js +3 -2
- package/build/lib/src/options.d.ts +1 -1
- package/build/lib/src/peer-generation/BuilderClass.d.ts +0 -2
- package/build/lib/src/peer-generation/BuilderClass.js +0 -8
- package/build/lib/src/peer-generation/LayoutManager.d.ts +10 -3
- package/build/lib/src/peer-generation/LayoutManager.js +3 -2
- package/build/lib/src/peer-generation/Materialized.d.ts +1 -1
- package/build/lib/src/peer-generation/Materialized.js +3 -3
- package/build/lib/src/peer-generation/PeerClass.d.ts +3 -8
- package/build/lib/src/peer-generation/PeerClass.js +0 -1
- package/build/lib/src/peer-generation/PeerFile.d.ts +1 -2
- package/build/lib/src/peer-generation/PeerFile.js +1 -1
- package/build/lib/src/peer-generation/PeerLibrary.d.ts +12 -7
- package/build/lib/src/peer-generation/PeerLibrary.js +131 -67
- package/build/lib/src/peer-generation/ReferenceResolver.d.ts +1 -1
- package/build/lib/src/peer-generation/ReferenceResolver.js +2 -2
- package/build/lib/src/peer-generation/idl/IdlNameConvertor.d.ts +1 -0
- package/build/lib/src/peer-generation/idl/IdlNameConvertor.js +6 -2
- package/build/lib/src/peer-generation/idl/common.d.ts +3 -1
- package/build/lib/src/peer-generation/idl/common.js +21 -4
- package/build/lib/src/peer-generation/isMaterialized.js +28 -7
- package/build/lib/src/peer-generation/unions.d.ts +3 -2
- package/build/lib/src/peer-generation/unions.js +7 -3
- package/build/lib/src/resolveNamedNode.d.ts +3 -0
- package/build/lib/src/resolveNamedNode.js +105 -0
- package/build/lib/src/util.d.ts +8 -1
- package/build/lib/src/util.js +41 -3
- package/build/lib/src/visitor.d.ts +2 -1
- package/build/lib/src/visitor.js +109 -7
- package/package.json +2 -2
- package/webidl2.js/LICENSE +21 -0
- package/webidl2.js/README.md +827 -0
- package/webidl2.js/dist/package.json +3 -0
- package/webidl2.js/dist/webidl2.js +93 -19
|
@@ -12,10 +12,11 @@ export interface GenerateVisitor<T> {
|
|
|
12
12
|
tsSourceFile: ts.SourceFile;
|
|
13
13
|
visitor: GenerateVisitor<T>;
|
|
14
14
|
result: T;
|
|
15
|
+
isAux: boolean;
|
|
15
16
|
};
|
|
16
17
|
}): T;
|
|
17
18
|
}
|
|
18
|
-
export declare function generate<T>(inputFiles: string[], outputDir: string, visitorFactory: (sourceFile: ts.SourceFile, program: ts.Program, compilerHost: ts.CompilerHost) => GenerateVisitor<T>, options: GenerateOptions<T>): void;
|
|
19
|
+
export declare function generate<T>(baseDirs: string[], lookupDirs: string[], inputFiles: string[], auxInputFiles: string[], outputDir: string, stdlibFile: string, visitorFactory: (sourceFile: ts.SourceFile, program: ts.Program, compilerHost: ts.CompilerHost) => GenerateVisitor<T>, options: GenerateOptions<T>): void;
|
|
19
20
|
export declare const PACKAGE_IDLIZE_INTERNAL = "idlize.internal";
|
|
20
21
|
export declare function isInIdlize(entry: idl.IDLEntry | idl.IDLFile): boolean;
|
|
21
22
|
export declare function isInIdlizeInterop(entry: idl.IDLEntry | idl.IDLFile): boolean;
|
package/build/lib/src/idlize.js
CHANGED
|
@@ -16,6 +16,7 @@ import * as ts from "typescript";
|
|
|
16
16
|
import * as fs from "fs";
|
|
17
17
|
import * as path from "path";
|
|
18
18
|
import * as idl from "./idl";
|
|
19
|
+
import { isDefined } from "./util";
|
|
19
20
|
export function scanDirectory(dir, fileFilter, recursive = false) {
|
|
20
21
|
const dirsToVisit = [path.resolve(dir)];
|
|
21
22
|
const result = [];
|
|
@@ -45,7 +46,7 @@ export function scanInputDirs(inputDirs, fileFilter = undefined, recursive = fal
|
|
|
45
46
|
console.log("Resolved input directories:", resolvedInputDirs);
|
|
46
47
|
return resolvedInputDirs.flatMap(dir => {
|
|
47
48
|
if (fs.existsSync(dir) && fs.statSync(dir).isDirectory()) {
|
|
48
|
-
console.log(`Processing all
|
|
49
|
+
console.log(`Processing all definitions from directory: ${dir}`);
|
|
49
50
|
return scanDirectory(dir, fileFilter, recursive);
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
@@ -54,7 +55,10 @@ export function scanInputDirs(inputDirs, fileFilter = undefined, recursive = fal
|
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
function fileExists(fileName) {
|
|
59
|
+
return ts.sys.fileExists(fileName);
|
|
60
|
+
}
|
|
61
|
+
export function generate(baseDirs, lookupDirs, inputFiles, auxInputFiles, outputDir, stdlibFile, visitorFactory, options) {
|
|
58
62
|
var _a, _b, _c;
|
|
59
63
|
if (options.enableLog) {
|
|
60
64
|
console.log("Starting generation process...");
|
|
@@ -63,24 +67,81 @@ export function generate(inputFiles, outputDir, visitorFactory, options) {
|
|
|
63
67
|
console.error("Error: No input files specified.");
|
|
64
68
|
process.exit(1);
|
|
65
69
|
}
|
|
66
|
-
let input =
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
let input = new Set;
|
|
71
|
+
let auxInput = new Set;
|
|
72
|
+
{
|
|
73
|
+
const resolveOne = (file, tag) => {
|
|
69
74
|
const fullPath = path.resolve(file);
|
|
70
75
|
if (fs.existsSync(fullPath)) {
|
|
71
|
-
if (options.enableLog)
|
|
72
|
-
console.log(`Including
|
|
73
|
-
|
|
74
|
-
input.push(fullPath);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
console.warn(`Warning: Input file does not exist: ${fullPath}`);
|
|
76
|
+
if (options.enableLog)
|
|
77
|
+
console.log(`Including ${tag} file: ${fullPath}`);
|
|
78
|
+
return fullPath;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
else
|
|
81
|
+
console.warn(`Warning: ${tag} file does not exist: ${fullPath}`);
|
|
82
|
+
};
|
|
83
|
+
inputFiles.map(file => resolveOne(file, "file")).filter(isDefined).sort().map(file => input.add(file));
|
|
84
|
+
auxInputFiles.map(file => resolveOne(file, "aux file")).filter(isDefined).sort().map(file => auxInput.add(file));
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
const compilerHostBase = ts.createCompilerHost(options.compilerOptions);
|
|
87
|
+
const compilerHost = Object.assign(Object.assign({}, compilerHostBase), { resolveModuleNames: (moduleNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile) => {
|
|
88
|
+
const resolvedModules = [];
|
|
89
|
+
for (let moduleName of moduleNames) {
|
|
90
|
+
// TODO: move this replacement table to some external config...
|
|
91
|
+
{
|
|
92
|
+
const replacement = {
|
|
93
|
+
"../component/navigation": "@internal/component/ets/navigation",
|
|
94
|
+
"wrappedBuilderObject": "@internal/component/ets/common",
|
|
95
|
+
};
|
|
96
|
+
moduleName = replacement[moduleName] || moduleName;
|
|
97
|
+
}
|
|
98
|
+
let result = ts.resolveModuleName(moduleName, containingFile, options, compilerHostBase).resolvedModule;
|
|
99
|
+
if (result)
|
|
100
|
+
resolvedModules.push(result);
|
|
101
|
+
else {
|
|
102
|
+
// as a some fallback - try to resolve from parents of containingFile, lookupDirs
|
|
103
|
+
for (let pov of [path.dirname(containingFile), ...lookupDirs]) {
|
|
104
|
+
while (!result) {
|
|
105
|
+
for (const extension of ["", ".d.ts", ".d.ets"]) {
|
|
106
|
+
const candidate = `${moduleName}${extension}`;
|
|
107
|
+
if (path.isAbsolute(candidate) && fileExists(candidate)) {
|
|
108
|
+
result = { resolvedFileName: candidate, extension: ts.Extension.Dts, isExternalLibraryImport: false };
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const povCandidate = path.join(pov, candidate);
|
|
112
|
+
if (fileExists(povCandidate)) {
|
|
113
|
+
result = { resolvedFileName: povCandidate, extension: ts.Extension.Dts, isExternalLibraryImport: false };
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (result)
|
|
118
|
+
break;
|
|
119
|
+
result = ts.resolveModuleName(path.join(pov, moduleName), containingFile, options, compilerHostBase).resolvedModule;
|
|
120
|
+
if (result)
|
|
121
|
+
break;
|
|
122
|
+
result = ts.resolveModuleName(moduleName, pov, options, compilerHostBase).resolvedModule;
|
|
123
|
+
if (result)
|
|
124
|
+
break;
|
|
125
|
+
const nextPov = path.resolve(pov, "..");
|
|
126
|
+
if (nextPov == pov)
|
|
127
|
+
break;
|
|
128
|
+
if (baseDirs.every(baseDir => path.relative(baseDir, nextPov).startsWith("..")))
|
|
129
|
+
break;
|
|
130
|
+
pov = nextPov;
|
|
131
|
+
}
|
|
132
|
+
if (result)
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
if (!result)
|
|
136
|
+
console.warn(`Dts import at '${containingFile}', module '${moduleName}': unable to resolve source file path`);
|
|
137
|
+
resolvedModules.push(result);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return resolvedModules;
|
|
141
|
+
} });
|
|
142
|
+
if (!fs.existsSync(stdlibFile))
|
|
143
|
+
throw new Error("Unable to find stdlib.d.ts");
|
|
144
|
+
const program = ts.createProgram([...input.values(), ...auxInput.values(), stdlibFile], options.compilerOptions, compilerHost);
|
|
84
145
|
if (options.enableLog) {
|
|
85
146
|
console.log("Initialized TypeScript program with input files:", input);
|
|
86
147
|
}
|
|
@@ -91,15 +152,9 @@ export function generate(inputFiles, outputDir, visitorFactory, options) {
|
|
|
91
152
|
const dtsFileName2Visitor = {};
|
|
92
153
|
for (const sourceFile of program.getSourceFiles()) {
|
|
93
154
|
const resolvedSourceFileName = path.resolve(sourceFile.fileName);
|
|
94
|
-
const
|
|
95
|
-
if (!isExplicitFile) {
|
|
96
|
-
if (options.enableLog) {
|
|
97
|
-
console.log(`Skipping file: ${resolvedSourceFileName}`);
|
|
98
|
-
}
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
155
|
+
const isAux = !input.has(resolvedSourceFileName);
|
|
101
156
|
if (options.enableLog) {
|
|
102
|
-
console.log(`Processing file: ${resolvedSourceFileName}`);
|
|
157
|
+
console.log(`Processing ${isAux ? "aux " : ""}file: ${resolvedSourceFileName}`);
|
|
103
158
|
}
|
|
104
159
|
// Walk the tree to search for classes
|
|
105
160
|
const visitor = visitorFactory(sourceFile, program, compilerHost);
|
|
@@ -107,7 +162,8 @@ export function generate(inputFiles, outputDir, visitorFactory, options) {
|
|
|
107
162
|
dtsFileName2Visitor[sourceFile.fileName] = {
|
|
108
163
|
tsSourceFile: sourceFile,
|
|
109
164
|
visitor,
|
|
110
|
-
result
|
|
165
|
+
result,
|
|
166
|
+
isAux: isAux
|
|
111
167
|
};
|
|
112
168
|
}
|
|
113
169
|
for (const resolvedSourceFileName in dtsFileName2Visitor) {
|
|
@@ -117,7 +173,7 @@ export function generate(inputFiles, outputDir, visitorFactory, options) {
|
|
|
117
173
|
}
|
|
118
174
|
for (const resolvedSourceFileName in dtsFileName2Visitor) {
|
|
119
175
|
const visitorStaff = dtsFileName2Visitor[resolvedSourceFileName];
|
|
120
|
-
(_b = options.onSingleFile) === null || _b === void 0 ? void 0 : _b.call(options, visitorStaff.result, outputDir, visitorStaff.tsSourceFile);
|
|
176
|
+
(_b = options.onSingleFile) === null || _b === void 0 ? void 0 : _b.call(options, visitorStaff.result, outputDir, visitorStaff.tsSourceFile, visitorStaff.isAux);
|
|
121
177
|
}
|
|
122
178
|
(_c = options.onEnd) === null || _c === void 0 ? void 0 : _c.call(options, outputDir);
|
|
123
179
|
if (options.enableLog) {
|
package/build/lib/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./config";
|
|
2
2
|
export * from "./idl";
|
|
3
|
+
export * from "./resolveNamedNode";
|
|
3
4
|
export * from "./visitor";
|
|
4
5
|
export * from "./library";
|
|
5
6
|
export * from "./idlize";
|
|
@@ -46,8 +47,8 @@ export * from "./LanguageWriters";
|
|
|
46
47
|
export * from "./peer-generation/ReferenceResolver";
|
|
47
48
|
export * from "./peer-generation/idl/common";
|
|
48
49
|
export * from "./from-idl/IDLLinter";
|
|
49
|
-
export { fromIDL } from "./from-idl/common";
|
|
50
|
+
export { fromIDL, scanIDL } from "./from-idl/common";
|
|
50
51
|
export { idlToDtsString, CustomPrintVisitor } from "./from-idl/DtsPrinter";
|
|
51
|
-
export { toIDLFile, addSyntheticType, resolveSyntheticType } from "./from-idl/deserialize";
|
|
52
|
-
export { D, ConfigTypeInfer, ConfigSchema } from './configDescriber';
|
|
52
|
+
export { toIDLFile, addSyntheticType, resolveSyntheticType, IDLTokenInfoMap } from "./from-idl/deserialize";
|
|
53
|
+
export { D, ConfigTypeInfer, ConfigSchema, inspectSchema } from './configDescriber';
|
|
53
54
|
//# sourceMappingURL=index.d.ts.map
|
package/build/lib/src/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export * from "./config";
|
|
16
16
|
export * from "./idl";
|
|
17
|
+
export * from "./resolveNamedNode";
|
|
17
18
|
export * from "./visitor";
|
|
18
19
|
export * from "./library";
|
|
19
20
|
export * from "./idlize";
|
|
@@ -60,8 +61,8 @@ export * from "./LanguageWriters";
|
|
|
60
61
|
export * from "./peer-generation/ReferenceResolver";
|
|
61
62
|
export * from "./peer-generation/idl/common";
|
|
62
63
|
export * from "./from-idl/IDLLinter";
|
|
63
|
-
export { fromIDL } from "./from-idl/common";
|
|
64
|
+
export { fromIDL, scanIDL } from "./from-idl/common";
|
|
64
65
|
export { idlToDtsString, CustomPrintVisitor } from "./from-idl/DtsPrinter";
|
|
65
66
|
export { toIDLFile, addSyntheticType, resolveSyntheticType } from "./from-idl/deserialize";
|
|
66
|
-
export { D } from './configDescriber';
|
|
67
|
+
export { D, inspectSchema } from './configDescriber';
|
|
67
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@ import * as ts from "typescript";
|
|
|
2
2
|
export interface GenerateOptions<T> {
|
|
3
3
|
compilerOptions: ts.CompilerOptions;
|
|
4
4
|
onBegin?: (outDir: string, typeChecker: ts.TypeChecker) => void;
|
|
5
|
-
onSingleFile?: (entries: T, outDir: string, inputFile: ts.SourceFile) => void;
|
|
5
|
+
onSingleFile?: (entries: T, outDir: string, inputFile: ts.SourceFile, isAux: boolean) => void;
|
|
6
6
|
onEnd?: (outDir: string) => void;
|
|
7
7
|
enableLog?: boolean;
|
|
8
8
|
recursive?: boolean;
|
|
@@ -16,7 +16,5 @@ export declare class BuilderClass {
|
|
|
16
16
|
* Builder classes are classes with methods which have only one parameter and return only itself
|
|
17
17
|
*/
|
|
18
18
|
export declare function isBuilderClass(declaration: IDLInterface): boolean;
|
|
19
|
-
export declare const CUSTOM_BUILDER_CLASSES: BuilderClass[];
|
|
20
|
-
export declare function isCustomBuilderClass(name: string): boolean;
|
|
21
19
|
export declare function methodsGroupOverloads(methods: Method[]): Method[][];
|
|
22
20
|
//# sourceMappingURL=BuilderClass.d.ts.map
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
import { generatorConfiguration } from "../config";
|
|
16
|
-
import { isDefined } from "../util";
|
|
17
16
|
export class BuilderClass {
|
|
18
17
|
constructor(declaration, name, generics, isInterface, superClass, fields, constructors, methods, needBeGenerated = true) {
|
|
19
18
|
this.declaration = declaration;
|
|
@@ -35,9 +34,6 @@ export function isBuilderClass(declaration) {
|
|
|
35
34
|
if (generatorConfiguration().builderClasses.includes(className)) {
|
|
36
35
|
return true;
|
|
37
36
|
}
|
|
38
|
-
if (isCustomBuilderClass(className)) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
37
|
// TBD: update builder class check condition.
|
|
42
38
|
// Only SubTabBarStyle, BottomTabBarStyle, DotIndicator, and DigitIndicator classes
|
|
43
39
|
// are used for now.
|
|
@@ -58,10 +54,6 @@ export function isBuilderClass(declaration) {
|
|
|
58
54
|
return methods.every(it => it.type && className == it.type.getText() && it.parameters.length === 1)
|
|
59
55
|
*/
|
|
60
56
|
}
|
|
61
|
-
export const CUSTOM_BUILDER_CLASSES = [];
|
|
62
|
-
export function isCustomBuilderClass(name) {
|
|
63
|
-
return isDefined(CUSTOM_BUILDER_CLASSES.find(it => it.name === name));
|
|
64
|
-
}
|
|
65
57
|
export function methodsGroupOverloads(methods) {
|
|
66
58
|
const seenNames = new Set();
|
|
67
59
|
const groups = [];
|
|
@@ -2,15 +2,22 @@ import { IDLEntry } from "../idl";
|
|
|
2
2
|
export declare enum LayoutNodeRole {
|
|
3
3
|
PEER = 0,
|
|
4
4
|
INTERFACE = 1,
|
|
5
|
-
GLOBAL = 2
|
|
5
|
+
GLOBAL = 2,
|
|
6
|
+
COMPONENT = 3
|
|
7
|
+
}
|
|
8
|
+
export type LayoutTargetDescriptionHint = 'component.implementation' | 'component.interface' | 'component.function';
|
|
9
|
+
export interface LayoutTargetDescription {
|
|
10
|
+
node: IDLEntry;
|
|
11
|
+
role: LayoutNodeRole;
|
|
12
|
+
hint?: LayoutTargetDescriptionHint;
|
|
6
13
|
}
|
|
7
14
|
export interface LayoutManagerStrategy {
|
|
8
|
-
resolve(
|
|
15
|
+
resolve(target: LayoutTargetDescription): string;
|
|
9
16
|
}
|
|
10
17
|
export declare class LayoutManager {
|
|
11
18
|
private strategy;
|
|
12
19
|
constructor(strategy: LayoutManagerStrategy);
|
|
13
|
-
resolve(
|
|
20
|
+
resolve(target: LayoutTargetDescription): string;
|
|
14
21
|
static Empty(): LayoutManager;
|
|
15
22
|
}
|
|
16
23
|
//# sourceMappingURL=LayoutManager.d.ts.map
|
|
@@ -17,13 +17,14 @@ export var LayoutNodeRole;
|
|
|
17
17
|
LayoutNodeRole[LayoutNodeRole["PEER"] = 0] = "PEER";
|
|
18
18
|
LayoutNodeRole[LayoutNodeRole["INTERFACE"] = 1] = "INTERFACE";
|
|
19
19
|
LayoutNodeRole[LayoutNodeRole["GLOBAL"] = 2] = "GLOBAL";
|
|
20
|
+
LayoutNodeRole[LayoutNodeRole["COMPONENT"] = 3] = "COMPONENT";
|
|
20
21
|
})(LayoutNodeRole || (LayoutNodeRole = {}));
|
|
21
22
|
export class LayoutManager {
|
|
22
23
|
constructor(strategy) {
|
|
23
24
|
this.strategy = strategy;
|
|
24
25
|
}
|
|
25
|
-
resolve(
|
|
26
|
-
return this.strategy.resolve(
|
|
26
|
+
resolve(target) {
|
|
27
|
+
return this.strategy.resolve(target);
|
|
27
28
|
}
|
|
28
29
|
////////////////////////////////////////////////////////////////////
|
|
29
30
|
static Empty() {
|
|
@@ -59,6 +59,6 @@ export declare class MaterializedClass implements PeerClassBase {
|
|
|
59
59
|
}
|
|
60
60
|
export declare function createDestroyPeerMethod(clazz: MaterializedClass): MaterializedMethod | undefined;
|
|
61
61
|
export declare function getInternalClassName(name: string): string;
|
|
62
|
-
export declare function getInternalClassQualifiedName(target: idl.IDLEntry): string;
|
|
62
|
+
export declare function getInternalClassQualifiedName(target: idl.IDLEntry, pattern?: idl.QNPattern): string;
|
|
63
63
|
export declare function getMaterializedFileName(name: string): string;
|
|
64
64
|
//# sourceMappingURL=Materialized.d.ts.map
|
|
@@ -135,13 +135,13 @@ export function createDestroyPeerMethod(clazz) {
|
|
|
135
135
|
if (clazz.isGlobalScope() || clazz.isStaticMaterialized) {
|
|
136
136
|
return undefined;
|
|
137
137
|
}
|
|
138
|
-
return new MaterializedMethod(clazz.
|
|
138
|
+
return new MaterializedMethod(idl.getQualifiedName(clazz.decl, "namespace.name").split('.').join('_'), clazz.getImplementationName(), [], idl.IDLVoidType, false, new Method('destroyPeer', new NamedMethodSignature(idl.IDLVoidType, [idl.createReferenceType(clazz.decl)], ['peer'])));
|
|
139
139
|
}
|
|
140
140
|
export function getInternalClassName(name) {
|
|
141
141
|
return `${name}Internal`;
|
|
142
142
|
}
|
|
143
|
-
export function getInternalClassQualifiedName(target) {
|
|
144
|
-
return getInternalClassName(qualifiedName(target, "."));
|
|
143
|
+
export function getInternalClassQualifiedName(target, pattern = "package.namespace.name") {
|
|
144
|
+
return getInternalClassName(qualifiedName(target, ".", pattern));
|
|
145
145
|
}
|
|
146
146
|
export function getMaterializedFileName(name) {
|
|
147
147
|
const pascalCase = name.split('_').map(x => capitalize(x)).join('');
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { IDLProperty } from "../idl";
|
|
1
|
+
import { IDLFile, IDLProperty } from "../idl";
|
|
2
2
|
import { PeerMethod } from "./PeerMethod";
|
|
3
|
-
import { PeerFile } from "./PeerFile";
|
|
4
3
|
export interface PeerClassBase {
|
|
5
4
|
generatedName(isCallSignature: boolean): string;
|
|
6
5
|
getComponentName(): string;
|
|
7
6
|
}
|
|
8
7
|
export declare class PeerClass implements PeerClassBase {
|
|
9
|
-
readonly file:
|
|
8
|
+
readonly file: IDLFile;
|
|
10
9
|
readonly componentName: string;
|
|
11
10
|
readonly originalFilename: string;
|
|
12
|
-
constructor(file:
|
|
11
|
+
constructor(file: IDLFile, componentName: string, originalFilename: string);
|
|
13
12
|
generatedName(isCallSignature: boolean): string;
|
|
14
13
|
getComponentName(): string;
|
|
15
14
|
methods: PeerMethod[];
|
|
@@ -19,10 +18,6 @@ export declare class PeerClass implements PeerClassBase {
|
|
|
19
18
|
originalParentFilename: string | undefined;
|
|
20
19
|
parentComponentName: string | undefined;
|
|
21
20
|
attributesFields: IDLProperty[];
|
|
22
|
-
attributesTypes: {
|
|
23
|
-
typeName: string;
|
|
24
|
-
content: string;
|
|
25
|
-
}[];
|
|
26
21
|
hasGenericType: boolean;
|
|
27
22
|
}
|
|
28
23
|
export declare function createConstructPeerMethod(clazz: PeerClass): PeerMethod;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as idl from '../idl';
|
|
2
2
|
import { PeerClass } from "./PeerClass";
|
|
3
|
-
|
|
4
|
-
export declare class PeerFile implements LibraryFileInterface {
|
|
3
|
+
export declare class PeerFile1 {
|
|
5
4
|
readonly file: idl.IDLFile;
|
|
6
5
|
readonly peers: Map<string, PeerClass>;
|
|
7
6
|
constructor(file: idl.IDLFile);
|
|
@@ -6,7 +6,6 @@ import { ArgConvertor } from "../LanguageWriters/ArgConvertors";
|
|
|
6
6
|
import { LibraryInterface } from '../LibraryInterface';
|
|
7
7
|
import { BuilderClass } from './BuilderClass';
|
|
8
8
|
import { MaterializedClass } from './Materialized';
|
|
9
|
-
import { PeerFile } from './PeerFile';
|
|
10
9
|
import { LayoutManager, LayoutManagerStrategy } from './LayoutManager';
|
|
11
10
|
import { IDLLibrary } from '../library';
|
|
12
11
|
export interface GlobalScopeDeclarations {
|
|
@@ -10253,6 +10252,7 @@ export declare const lenses: {
|
|
|
10253
10252
|
};
|
|
10254
10253
|
export declare class PeerLibrary implements LibraryInterface {
|
|
10255
10254
|
language: Language;
|
|
10255
|
+
readonly useMemoM3: boolean;
|
|
10256
10256
|
private _cachedIdlLibrary?;
|
|
10257
10257
|
asIDLLibrary(): IDLLibrary;
|
|
10258
10258
|
get globals(): GlobalScopeDeclarations[];
|
|
@@ -10260,12 +10260,13 @@ export declare class PeerLibrary implements LibraryInterface {
|
|
|
10260
10260
|
private _syntheticFile;
|
|
10261
10261
|
initSyntheticEntries(file: idl.IDLFile): void;
|
|
10262
10262
|
getSyntheticData(): idl.IDLInterface[];
|
|
10263
|
-
readonly files:
|
|
10263
|
+
readonly files: idl.IDLFile[];
|
|
10264
|
+
readonly auxFiles: idl.IDLFile[];
|
|
10264
10265
|
readonly builderClasses: Map<string, BuilderClass>;
|
|
10265
10266
|
get buildersToGenerate(): BuilderClass[];
|
|
10266
10267
|
readonly materializedClasses: Map<string, MaterializedClass>;
|
|
10267
10268
|
get materializedToGenerate(): MaterializedClass[];
|
|
10268
|
-
constructor(language: Language);
|
|
10269
|
+
constructor(language: Language, useMemoM3?: boolean);
|
|
10269
10270
|
name: string;
|
|
10270
10271
|
readonly customComponentMethods: string[];
|
|
10271
10272
|
createLanguageWriter(language?: Language): LanguageWriter;
|
|
@@ -10278,10 +10279,15 @@ export declare class PeerLibrary implements LibraryInterface {
|
|
|
10278
10279
|
private context;
|
|
10279
10280
|
getCurrentContext(): string | undefined;
|
|
10280
10281
|
setCurrentContext(context: string | undefined): void;
|
|
10281
|
-
findFileByOriginalFilename(filename: string):
|
|
10282
|
+
findFileByOriginalFilename(filename: string): idl.IDLFile | undefined;
|
|
10282
10283
|
mapType(type: idl.IDLType): string;
|
|
10283
|
-
|
|
10284
|
-
|
|
10284
|
+
private referenceCache;
|
|
10285
|
+
enableCache(): void;
|
|
10286
|
+
resolveTypeReference(type: idl.IDLReferenceType, singleStep?: boolean): idl.IDLEntry | undefined;
|
|
10287
|
+
private _useFallback;
|
|
10288
|
+
disableFallback(): void;
|
|
10289
|
+
resolveNamedNode(target: string[], pov?: idl.IDLNode | undefined): idl.IDLEntry | undefined;
|
|
10290
|
+
resolveImport(target: idl.IDLImport): idl.IDLEntry | undefined;
|
|
10285
10291
|
typeConvertor(param: string, type: idl.IDLType, isOptionalParam?: boolean): ArgConvertor;
|
|
10286
10292
|
declarationConvertor(param: string, type: idl.IDLReferenceType, declaration: idl.IDLEntry | undefined): ArgConvertor;
|
|
10287
10293
|
private customConvertor;
|
|
@@ -10292,7 +10298,6 @@ export declare class PeerLibrary implements LibraryInterface {
|
|
|
10292
10298
|
export declare const ArkInt32: idl.IDLPrimitiveType;
|
|
10293
10299
|
export declare const ArkInt64: idl.IDLPrimitiveType;
|
|
10294
10300
|
export declare const ArkFunction: idl.IDLPrimitiveType;
|
|
10295
|
-
export declare const ArkLength: idl.IDLPrimitiveType;
|
|
10296
10301
|
export declare const ArkDate: idl.IDLPrimitiveType;
|
|
10297
10302
|
export declare const ArkCustomObject: idl.IDLPrimitiveType;
|
|
10298
10303
|
export declare function cleanPrefix(name: string, prefix: string): string;
|