@idlizer/core 2.0.27 → 2.0.28
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/LanguageWriter.d.ts +4 -3
- package/build/lib/src/LanguageWriters/LanguageWriter.js +3 -2
- package/build/lib/src/LanguageWriters/convertors/CppConvertors.js +3 -3
- package/build/lib/src/LanguageWriters/convertors/InteropConvertors.js +3 -3
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.js +1 -0
- package/build/lib/src/LanguageWriters/convertors/TSConvertors.js +2 -0
- package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.js +2 -2
- package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.d.ts +1 -1
- package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.js +7 -3
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.d.ts +1 -1
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.js +2 -2
- package/build/lib/src/config.d.ts +13 -16
- package/build/lib/src/config.js +13 -17
- package/build/lib/src/idl.d.ts +1 -0
- package/build/lib/src/idl.js +1 -0
- package/build/lib/src/index.d.ts +1 -0
- package/build/lib/src/index.js +1 -0
- package/build/lib/src/inheritance.js +2 -2
- package/build/lib/src/languageSpecificKeywords.js +1 -1
- package/build/lib/src/library.d.ts +5 -4
- package/build/lib/src/library.js +3 -0
- package/build/lib/src/peer-generation/BuilderClass.js +1 -1
- package/build/lib/src/peer-generation/LayoutManager.d.ts +2 -1
- package/build/lib/src/peer-generation/LayoutManager.js +1 -0
- package/build/lib/src/peer-generation/PeerFile.d.ts +1 -0
- package/build/lib/src/peer-generation/PeerFile.js +4 -1
- package/build/lib/src/peer-generation/PeerLibrary.d.ts +10242 -1
- package/build/lib/src/peer-generation/PeerLibrary.js +21 -1
- package/build/lib/src/peer-generation/isMaterialized.js +2 -2
- package/build/lib/src/peer-generation/isStructureType.d.ts +4 -0
- package/build/lib/src/peer-generation/isStructureType.js +25 -0
- package/package.json +2 -2
|
@@ -212,9 +212,10 @@ export interface PrinterLike {
|
|
|
212
212
|
}
|
|
213
213
|
export declare abstract class LanguageWriter {
|
|
214
214
|
printer: IndentedPrinter;
|
|
215
|
-
|
|
215
|
+
resolver: ReferenceResolver;
|
|
216
216
|
language: Language;
|
|
217
|
-
constructor(printer: IndentedPrinter, resolver: ReferenceResolver,
|
|
217
|
+
constructor(printer: IndentedPrinter, resolver: ReferenceResolver, // TODO make protected again
|
|
218
|
+
language: Language);
|
|
218
219
|
indentDepth(): number;
|
|
219
220
|
maybeSemicolon(): string;
|
|
220
221
|
abstract writeClass(name: string, op: (writer: this) => void, superClass?: string, interfaces?: string[], generics?: string[], isDeclared?: boolean, isExport?: boolean): void;
|
|
@@ -319,7 +320,7 @@ export declare abstract class LanguageWriter {
|
|
|
319
320
|
makeSignature(returnType: idl.IDLType, parameters: idl.IDLParameter[]): MethodSignature;
|
|
320
321
|
makeNamedSignature(returnType: idl.IDLType, parameters: idl.IDLParameter[]): NamedMethodSignature;
|
|
321
322
|
makeNativeMethodNamedSignature(returnType: idl.IDLType, parameters: idl.IDLParameter[]): NamedMethodSignature;
|
|
322
|
-
|
|
323
|
+
makeSerializerConstructorSignatures(): NamedMethodSignature[] | undefined;
|
|
323
324
|
mapFieldModifier(modifier: FieldModifier): string;
|
|
324
325
|
mapMethodModifier(modifier: MethodModifier): string;
|
|
325
326
|
/**
|
|
@@ -391,7 +391,8 @@ export class NamedMethodSignature extends MethodSignature {
|
|
|
391
391
|
// LANGUAGE WRITER //
|
|
392
392
|
////////////////////////////////////////////////////////////////
|
|
393
393
|
export class LanguageWriter {
|
|
394
|
-
constructor(printer, resolver,
|
|
394
|
+
constructor(printer, resolver, // TODO make protected again
|
|
395
|
+
language) {
|
|
395
396
|
this.printer = printer;
|
|
396
397
|
this.resolver = resolver;
|
|
397
398
|
this.language = language;
|
|
@@ -592,7 +593,7 @@ export class LanguageWriter {
|
|
|
592
593
|
makeNativeMethodNamedSignature(returnType, parameters) {
|
|
593
594
|
return this.makeNamedSignature(returnType, parameters);
|
|
594
595
|
}
|
|
595
|
-
|
|
596
|
+
makeSerializerConstructorSignatures() {
|
|
596
597
|
return undefined;
|
|
597
598
|
}
|
|
598
599
|
mapFieldModifier(modifier) {
|
|
@@ -100,7 +100,7 @@ export class GenericCppConvertor {
|
|
|
100
100
|
case "Object":
|
|
101
101
|
return this.make('CustomObject');
|
|
102
102
|
}
|
|
103
|
-
if (generatorConfiguration().
|
|
103
|
+
if (generatorConfiguration().parameterized.includes(refName)) {
|
|
104
104
|
return this.make('CustomObject');
|
|
105
105
|
}
|
|
106
106
|
let decl = this.resolver.toDeclaration(type);
|
|
@@ -242,7 +242,7 @@ export class CppReturnTypeConvertor {
|
|
|
242
242
|
if (type == idl.IDLStringType)
|
|
243
243
|
return 'void';
|
|
244
244
|
if (type == idl.IDLNumberType)
|
|
245
|
-
return generatorConfiguration().
|
|
245
|
+
return generatorConfiguration().TypePrefix + 'Int32'; // :(
|
|
246
246
|
return this.convertor.convert(type);
|
|
247
247
|
}
|
|
248
248
|
convertTypeParameter(type) {
|
|
@@ -251,7 +251,7 @@ export class CppReturnTypeConvertor {
|
|
|
251
251
|
convertTypeReference(type) {
|
|
252
252
|
const decl = this.resolver.resolveTypeReference(type);
|
|
253
253
|
if (decl && idl.isInterface(decl) && isMaterialized(decl, this.resolver)) {
|
|
254
|
-
return generatorConfiguration().
|
|
254
|
+
return generatorConfiguration().TypePrefix + decl.name;
|
|
255
255
|
}
|
|
256
256
|
return this.convertor.convert(type);
|
|
257
257
|
}
|
|
@@ -35,13 +35,13 @@ export class InteropReturnTypeConvertor {
|
|
|
35
35
|
// TODO return array by some way
|
|
36
36
|
return "void";
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return "void";
|
|
39
39
|
}
|
|
40
40
|
convertImport(type, importClause) {
|
|
41
41
|
throw new Error(`Cannot pass import type ${type.name} through interop`);
|
|
42
42
|
}
|
|
43
43
|
convertOptional(type) {
|
|
44
|
-
return '
|
|
44
|
+
return 'void';
|
|
45
45
|
}
|
|
46
46
|
convertPrimitiveType(type) {
|
|
47
47
|
switch (type) {
|
|
@@ -89,7 +89,7 @@ export class InteropReturnTypeConvertor {
|
|
|
89
89
|
return KInteropReturnBuffer;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return "void";
|
|
93
93
|
}
|
|
94
94
|
convertUnion(type) {
|
|
95
95
|
return KInteropReturnBuffer;
|
|
@@ -126,6 +126,7 @@ export class JavaTypeNameConvertor {
|
|
|
126
126
|
case idl.IDLVoidType: return 'void';
|
|
127
127
|
case idl.IDLDate: return 'Date';
|
|
128
128
|
case idl.IDLBufferType: return 'byte[]';
|
|
129
|
+
case idl.IDLInteropReturnBufferType: return 'byte[]';
|
|
129
130
|
}
|
|
130
131
|
throw new Error(`Unsupported IDL primitive ${idl.DebugUtils.debugPrintType(type)}`);
|
|
131
132
|
}
|
|
@@ -146,6 +146,8 @@ export class TSTypeNameConvertor {
|
|
|
146
146
|
return 'Date';
|
|
147
147
|
case idl.IDLBufferType:
|
|
148
148
|
return `ArrayBuffer`;
|
|
149
|
+
case idl.IDLInteropReturnBufferType:
|
|
150
|
+
return `KInteropReturnBuffer`;
|
|
149
151
|
}
|
|
150
152
|
throw new Error(`Unmapped primitive type ${idl.DebugUtils.debugPrintType(type)}`);
|
|
151
153
|
}
|
|
@@ -310,7 +310,7 @@ export class CJLanguageWriter extends LanguageWriter {
|
|
|
310
310
|
this.printer.print('}');
|
|
311
311
|
}
|
|
312
312
|
generateFunctionDeclaration(name, signature) {
|
|
313
|
-
const args = signature.args.map((it, index) => `${signature.argName(index)}: ${this.getNodeName(it)}`);
|
|
313
|
+
const args = signature.args.map((it, index) => `${this.escapeKeyword(signature.argName(index))}: ${this.getNodeName(it)}`);
|
|
314
314
|
return `public func ${name}(${args.join(", ")}): ${this.getNodeName(signature.returnType)}`;
|
|
315
315
|
}
|
|
316
316
|
writeMethodCall(receiver, method, params, nullable = false) {
|
|
@@ -390,7 +390,7 @@ export class CJLanguageWriter extends LanguageWriter {
|
|
|
390
390
|
writeDeclaration(name, signature, modifiers, postfix) {
|
|
391
391
|
let prefix = modifiers === null || modifiers === void 0 ? void 0 : modifiers.filter(it => this.supportedModifiers.includes(it)).map(it => this.mapMethodModifier(it)).join(" ");
|
|
392
392
|
prefix = prefix ? prefix + " " : "";
|
|
393
|
-
this.print(`${prefix}func ${name}(${signature.args.map((it, index) => `${signature.argName(index)}: ${this.getNodeName(it)}`).join(", ")}): ${this.getNodeName(signature.returnType)}${postfix !== null && postfix !== void 0 ? postfix : ""}`);
|
|
393
|
+
this.print(`${prefix}func ${name}(${signature.args.map((it, index) => `${this.escapeKeyword(signature.argName(index))}: ${this.getNodeName(it)}`).join(", ")}): ${this.getNodeName(signature.returnType)}${postfix !== null && postfix !== void 0 ? postfix : ""}`);
|
|
394
394
|
}
|
|
395
395
|
writeNativeFunctionCall(printer, name, signature) {
|
|
396
396
|
printer.print(`return unsafe { ${name}(${signature.args.map((it, index) => `${signature.argName(index)}`).join(", ")}) }`);
|
|
@@ -109,7 +109,7 @@ export declare class CppLanguageWriter extends CLikeLanguageWriter {
|
|
|
109
109
|
stringifyMethodReturnType(type: IDLType, hint?: PrintHint): string;
|
|
110
110
|
stringifyMethodArgType(type: IDLType, hint?: PrintHint): string;
|
|
111
111
|
stringifyTypeWithReceiver(type: IDLType, receiver?: string): string;
|
|
112
|
-
|
|
112
|
+
makeSerializerConstructorSignatures(): NamedMethodSignature[] | undefined;
|
|
113
113
|
makeLengthSerializer(serializer: string, value: string): LanguageStatement | undefined;
|
|
114
114
|
makeLengthDeserializer(deserializer: string): LanguageStatement | undefined;
|
|
115
115
|
}
|
|
@@ -455,12 +455,16 @@ export class CppLanguageWriter extends CLikeLanguageWriter {
|
|
|
455
455
|
}
|
|
456
456
|
return this.getNodeName(type);
|
|
457
457
|
}
|
|
458
|
-
|
|
459
|
-
|
|
458
|
+
makeSerializerConstructorSignatures() {
|
|
459
|
+
const fromBufferCtor = new NamedMethodSignature(IDLVoidType, [
|
|
460
460
|
IDLUint8ArrayType,
|
|
461
461
|
IDLU32Type,
|
|
462
|
-
createReferenceType("CallbackResourceHolder"
|
|
462
|
+
createReferenceType("CallbackResourceHolder")
|
|
463
463
|
], ["data", "dataLength", "resourceHolder"], [undefined, `0`, `nullptr`], [undefined, undefined, undefined, PrintHint.AsPointer]);
|
|
464
|
+
const ownedDataCtor = new NamedMethodSignature(IDLVoidType, [
|
|
465
|
+
createReferenceType("CallbackResourceHolder")
|
|
466
|
+
], ["resourceHolder"], [`nullptr`], [undefined, PrintHint.AsPointer]);
|
|
467
|
+
return [ownedDataCtor, fromBufferCtor];
|
|
464
468
|
}
|
|
465
469
|
makeLengthSerializer(serializer, value) {
|
|
466
470
|
return undefined;
|
|
@@ -88,6 +88,6 @@ export declare class TSLanguageWriter extends LanguageWriter {
|
|
|
88
88
|
makeCallIsObject(value: string): LanguageExpression;
|
|
89
89
|
escapeKeyword(keyword: string): string;
|
|
90
90
|
makeDiscriminatorConvertor(convertor: ArgConvertor, value: string, index: number): LanguageExpression | undefined;
|
|
91
|
-
|
|
91
|
+
makeSerializerConstructorSignatures(): NamedMethodSignature[] | undefined;
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=TsLanguageWriter.d.ts.map
|
|
@@ -390,8 +390,8 @@ export class TSLanguageWriter extends LanguageWriter {
|
|
|
390
390
|
this.makeNaryOp("<=", [ordinal, this.makeString(high.toString())])
|
|
391
391
|
]);
|
|
392
392
|
}
|
|
393
|
-
|
|
394
|
-
return new NamedMethodSignature(idl.IDLVoidType, [], []);
|
|
393
|
+
makeSerializerConstructorSignatures() {
|
|
394
|
+
return [new NamedMethodSignature(idl.IDLVoidType, [], [])];
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
//# sourceMappingURL=TsLanguageWriter.js.map
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
readonly
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export interface CoreConfiguration {
|
|
2
|
+
readonly TypePrefix: string;
|
|
3
|
+
readonly LibraryPrefix: string;
|
|
4
|
+
readonly OptionalPrefix: string;
|
|
5
|
+
readonly rootComponents: string[];
|
|
6
|
+
readonly standaloneComponents: string[];
|
|
7
|
+
readonly parameterized: string[];
|
|
8
|
+
readonly ignoreMaterialized: string[];
|
|
9
|
+
readonly builderClasses: string[];
|
|
10
|
+
readonly forceMaterialized: string[];
|
|
7
11
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
param<T>(name: string): T;
|
|
12
|
-
get TypePrefix(): string;
|
|
13
|
-
get LibraryPrefix(): string;
|
|
14
|
-
get OptionalPrefix(): string;
|
|
15
|
-
}
|
|
16
|
-
export declare function setDefaultConfiguration(config: GeneratorConfiguration): void;
|
|
17
|
-
export declare function generatorConfiguration(): GeneratorConfiguration;
|
|
12
|
+
export declare const defaultCoreConfuguration: CoreConfiguration;
|
|
13
|
+
export declare function setDefaultConfiguration<T extends CoreConfiguration>(config: T): void;
|
|
14
|
+
export declare function generatorConfiguration<T extends CoreConfiguration>(): T;
|
|
18
15
|
export declare function generatorTypePrefix(): string;
|
|
19
16
|
//# sourceMappingURL=config.d.ts.map
|
package/build/lib/src/config.js
CHANGED
|
@@ -12,22 +12,18 @@
|
|
|
12
12
|
* See the License for the specific language governing permissions and
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
get LibraryPrefix() { return this.param("LibraryPrefix"); }
|
|
28
|
-
get OptionalPrefix() { return this.param("OptionalPrefix"); }
|
|
29
|
-
}
|
|
30
|
-
let currentConfig = new BaseGeneratorConfiguration();
|
|
15
|
+
export const defaultCoreConfuguration = {
|
|
16
|
+
TypePrefix: "",
|
|
17
|
+
LibraryPrefix: "",
|
|
18
|
+
OptionalPrefix: "",
|
|
19
|
+
rootComponents: [],
|
|
20
|
+
standaloneComponents: [],
|
|
21
|
+
parameterized: [],
|
|
22
|
+
ignoreMaterialized: [],
|
|
23
|
+
builderClasses: [],
|
|
24
|
+
forceMaterialized: [],
|
|
25
|
+
};
|
|
26
|
+
let currentConfig = defaultCoreConfuguration;
|
|
31
27
|
export function setDefaultConfiguration(config) {
|
|
32
28
|
currentConfig = config;
|
|
33
29
|
}
|
|
@@ -36,6 +32,6 @@ export function generatorConfiguration() {
|
|
|
36
32
|
}
|
|
37
33
|
export function generatorTypePrefix() {
|
|
38
34
|
const conf = generatorConfiguration();
|
|
39
|
-
return `${conf.
|
|
35
|
+
return `${conf.TypePrefix}${conf.LibraryPrefix}`;
|
|
40
36
|
}
|
|
41
37
|
//# sourceMappingURL=config.js.map
|
package/build/lib/src/idl.d.ts
CHANGED
|
@@ -287,6 +287,7 @@ export declare const IDLUint8ArrayType: IDLContainerType;
|
|
|
287
287
|
export declare const IDLFunctionType: IDLPrimitiveType;
|
|
288
288
|
export declare const IDLLengthType: IDLPrimitiveType;
|
|
289
289
|
export declare const IDLCustomObjectType: IDLPrimitiveType;
|
|
290
|
+
export declare const IDLInteropReturnBufferType: IDLPrimitiveType;
|
|
290
291
|
export type IDLNodeInitializer = {
|
|
291
292
|
extendedAttributes?: IDLExtendedAttribute[];
|
|
292
293
|
fileName?: string;
|
package/build/lib/src/idl.js
CHANGED
|
@@ -333,6 +333,7 @@ export const IDLUint8ArrayType = createContainerType('sequence', [IDLU8Type]);
|
|
|
333
333
|
export const IDLFunctionType = createPrimitiveType('Function');
|
|
334
334
|
export const IDLLengthType = createPrimitiveType('Length');
|
|
335
335
|
export const IDLCustomObjectType = createPrimitiveType('CustomObject');
|
|
336
|
+
export const IDLInteropReturnBufferType = createPrimitiveType('InteropReturnBuffer');
|
|
336
337
|
export function createNamespace(name, extendedAttributes, fileName) {
|
|
337
338
|
return {
|
|
338
339
|
kind: IDLKind.Namespace,
|
package/build/lib/src/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from "./peer-generation/PeerMethod";
|
|
|
38
38
|
export * from "./peer-generation/BuilderClass";
|
|
39
39
|
export * from "./peer-generation/Materialized";
|
|
40
40
|
export * from "./peer-generation/isMaterialized";
|
|
41
|
+
export * from "./peer-generation/isStructureType";
|
|
41
42
|
export * from "./peer-generation/unions";
|
|
42
43
|
export * from "./LanguageWriters";
|
|
43
44
|
export * from "./peer-generation/ReferenceResolver";
|
package/build/lib/src/index.js
CHANGED
|
@@ -52,6 +52,7 @@ export * from "./peer-generation/PeerMethod";
|
|
|
52
52
|
export * from "./peer-generation/BuilderClass";
|
|
53
53
|
export * from "./peer-generation/Materialized";
|
|
54
54
|
export * from "./peer-generation/isMaterialized";
|
|
55
|
+
export * from "./peer-generation/isStructureType";
|
|
55
56
|
export * from "./peer-generation/unions";
|
|
56
57
|
export * from "./LanguageWriters";
|
|
57
58
|
export * from "./peer-generation/ReferenceResolver";
|
|
@@ -39,9 +39,9 @@ export function isCommonMethodOrSubclass(typeChecker, decl) {
|
|
|
39
39
|
return isSubclass;
|
|
40
40
|
}
|
|
41
41
|
export function determineInheritanceRole(name) {
|
|
42
|
-
if (generatorConfiguration().
|
|
42
|
+
if (generatorConfiguration().rootComponents.includes(name))
|
|
43
43
|
return InheritanceRole.Root;
|
|
44
|
-
if (generatorConfiguration().
|
|
44
|
+
if (generatorConfiguration().standaloneComponents.includes(name))
|
|
45
45
|
return InheritanceRole.Standalone;
|
|
46
46
|
return InheritanceRole.Heir;
|
|
47
47
|
}
|
|
@@ -38,7 +38,7 @@ export const CJKeywords = new Set([
|
|
|
38
38
|
/*'false', */ 'static', 'public', 'private',
|
|
39
39
|
'protected', 'override', 'redef', 'abstract',
|
|
40
40
|
'open', 'operator', 'foreign', 'inout',
|
|
41
|
-
'prop', 'mut', 'unsafe', 'get', 'set'
|
|
41
|
+
'prop', 'mut', 'unsafe', 'get', 'set', 'type'
|
|
42
42
|
]);
|
|
43
43
|
export const IDLKeywords = new Set([
|
|
44
44
|
"attribute", "callback", "object", "toString",
|
|
@@ -24,7 +24,7 @@ declare function req<A, R>(key: string, fn: (x: A) => R): LibraryQuery<A, R>;
|
|
|
24
24
|
declare function compose<B, R>(base: LibraryReducer<B>, next: LibraryQuery<B, R>): LibraryReducer<R>;
|
|
25
25
|
declare function concat<A, R1, R2>(f: LibraryQuery<A, R1>, g: LibraryQuery<A, R2>): LibraryQuery<A, [R1, R2]>;
|
|
26
26
|
declare class LensBuilder<R> {
|
|
27
|
-
|
|
27
|
+
req: LibraryReducer<R>;
|
|
28
28
|
private constructor();
|
|
29
29
|
static make<R>(r: LibraryReducer<R>): LensBuilder<R>;
|
|
30
30
|
pipe<T>(r: LibraryQuery<R, T>): LensBuilder<T>;
|
|
@@ -48,13 +48,14 @@ export declare const lib: {
|
|
|
48
48
|
nodes(params: EntitiesParams): LibraryQuery<readonly IDLFile[], idl.IDLNode[]>;
|
|
49
49
|
entries(): LibraryQuery<idl.IDLNode[], idl.IDLEntry[]>;
|
|
50
50
|
interfaces(): LibraryQuery<idl.IDLNode[], idl.IDLInterface[]>;
|
|
51
|
+
hasExt<T extends idl.IDLNode>(attr: idl.IDLExtendedAttributes): LibraryQuery<T[], T[]>;
|
|
51
52
|
names(): LibraryQuery<idl.IDLNode[], string[]>;
|
|
52
53
|
name(name: string): LibraryReducer<idl.IDLNode[]>;
|
|
53
54
|
};
|
|
54
55
|
utils: {
|
|
55
|
-
idx: <
|
|
56
|
-
fst: <
|
|
57
|
-
lst: <
|
|
56
|
+
idx: <T_1>(x: number) => LibraryQuery<T_1[], T_1 | undefined>;
|
|
57
|
+
fst: <T_2>() => LibraryQuery<T_2[], T_2 | undefined>;
|
|
58
|
+
lst: <T_3>() => LibraryQuery<T_3[], T_3 | undefined>;
|
|
58
59
|
};
|
|
59
60
|
req: typeof req;
|
|
60
61
|
compose: typeof compose;
|
package/build/lib/src/library.js
CHANGED
|
@@ -157,6 +157,9 @@ const select = {
|
|
|
157
157
|
interfaces() {
|
|
158
158
|
return req('interfaces', it => it.filter(idl.isInterface));
|
|
159
159
|
},
|
|
160
|
+
hasExt(attr) {
|
|
161
|
+
return req('with_attr=' + serializeParam(attr), it => it.filter(x => idl.hasExtAttribute(x, attr)));
|
|
162
|
+
},
|
|
160
163
|
names() {
|
|
161
164
|
return req('names', xs => xs.flatMap(x => idl.isNamedNode(x) ? [x.name] : []));
|
|
162
165
|
},
|
|
@@ -32,7 +32,7 @@ export class BuilderClass {
|
|
|
32
32
|
*/
|
|
33
33
|
export function isBuilderClass(declaration) {
|
|
34
34
|
const className = declaration.name;
|
|
35
|
-
if (generatorConfiguration().
|
|
35
|
+
if (generatorConfiguration().builderClasses.includes(className)) {
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
38
|
if (isCustomBuilderClass(className)) {
|
|
@@ -16,6 +16,7 @@ export var LayoutNodeRole;
|
|
|
16
16
|
(function (LayoutNodeRole) {
|
|
17
17
|
LayoutNodeRole[LayoutNodeRole["PEER"] = 0] = "PEER";
|
|
18
18
|
LayoutNodeRole[LayoutNodeRole["INTERFACE"] = 1] = "INTERFACE";
|
|
19
|
+
LayoutNodeRole[LayoutNodeRole["GLOBAL"] = 2] = "GLOBAL";
|
|
19
20
|
})(LayoutNodeRole || (LayoutNodeRole = {}));
|
|
20
21
|
export class LayoutManager {
|
|
21
22
|
constructor(strategy) {
|
|
@@ -8,6 +8,7 @@ export declare class PeerFile implements LibraryFileInterface {
|
|
|
8
8
|
readonly peers: Map<string, PeerClass>;
|
|
9
9
|
constructor(originalFilename: string, entries: idl.IDLEntry[], isPredefined?: boolean);
|
|
10
10
|
packageName(): string;
|
|
11
|
+
package(): idl.IDLPackage | undefined;
|
|
11
12
|
get peersToGenerate(): PeerClass[];
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=PeerFile.d.ts.map
|
|
@@ -21,7 +21,7 @@ export class PeerFile {
|
|
|
21
21
|
this.peers = new Map();
|
|
22
22
|
}
|
|
23
23
|
packageName() {
|
|
24
|
-
|
|
24
|
+
const packageTag = this.package();
|
|
25
25
|
if (packageTag === undefined) {
|
|
26
26
|
return "";
|
|
27
27
|
}
|
|
@@ -30,6 +30,9 @@ export class PeerFile {
|
|
|
30
30
|
}
|
|
31
31
|
return packageTag.name;
|
|
32
32
|
}
|
|
33
|
+
package() {
|
|
34
|
+
return this.entries.find(it => idl.isPackage(it));
|
|
35
|
+
}
|
|
33
36
|
get peersToGenerate() {
|
|
34
37
|
const peers = Array.from(this.peers.values());
|
|
35
38
|
return peers;
|