@idlizer/core 2.1.10-arktscgen-2 → 2.1.10-arktscgen-3
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 +0 -9
- package/build/lib/src/LanguageWriters/ArgConvertors.js +2 -27
- package/build/lib/src/LanguageWriters/LanguageWriter.d.ts +7 -5
- package/build/lib/src/LanguageWriters/LanguageWriter.js +3 -1
- package/build/lib/src/LanguageWriters/convertors/CJConvertors.js +2 -1
- package/build/lib/src/LanguageWriters/convertors/InteropConvertors.js +2 -0
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.js +3 -0
- package/build/lib/src/LanguageWriters/convertors/KotlinConvertors.js +2 -0
- package/build/lib/src/LanguageWriters/convertors/TSConvertors.js +2 -0
- package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.d.ts +2 -5
- package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.js +8 -8
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.d.ts +2 -1
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.js +6 -0
- package/build/lib/src/LanguageWriters/writers/KotlinLanguageWriter.d.ts +2 -5
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.d.ts +2 -5
- package/build/lib/src/from-idl/deserialize.js +1 -0
- package/build/lib/src/from-idl/parser.d.ts +6 -6
- package/build/lib/src/from-idl/parser.js +11 -7
- package/build/lib/src/idl.d.ts +1 -0
- package/build/lib/src/idl.js +1 -0
- package/build/lib/src/peer-generation/Materialized.d.ts +5 -3
- package/build/lib/src/peer-generation/Materialized.js +10 -7
- package/build/lib/src/peer-generation/PeerClass.d.ts +3 -2
- package/build/lib/src/peer-generation/PeerClass.js +3 -2
- package/build/lib/src/peer-generation/PeerLibrary.js +2 -2
- package/build/lib/src/peer-generation/PeerMethod.d.ts +2 -1
- package/build/lib/src/peer-generation/PeerMethod.js +2 -1
- package/build/lib/src/peer-generation/getSuperType.d.ts +1 -0
- package/build/lib/src/peer-generation/getSuperType.js +9 -0
- package/package.json +3 -2
|
@@ -115,15 +115,6 @@ export declare class NumericConvertor extends BaseArgConvertor {
|
|
|
115
115
|
interopType(): idl.IDLType;
|
|
116
116
|
isPointerType(): boolean;
|
|
117
117
|
}
|
|
118
|
-
export declare class DoubleConvertor extends BaseArgConvertor {
|
|
119
|
-
constructor(param: string);
|
|
120
|
-
convertorArg(param: string, writer: LanguageWriter): string;
|
|
121
|
-
convertorSerialize(param: string, value: string, writer: LanguageWriter): LanguageStatement;
|
|
122
|
-
convertorDeserialize(bufferName: string, deserializerName: string, assigneer: ExpressionAssigner, writer: LanguageWriter): LanguageStatement;
|
|
123
|
-
nativeType(): idl.IDLType;
|
|
124
|
-
interopType(): idl.IDLType;
|
|
125
|
-
isPointerType(): boolean;
|
|
126
|
-
}
|
|
127
118
|
export declare class BigIntToU64Convertor extends BaseArgConvertor {
|
|
128
119
|
constructor(param: string);
|
|
129
120
|
convertorArg(param: string, writer: LanguageWriter): string;
|
|
@@ -322,31 +322,6 @@ export class NumericConvertor extends BaseArgConvertor {
|
|
|
322
322
|
return false;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
// TODO use NumericConvertor when double is implemented as interop type
|
|
326
|
-
export class DoubleConvertor extends BaseArgConvertor {
|
|
327
|
-
constructor(param) {
|
|
328
|
-
// check numericPrimitiveTypes.include(type)
|
|
329
|
-
super(idl.IDLF64Type, [RuntimeType.NUMBER], false, true, param);
|
|
330
|
-
}
|
|
331
|
-
convertorArg(param, writer) {
|
|
332
|
-
return param;
|
|
333
|
-
}
|
|
334
|
-
convertorSerialize(param, value, writer) {
|
|
335
|
-
return writer.makeStatement(writer.makeMethodCall(`${param}Serializer`, `writeFloat64`, [writer.makeString(value)]));
|
|
336
|
-
}
|
|
337
|
-
convertorDeserialize(bufferName, deserializerName, assigneer, writer) {
|
|
338
|
-
return assigneer(writer.makeString(`${deserializerName}.readFloat64()`));
|
|
339
|
-
}
|
|
340
|
-
nativeType() {
|
|
341
|
-
return this.idlType;
|
|
342
|
-
}
|
|
343
|
-
interopType() {
|
|
344
|
-
return this.idlType;
|
|
345
|
-
}
|
|
346
|
-
isPointerType() {
|
|
347
|
-
return false;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
325
|
export class BigIntToU64Convertor extends BaseArgConvertor {
|
|
351
326
|
constructor(param) {
|
|
352
327
|
super(idl.IDLBigintType, [RuntimeType.BIGINT], false, false, param);
|
|
@@ -518,7 +493,7 @@ export class AggregateConvertor extends BaseArgConvertor {
|
|
|
518
493
|
statements.push(assigneer(writer.makeString(bufferName)));
|
|
519
494
|
}
|
|
520
495
|
else if (writer.language == Language.CJ) {
|
|
521
|
-
const resultExpression = writer.makeString(`${writer.getNodeName(this.idlType)}(${this.decl.properties.map(prop => `${bufferName}
|
|
496
|
+
const resultExpression = writer.makeString(`${writer.getNodeName(this.idlType)}(${this.decl.properties.map(prop => `${bufferName}${capitalize(prop.name)}`).join(", ")})`);
|
|
522
497
|
statements.push(assigneer(resultExpression));
|
|
523
498
|
}
|
|
524
499
|
else if (writer.language == Language.KOTLIN) {
|
|
@@ -911,7 +886,7 @@ export class OptionConvertor extends BaseArgConvertor {
|
|
|
911
886
|
const statements = [];
|
|
912
887
|
statements.push(writer.makeAssign(runtimeBufferName, undefined, writer.makeCast(writer.makeString(`${deserializerName}.readInt8()`), writer.getRuntimeType()), true));
|
|
913
888
|
const bufferType = this.nativeType();
|
|
914
|
-
statements.push(writer.makeAssign(bufferName, bufferType, (writer.language == Language.CJ || writer.language == Language.KOTLIN) ? writer.makeNull() : undefined, true, false));
|
|
889
|
+
statements.push(writer.makeAssign(bufferName, bufferType, (writer.language == Language.CJ || writer.language == Language.KOTLIN) ? writer.makeNull(bufferName) : undefined, true, false)); // maybe change to generic None
|
|
915
890
|
const thenStatement = new BlockStatement([
|
|
916
891
|
this.typeConvertor.convertorDeserialize(`${bufferName}_`, deserializerName, (expr) => {
|
|
917
892
|
const receiver = writer.language === Language.CPP
|
|
@@ -230,6 +230,11 @@ export interface ObjectArgs {
|
|
|
230
230
|
export interface PrinterLike {
|
|
231
231
|
getOutput(): string[];
|
|
232
232
|
}
|
|
233
|
+
export interface NamespaceOptions {
|
|
234
|
+
ident: boolean;
|
|
235
|
+
isDeclared?: boolean;
|
|
236
|
+
isDefault?: boolean;
|
|
237
|
+
}
|
|
233
238
|
export declare abstract class LanguageWriter {
|
|
234
239
|
printer: IndentedPrinter;
|
|
235
240
|
resolver: ReferenceResolver;
|
|
@@ -298,7 +303,7 @@ export declare abstract class LanguageWriter {
|
|
|
298
303
|
}): LanguageWriter;
|
|
299
304
|
concat(other: PrinterLike): this;
|
|
300
305
|
printTo(file: string): void;
|
|
301
|
-
writeLines(lines: string): void;
|
|
306
|
+
writeLines(lines: string | stringOrNone[]): void;
|
|
302
307
|
writeGetterImplementation(method: Method, op: (writer: this) => void): void;
|
|
303
308
|
writeSetterImplementation(method: Method, op: (writer: this) => void): void;
|
|
304
309
|
writeSuperCall(params: string[]): void;
|
|
@@ -381,10 +386,7 @@ export declare abstract class LanguageWriter {
|
|
|
381
386
|
* Writes `namespace <namespace> {` and adds extra indent
|
|
382
387
|
* @param namespace Namespace to begin
|
|
383
388
|
*/
|
|
384
|
-
pushNamespace(namespace: string, options:
|
|
385
|
-
ident: boolean;
|
|
386
|
-
isDeclared?: boolean;
|
|
387
|
-
}): void;
|
|
389
|
+
pushNamespace(namespace: string, options: NamespaceOptions): void;
|
|
388
390
|
/**
|
|
389
391
|
* Writes closing brace of namespace block and removes one level of indent
|
|
390
392
|
*/
|
|
@@ -440,7 +440,9 @@ export class LanguageWriter {
|
|
|
440
440
|
fs.writeFileSync(file, this.getOutput().join("\n"));
|
|
441
441
|
}
|
|
442
442
|
writeLines(lines) {
|
|
443
|
-
|
|
443
|
+
if (typeof lines === 'string')
|
|
444
|
+
lines = lines.split("\n");
|
|
445
|
+
lines.forEach(it => this.print(it));
|
|
444
446
|
}
|
|
445
447
|
writeGetterImplementation(method, op) {
|
|
446
448
|
var _a;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import * as idl from '../../idl';
|
|
16
16
|
import { CJKeywords } from '../../languageSpecificKeywords';
|
|
17
|
+
import { generateSyntheticIdlNodeName } from '../../peer-generation/idl/common';
|
|
17
18
|
import { convertNode, convertType } from '../nameConvertor';
|
|
18
19
|
import { InteropArgConvertor } from './InteropConvertors';
|
|
19
20
|
export class CJTypeNameConvertor {
|
|
@@ -33,7 +34,7 @@ export class CJTypeNameConvertor {
|
|
|
33
34
|
return `Option<${this.convert(type.type)}>`;
|
|
34
35
|
}
|
|
35
36
|
convertUnion(type) {
|
|
36
|
-
return type.
|
|
37
|
+
return "Union_" + type.types.map(it => generateSyntheticIdlNodeName(it)).join("_");
|
|
37
38
|
}
|
|
38
39
|
convertContainer(type) {
|
|
39
40
|
if (idl.IDLContainerUtils.isSequence(type)) {
|
|
@@ -122,9 +122,11 @@ export class InteropArgConvertor {
|
|
|
122
122
|
switch (type) {
|
|
123
123
|
case idl.IDLI64Type: return "KLong";
|
|
124
124
|
case idl.IDLU64Type: return "KLong";
|
|
125
|
+
case idl.IDLU8Type: return "KInt";
|
|
125
126
|
case idl.IDLI32Type: return "KInt";
|
|
126
127
|
case idl.IDLU32Type: return "KInt";
|
|
127
128
|
case idl.IDLF32Type: return "KFloat";
|
|
129
|
+
case idl.IDLF64Type: return "KDouble";
|
|
128
130
|
case idl.IDLNumberType: return 'KInteropNumber';
|
|
129
131
|
case idl.IDLBigintType: return 'KLong';
|
|
130
132
|
case idl.IDLSerializerBuffer: return 'KSerializerBuffer';
|
|
@@ -154,6 +154,8 @@ export class JavaTypeNameConvertor {
|
|
|
154
154
|
case 'KLong': return 'long';
|
|
155
155
|
case 'float32':
|
|
156
156
|
case 'KFloat': return 'float';
|
|
157
|
+
case 'float64':
|
|
158
|
+
case 'KDouble': return 'double';
|
|
157
159
|
case 'KUint8ArrayPtr': return 'byte[]';
|
|
158
160
|
case 'KInt32ArrayPtr': return 'int[]';
|
|
159
161
|
case 'KFloat32ArrayPtr': return 'float[]';
|
|
@@ -191,6 +193,7 @@ export class JavaInteropArgConvertor extends InteropArgConvertor {
|
|
|
191
193
|
case idl.IDLI32Type: return "int";
|
|
192
194
|
case idl.IDLU32Type: return "int";
|
|
193
195
|
case idl.IDLF32Type: return "float";
|
|
196
|
+
case idl.IDLF64Type: return "double";
|
|
194
197
|
case idl.IDLBigintType: return "long";
|
|
195
198
|
case idl.IDLSerializerBuffer: return "long";
|
|
196
199
|
case idl.IDLFunctionType: return "int";
|
|
@@ -133,6 +133,7 @@ const KBoolean = "KBoolean";
|
|
|
133
133
|
const KInt = "KInt";
|
|
134
134
|
const KLong = "KLong";
|
|
135
135
|
const KFloat = "KFloat";
|
|
136
|
+
const KDouble = "KDouble";
|
|
136
137
|
const KNativePointer = "KNativePointer";
|
|
137
138
|
const KInteropNumber = "KInteropNumber";
|
|
138
139
|
const KStringPtr = "KStringPtr";
|
|
@@ -216,6 +217,7 @@ export class KotlinCInteropArgConvertor {
|
|
|
216
217
|
case idl.IDLI32Type: return KInt;
|
|
217
218
|
case idl.IDLU32Type: return KInt;
|
|
218
219
|
case idl.IDLF32Type: return KFloat;
|
|
220
|
+
case idl.IDLF64Type: return KDouble;
|
|
219
221
|
case idl.IDLNumberType: return KInteropNumber;
|
|
220
222
|
case idl.IDLBigintType: return KLong;
|
|
221
223
|
case idl.IDLSerializerBuffer: return KSerializerBuffer;
|
|
@@ -248,9 +248,11 @@ export class TSInteropArgConvertor {
|
|
|
248
248
|
switch (type) {
|
|
249
249
|
case idl.IDLI64Type: return "KLong";
|
|
250
250
|
case idl.IDLU64Type: return "KLong";
|
|
251
|
+
case idl.IDLU8Type: return "KInt";
|
|
251
252
|
case idl.IDLI32Type: return "KInt";
|
|
252
253
|
case idl.IDLU32Type: return "KInt";
|
|
253
254
|
case idl.IDLF32Type: return "KFloat";
|
|
255
|
+
case idl.IDLF64Type: return "KDouble";
|
|
254
256
|
case idl.IDLNumberType: return 'number';
|
|
255
257
|
case idl.IDLBigintType: return 'bigint';
|
|
256
258
|
case idl.IDLBooleanType:
|
|
@@ -2,7 +2,7 @@ import * as idl from "../../idl";
|
|
|
2
2
|
import { IndentedPrinter } from "../../IndentedPrinter";
|
|
3
3
|
import { ArgConvertor, BaseArgConvertor } from "../ArgConvertors";
|
|
4
4
|
import { RuntimeType } from "../common";
|
|
5
|
-
import { AssignStatement, DelegationCall, FieldModifier, LanguageExpression, LanguageStatement, LanguageWriter, MakeCastOptions, Method, MethodModifier, MethodSignature, ObjectArgs } from "../LanguageWriter";
|
|
5
|
+
import { AssignStatement, DelegationCall, FieldModifier, LanguageExpression, LanguageStatement, LanguageWriter, MakeCastOptions, Method, MethodModifier, MethodSignature, NamespaceOptions, ObjectArgs } from "../LanguageWriter";
|
|
6
6
|
import { IdlNameConvertor } from "../nameConvertor";
|
|
7
7
|
import { Language } from "../../Language";
|
|
8
8
|
import { ReferenceResolver } from "../../peer-generation/ReferenceResolver";
|
|
@@ -154,10 +154,7 @@ export declare class CJLanguageWriter extends LanguageWriter {
|
|
|
154
154
|
makeEquals(args: LanguageExpression[]): LanguageExpression;
|
|
155
155
|
runtimeType(param: ArgConvertor, valueType: string, value: string): void;
|
|
156
156
|
escapeKeyword(word: string): string;
|
|
157
|
-
pushNamespace(namespace: string, options:
|
|
158
|
-
ident: boolean;
|
|
159
|
-
isDeclared?: boolean;
|
|
160
|
-
}): void;
|
|
157
|
+
pushNamespace(namespace: string, options: NamespaceOptions): void;
|
|
161
158
|
popNamespace(options: {
|
|
162
159
|
ident: boolean;
|
|
163
160
|
}): void;
|
|
@@ -16,7 +16,7 @@ import * as idl from "../../idl";
|
|
|
16
16
|
import { IndentedPrinter } from "../../IndentedPrinter";
|
|
17
17
|
import { CJKeywords } from "../../languageSpecificKeywords";
|
|
18
18
|
import { RuntimeType } from "../common";
|
|
19
|
-
import { AssignStatement, BlockStatement, ExpressionStatement, FieldModifier, LambdaExpression, LanguageWriter, MethodModifier, MethodSignature, ReturnStatement
|
|
19
|
+
import { AssignStatement, BlockStatement, DelegationType, ExpressionStatement, FieldModifier, LambdaExpression, LanguageWriter, MethodModifier, MethodSignature, ReturnStatement } from "../LanguageWriter";
|
|
20
20
|
import { Language } from "../../Language";
|
|
21
21
|
import { indentedBy, isDefined } from "../../util";
|
|
22
22
|
////////////////////////////////////////////////////////////////
|
|
@@ -40,7 +40,7 @@ export class CJCheckDefinedExpression {
|
|
|
40
40
|
this.value = value;
|
|
41
41
|
}
|
|
42
42
|
asString() {
|
|
43
|
-
return
|
|
43
|
+
return `let Some(${this.value}) <- ${this.value}`;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export class CJCastExpression {
|
|
@@ -328,22 +328,22 @@ export class CJLanguageWriter extends LanguageWriter {
|
|
|
328
328
|
let i = 1;
|
|
329
329
|
while (signature.isArgOptional(signature.args.length - i)) {
|
|
330
330
|
let smallerSignature = signature.args.slice(0, -i);
|
|
331
|
-
this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}init
|
|
331
|
+
this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}init(${smallerSignature.map((it, index) => `${this.escapeKeyword(signature.argName(index))}: ${this.getNodeName(it)}`).join(", ")}) {`);
|
|
332
332
|
this.pushIndent();
|
|
333
333
|
let lessArgs = (_a = signature.args) === null || _a === void 0 ? void 0 : _a.slice(0, -i).map((_, i) => this.escapeKeyword(signature.argName(i))).join(', ');
|
|
334
334
|
for (let idx = 0; idx < i; idx++) {
|
|
335
335
|
lessArgs = lessArgs.concat(`${i == signature.args.length && idx == 0 ? '' : ', '}Option.None`);
|
|
336
336
|
}
|
|
337
|
-
this.print(
|
|
337
|
+
this.print(`this(${lessArgs})`);
|
|
338
338
|
this.popIndent();
|
|
339
339
|
this.printer.print(`}`);
|
|
340
340
|
i += 1;
|
|
341
341
|
}
|
|
342
|
-
this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}
|
|
342
|
+
this.printer.print(`${modifiers ? modifiers.map((it) => MethodModifier[it].toLowerCase()).join(' ') + ' ' : ''}init(${signature.args.map((it, index) => `${this.escapeKeyword(signature.argName(index))}: ${this.getNodeName(idl.maybeOptional(it, signature.isArgOptional(index)))}`).join(", ")}) {`);
|
|
343
343
|
this.pushIndent();
|
|
344
344
|
if (delegationCall) {
|
|
345
|
-
|
|
346
|
-
this.print(
|
|
345
|
+
const delegationType = ((delegationCall === null || delegationCall === void 0 ? void 0 : delegationCall.delegationType) == DelegationType.THIS) ? "this" : "super";
|
|
346
|
+
this.print(`${delegationType}(${delegationCall.delegationArgs.map(it => it.asString()).join(", ")})`);
|
|
347
347
|
}
|
|
348
348
|
op(this);
|
|
349
349
|
this.popIndent();
|
|
@@ -528,7 +528,7 @@ export class CJLanguageWriter extends LanguageWriter {
|
|
|
528
528
|
return this.makeStatement(this.makeMethodCall(keyAccessor, "add", [this.makeString(key), this.makeString(value)]));
|
|
529
529
|
}
|
|
530
530
|
makeNull(value) {
|
|
531
|
-
return
|
|
531
|
+
return this.makeUndefined();
|
|
532
532
|
}
|
|
533
533
|
getTagType() {
|
|
534
534
|
return idl.createReferenceType("Tags");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IndentedPrinter } from "../../IndentedPrinter";
|
|
2
|
-
import { LambdaExpression, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature } from "../LanguageWriter";
|
|
2
|
+
import { LambdaExpression, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature, NamespaceOptions } from "../LanguageWriter";
|
|
3
3
|
import { TSLanguageWriter } from "./TsLanguageWriter";
|
|
4
4
|
import { IDLEnum, IDLType } from '../../idl';
|
|
5
5
|
import { ArgConvertor } from "../ArgConvertors";
|
|
@@ -45,6 +45,7 @@ export declare function makeArrayTypeCheckCall(valueAccessor: string, typeName:
|
|
|
45
45
|
export declare class ETSLanguageWriter extends TSLanguageWriter {
|
|
46
46
|
private arrayConvertor;
|
|
47
47
|
constructor(printer: IndentedPrinter, resolver: ReferenceResolver, typeConvertor: IdlNameConvertor, arrayConvertor: IdlNameConvertor);
|
|
48
|
+
pushNamespace(namespace: string, options: NamespaceOptions): void;
|
|
48
49
|
fork(options?: {
|
|
49
50
|
resolver?: ReferenceResolver;
|
|
50
51
|
}): LanguageWriter;
|
|
@@ -175,6 +175,12 @@ export class ETSLanguageWriter extends TSLanguageWriter {
|
|
|
175
175
|
super(printer, resolver, typeConvertor, Language.ARKTS);
|
|
176
176
|
this.arrayConvertor = arrayConvertor;
|
|
177
177
|
}
|
|
178
|
+
pushNamespace(namespace, options) {
|
|
179
|
+
if (options.isDefault) {
|
|
180
|
+
this.print(`export default ${namespace}`);
|
|
181
|
+
}
|
|
182
|
+
super.pushNamespace(namespace, options);
|
|
183
|
+
}
|
|
178
184
|
fork(options) {
|
|
179
185
|
var _a;
|
|
180
186
|
return new ETSLanguageWriter(new IndentedPrinter([], this.indentDepth()), (_a = options === null || options === void 0 ? void 0 : options.resolver) !== null && _a !== void 0 ? _a : this.resolver, this.typeConvertor, this.arrayConvertor);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as idl from '../../idl';
|
|
2
2
|
import { Language } from '../../Language';
|
|
3
3
|
import { IndentedPrinter } from "../../IndentedPrinter";
|
|
4
|
-
import { AssignStatement, DelegationCall, FieldModifier, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature, ObjectArgs } from "../LanguageWriter";
|
|
4
|
+
import { AssignStatement, DelegationCall, FieldModifier, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature, NamespaceOptions, ObjectArgs } from "../LanguageWriter";
|
|
5
5
|
import { ArgConvertor } from "../ArgConvertors";
|
|
6
6
|
import { IdlNameConvertor } from "../nameConvertor";
|
|
7
7
|
import { RuntimeType } from "../common";
|
|
@@ -141,10 +141,7 @@ export declare class KotlinLanguageWriter extends LanguageWriter {
|
|
|
141
141
|
makeNewObject(objectName: string, params?: LanguageExpression[]): LanguageExpression;
|
|
142
142
|
escapeKeyword(keyword: string): string;
|
|
143
143
|
makeStaticBlock(op: (writer: LanguageWriter) => void): void;
|
|
144
|
-
pushNamespace(namespace: string, options:
|
|
145
|
-
ident: boolean;
|
|
146
|
-
isDeclared?: boolean;
|
|
147
|
-
}): void;
|
|
144
|
+
pushNamespace(namespace: string, options: NamespaceOptions): void;
|
|
148
145
|
popNamespace(options: {
|
|
149
146
|
ident: boolean;
|
|
150
147
|
}): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as idl from '../../idl';
|
|
2
2
|
import { Language } from '../../Language';
|
|
3
3
|
import { IndentedPrinter } from "../../IndentedPrinter";
|
|
4
|
-
import { DelegationCall, FieldModifier, LambdaExpression, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature, ObjectArgs, ReturnStatement } from "../LanguageWriter";
|
|
4
|
+
import { DelegationCall, FieldModifier, LambdaExpression, LanguageExpression, LanguageStatement, LanguageWriter, MakeAssignOptions, MakeCastOptions, Method, MethodModifier, MethodSignature, NamespaceOptions, ObjectArgs, ReturnStatement } from "../LanguageWriter";
|
|
5
5
|
import { ArgConvertor } from "../ArgConvertors";
|
|
6
6
|
import { IdlNameConvertor } from "../nameConvertor";
|
|
7
7
|
import { RuntimeType } from "../common";
|
|
@@ -32,10 +32,7 @@ export declare class TSLanguageWriter extends LanguageWriter {
|
|
|
32
32
|
protected typeConvertor: IdlNameConvertor;
|
|
33
33
|
constructor(printer: IndentedPrinter, resolver: ReferenceResolver, typeConvertor: IdlNameConvertor, language?: Language);
|
|
34
34
|
maybeSemicolon(): string;
|
|
35
|
-
pushNamespace(namespace: string, options:
|
|
36
|
-
ident: boolean;
|
|
37
|
-
isDeclared?: boolean;
|
|
38
|
-
}): void;
|
|
35
|
+
pushNamespace(namespace: string, options: NamespaceOptions): void;
|
|
39
36
|
fork(options?: {
|
|
40
37
|
resolver?: ReferenceResolver;
|
|
41
38
|
}): LanguageWriter;
|
|
@@ -289,6 +289,7 @@ class IDLDeserializer {
|
|
|
289
289
|
toIDLConstructor(file, node) {
|
|
290
290
|
return this.withInfo(node, idl.createConstructor(node.arguments.map(it => this.toIDLParameter(file, it)), undefined, {
|
|
291
291
|
documentation: this.makeDocs(node),
|
|
292
|
+
extendedAttributes: this.toExtendedAttributes(node.extAttrs),
|
|
292
293
|
}));
|
|
293
294
|
}
|
|
294
295
|
toIDLParameter(file, node) {
|
|
@@ -5,12 +5,12 @@ export declare class FatalParserException extends Error {
|
|
|
5
5
|
constructor(diagnosticMessages?: DiagnosticMessage[]);
|
|
6
6
|
}
|
|
7
7
|
declare enum TokenKind {
|
|
8
|
-
Words =
|
|
9
|
-
Literal =
|
|
10
|
-
Symbol =
|
|
11
|
-
Comment =
|
|
12
|
-
Whitespace =
|
|
13
|
-
End =
|
|
8
|
+
Words = 0,
|
|
9
|
+
Literal = 1,
|
|
10
|
+
Symbol = 2,
|
|
11
|
+
Comment = 3,
|
|
12
|
+
Whitespace = 4,
|
|
13
|
+
End = 5
|
|
14
14
|
}
|
|
15
15
|
interface Token {
|
|
16
16
|
kind: TokenKind;
|
|
@@ -39,12 +39,12 @@ export class FatalParserException extends Error {
|
|
|
39
39
|
}
|
|
40
40
|
var TokenKind;
|
|
41
41
|
(function (TokenKind) {
|
|
42
|
-
TokenKind["Words"] = "Words";
|
|
43
|
-
TokenKind["Literal"] = "Literal";
|
|
44
|
-
TokenKind["Symbol"] = "Symbol";
|
|
45
|
-
TokenKind["Comment"] = "Comment";
|
|
46
|
-
TokenKind["Whitespace"] = "
|
|
47
|
-
TokenKind["End"] = "End";
|
|
42
|
+
TokenKind[TokenKind["Words"] = 0] = "Words";
|
|
43
|
+
TokenKind[TokenKind["Literal"] = 1] = "Literal";
|
|
44
|
+
TokenKind[TokenKind["Symbol"] = 2] = "Symbol";
|
|
45
|
+
TokenKind[TokenKind["Comment"] = 3] = "Comment";
|
|
46
|
+
TokenKind[TokenKind["Whitespace"] = 4] = "Whitespace";
|
|
47
|
+
TokenKind[TokenKind["End"] = 5] = "End";
|
|
48
48
|
})(TokenKind || (TokenKind = {}));
|
|
49
49
|
const supportedDeclarations = new Set(["attribute", "callback", "const", "constructor", "dictionary",
|
|
50
50
|
"enum", "import", "interface", "namespace", "package", "typedef", "version"]);
|
|
@@ -97,13 +97,17 @@ export class Parser {
|
|
|
97
97
|
}
|
|
98
98
|
parseIDL() {
|
|
99
99
|
var _a;
|
|
100
|
+
trac("parseIDL");
|
|
100
101
|
const previousDiagnosticsCount = DiagnosticMessageGroup.allGroupsEntries.length;
|
|
101
102
|
try {
|
|
102
|
-
trac("parseIDL");
|
|
103
103
|
this._lexerNext();
|
|
104
104
|
this._prevToken = this._curToken;
|
|
105
105
|
let file = this.parseFile();
|
|
106
106
|
file.text = this.content;
|
|
107
|
+
if (DiagnosticMessageGroup.allGroupsEntries.length != previousDiagnosticsCount) {
|
|
108
|
+
// Empty for now, messages will be added in following `catch`.
|
|
109
|
+
throw new FatalParserException();
|
|
110
|
+
}
|
|
107
111
|
return file;
|
|
108
112
|
}
|
|
109
113
|
catch (e) {
|
package/build/lib/src/idl.d.ts
CHANGED
package/build/lib/src/idl.js
CHANGED
|
@@ -78,6 +78,7 @@ export var IDLExtendedAttributes;
|
|
|
78
78
|
IDLExtendedAttributes["OriginalGenericName"] = "OriginalGenericName";
|
|
79
79
|
IDLExtendedAttributes["Predefined"] = "Predefined";
|
|
80
80
|
IDLExtendedAttributes["Protected"] = "Protected";
|
|
81
|
+
IDLExtendedAttributes["Abstract"] = "Abstract";
|
|
81
82
|
IDLExtendedAttributes["Synthetic"] = "Synthetic";
|
|
82
83
|
IDLExtendedAttributes["Throws"] = "Throws";
|
|
83
84
|
IDLExtendedAttributes["TraceKey"] = "TraceKey";
|
|
@@ -13,10 +13,11 @@ export declare class MaterializedField {
|
|
|
13
13
|
constructor(field: Field, argConvertor: ArgConvertor, outArgConvertor?: ArgConvertor | undefined, isNullableOriginalTypeField?: boolean | undefined, extraMethodName?: string | undefined);
|
|
14
14
|
}
|
|
15
15
|
export declare class MaterializedMethod extends PeerMethod {
|
|
16
|
+
decl: idl.IDLConstructor | idl.IDLMethod | undefined;
|
|
16
17
|
implementationParentName: string;
|
|
17
|
-
constructor(sig: PeerMethodSignature, originalParentName: string, implementationParentName: string, returnType: idl.IDLType, isCallSignature: boolean, uniqueOverloadName: string, method: Method);
|
|
18
|
+
constructor(decl: idl.IDLConstructor | idl.IDLMethod | undefined, sig: PeerMethodSignature, originalParentName: string, implementationParentName: string, returnType: idl.IDLType, isCallSignature: boolean, uniqueOverloadName: string, method: Method);
|
|
18
19
|
tsReturnType(): idl.IDLType | undefined;
|
|
19
|
-
getPrivateMethod(): MaterializedMethod;
|
|
20
|
+
getPrivateMethod(asProtected?: boolean): MaterializedMethod;
|
|
20
21
|
withReturnType(returnType: idl.IDLType): MaterializedMethod;
|
|
21
22
|
}
|
|
22
23
|
export declare function copyMaterializedMethod(method: MaterializedMethod, overrides: {
|
|
@@ -36,9 +37,10 @@ export declare class MaterializedClass implements PeerClassBase {
|
|
|
36
37
|
readonly methods: MaterializedMethod[];
|
|
37
38
|
readonly needBeGenerated: boolean;
|
|
38
39
|
readonly taggedMethods: idl.IDLMethod[];
|
|
40
|
+
readonly isRefCounted: boolean;
|
|
39
41
|
constructor(decl: idl.IDLInterface, className: string, isInterface: boolean, isStaticMaterialized: boolean, superClass: idl.IDLReferenceType | undefined, interfaces: idl.IDLReferenceType[] | undefined, generics: string[] | undefined, fields: MaterializedField[], ctors: MaterializedMethod[], // zero size when used for global functions
|
|
40
42
|
finalizer: MaterializedMethod | undefined, // undefined when used for global functions
|
|
41
|
-
methods: MaterializedMethod[], needBeGenerated?: boolean, taggedMethods?: idl.IDLMethod[]);
|
|
43
|
+
methods: MaterializedMethod[], needBeGenerated?: boolean, taggedMethods?: idl.IDLMethod[], isRefCounted?: boolean);
|
|
42
44
|
getImplementationName(): string;
|
|
43
45
|
generatedName(isCallSignature: boolean): string;
|
|
44
46
|
private _isGlobal;
|
|
@@ -27,14 +27,15 @@ export class MaterializedField {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export class MaterializedMethod extends PeerMethod {
|
|
30
|
-
constructor(sig, originalParentName, implementationParentName, returnType, isCallSignature, uniqueOverloadName, method) {
|
|
31
|
-
super(sig, originalParentName, returnType, isCallSignature, uniqueOverloadName, method);
|
|
30
|
+
constructor(decl, sig, originalParentName, implementationParentName, returnType, isCallSignature, uniqueOverloadName, method) {
|
|
31
|
+
super(decl, sig, originalParentName, returnType, isCallSignature, uniqueOverloadName, method);
|
|
32
|
+
this.decl = decl;
|
|
32
33
|
this.implementationParentName = implementationParentName;
|
|
33
34
|
}
|
|
34
35
|
tsReturnType() {
|
|
35
36
|
return this.method.signature.returnType;
|
|
36
37
|
}
|
|
37
|
-
getPrivateMethod() {
|
|
38
|
+
getPrivateMethod(asProtected = false) {
|
|
38
39
|
var _a, _b;
|
|
39
40
|
let privateMethod = this;
|
|
40
41
|
if (!((_a = privateMethod.method.modifiers) === null || _a === void 0 ? void 0 : _a.includes(MethodModifier.PRIVATE))) {
|
|
@@ -43,7 +44,8 @@ export class MaterializedMethod extends PeerMethod {
|
|
|
43
44
|
modifiers: ((_b = this.method.modifiers) !== null && _b !== void 0 ? _b : [])
|
|
44
45
|
.filter(it => it !== MethodModifier.PUBLIC)
|
|
45
46
|
.filter(it => it !== MethodModifier.OVERRIDE)
|
|
46
|
-
.
|
|
47
|
+
.filter(it => !asProtected || (it !== MethodModifier.PRIVATE))
|
|
48
|
+
.concat([asProtected ? MethodModifier.PROTECTED : MethodModifier.PRIVATE])
|
|
47
49
|
})
|
|
48
50
|
});
|
|
49
51
|
}
|
|
@@ -59,12 +61,12 @@ export class MaterializedMethod extends PeerMethod {
|
|
|
59
61
|
}
|
|
60
62
|
export function copyMaterializedMethod(method, overrides) {
|
|
61
63
|
var _a;
|
|
62
|
-
return new MaterializedMethod(method.sig, method.originalParentName, method.implementationParentName, method.returnType, method.isCallSignature, method.uniqueOverloadName, (_a = overrides.method) !== null && _a !== void 0 ? _a : method.method);
|
|
64
|
+
return new MaterializedMethod(method.decl, method.sig, method.originalParentName, method.implementationParentName, method.returnType, method.isCallSignature, method.uniqueOverloadName, (_a = overrides.method) !== null && _a !== void 0 ? _a : method.method);
|
|
63
65
|
}
|
|
64
66
|
export class MaterializedClass {
|
|
65
67
|
constructor(decl, className, isInterface, isStaticMaterialized, superClass, interfaces, generics, fields, ctors, // zero size when used for global functions
|
|
66
68
|
finalizer, // undefined when used for global functions
|
|
67
|
-
methods, needBeGenerated = true, taggedMethods = []) {
|
|
69
|
+
methods, needBeGenerated = true, taggedMethods = [], isRefCounted = false) {
|
|
68
70
|
this.decl = decl;
|
|
69
71
|
this.className = className;
|
|
70
72
|
this.isInterface = isInterface;
|
|
@@ -78,6 +80,7 @@ export class MaterializedClass {
|
|
|
78
80
|
this.methods = methods;
|
|
79
81
|
this.needBeGenerated = needBeGenerated;
|
|
80
82
|
this.taggedMethods = taggedMethods;
|
|
83
|
+
this.isRefCounted = isRefCounted;
|
|
81
84
|
this._isGlobal = false;
|
|
82
85
|
}
|
|
83
86
|
getImplementationName() {
|
|
@@ -97,7 +100,7 @@ export function createDestroyPeerMethod(clazz) {
|
|
|
97
100
|
if (clazz.isGlobalScope() || clazz.isStaticMaterialized) {
|
|
98
101
|
return undefined;
|
|
99
102
|
}
|
|
100
|
-
return new MaterializedMethod(new PeerMethodSignature(PeerMethodSignature.DESTROY, '%NEVER_USED$', [], idl.IDLVoidType, clazz.decl), idl.getQualifiedName(clazz.decl, "namespace.name").split('.').join('_'), clazz.getImplementationName(), idl.IDLVoidType, false, PeerMethodSignature.DESTROY, new Method(PeerMethodSignature.DESTROY, new NamedMethodSignature(idl.IDLVoidType, [idl.createReferenceType(clazz.decl)], ['peer'])));
|
|
103
|
+
return new MaterializedMethod(undefined, new PeerMethodSignature(PeerMethodSignature.DESTROY, '%NEVER_USED$', [], idl.IDLVoidType, clazz.decl), idl.getQualifiedName(clazz.decl, "namespace.name").split('.').join('_'), clazz.getImplementationName(), idl.IDLVoidType, false, PeerMethodSignature.DESTROY, new Method(PeerMethodSignature.DESTROY, new NamedMethodSignature(idl.IDLVoidType, [idl.createReferenceType(clazz.decl)], ['peer'])));
|
|
101
104
|
}
|
|
102
105
|
export function getInternalClassName(name) {
|
|
103
106
|
return `${name}Internal`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDLFile, IDLProperty } from "../idl";
|
|
1
|
+
import { IDLFile, IDLInterface, IDLProperty } from "../idl";
|
|
2
2
|
import { PeerMethod } from "./PeerMethod";
|
|
3
3
|
export interface PeerClassBase {
|
|
4
4
|
generatedName(isCallSignature: boolean): string;
|
|
@@ -8,10 +8,11 @@ export interface ComponentBuilderInfo {
|
|
|
8
8
|
peerMethodName: string;
|
|
9
9
|
}
|
|
10
10
|
export declare class PeerClass implements PeerClassBase {
|
|
11
|
+
readonly decl: IDLInterface;
|
|
11
12
|
readonly file: IDLFile;
|
|
12
13
|
readonly componentName: string;
|
|
13
14
|
readonly originalFilename: string;
|
|
14
|
-
constructor(file: IDLFile, componentName: string, originalFilename: string);
|
|
15
|
+
constructor(decl: IDLInterface, file: IDLFile, componentName: string, originalFilename: string);
|
|
15
16
|
generatedName(isCallSignature: boolean): string;
|
|
16
17
|
methods: PeerMethod[];
|
|
17
18
|
componentBuilderInfos: ComponentBuilderInfo[];
|
|
@@ -16,7 +16,8 @@ import { IDLI32Type, IDLPointerType } from "../idl";
|
|
|
16
16
|
import { PeerMethod, PeerMethodArg, PeerMethodSignature } from "./PeerMethod";
|
|
17
17
|
import { Method, MethodModifier, NamedMethodSignature } from "../LanguageWriters/LanguageWriter";
|
|
18
18
|
export class PeerClass {
|
|
19
|
-
constructor(file, componentName, originalFilename) {
|
|
19
|
+
constructor(decl, file, componentName, originalFilename) {
|
|
20
|
+
this.decl = decl;
|
|
20
21
|
this.file = file;
|
|
21
22
|
this.componentName = componentName;
|
|
22
23
|
this.originalFilename = originalFilename;
|
|
@@ -37,6 +38,6 @@ export class PeerClass {
|
|
|
37
38
|
export function createConstructPeerMethod(clazz) {
|
|
38
39
|
// TODO here is class FQName needed, but can not calculate if from current PeerClass data
|
|
39
40
|
const classFQN = [clazz.componentName];
|
|
40
|
-
return new PeerMethod(new PeerMethodSignature(PeerMethodSignature.CTOR, classFQN.concat(PeerMethodSignature.CTOR).join('_'), [new PeerMethodArg('id', IDLI32Type), new PeerMethodArg('flags', IDLI32Type)], IDLPointerType), clazz.componentName, IDLPointerType, false, PeerMethodSignature.CTOR, new Method('construct', new NamedMethodSignature(IDLPointerType, [IDLI32Type, IDLI32Type], ['id', 'flags']), [MethodModifier.STATIC]));
|
|
41
|
+
return new PeerMethod(undefined, new PeerMethodSignature(PeerMethodSignature.CTOR, classFQN.concat(PeerMethodSignature.CTOR).join('_'), [new PeerMethodArg('id', IDLI32Type), new PeerMethodArg('flags', IDLI32Type)], IDLPointerType), clazz.componentName, IDLPointerType, false, PeerMethodSignature.CTOR, new Method('construct', new NamedMethodSignature(IDLPointerType, [IDLI32Type, IDLI32Type], ['id', 'flags']), [MethodModifier.STATIC]));
|
|
41
42
|
}
|
|
42
43
|
//# sourceMappingURL=PeerClass.js.map
|
|
@@ -17,7 +17,7 @@ import * as idl from '../idl';
|
|
|
17
17
|
import { resolveNamedNode } from '../resolveNamedNode';
|
|
18
18
|
import { Language } from '../Language';
|
|
19
19
|
import { createLanguageWriter } from '../LanguageWriters';
|
|
20
|
-
import { BufferConvertor, CallbackConvertor, DateConvertor, MapConvertor, PointerConvertor, TupleConvertor, TypeAliasConvertor, AggregateConvertor, StringConvertor, ClassConvertor, ArrayConvertor, FunctionConvertor, OptionConvertor, NumberConvertor, NumericConvertor, CustomTypeConvertor, UnionConvertor, MaterializedClassConvertor, BooleanConvertor, EnumConvertor, UndefinedConvertor, VoidConvertor, ImportTypeConvertor, InterfaceConvertor, BigIntToU64Convertor, ObjectConvertor,
|
|
20
|
+
import { BufferConvertor, CallbackConvertor, DateConvertor, MapConvertor, PointerConvertor, TupleConvertor, TypeAliasConvertor, AggregateConvertor, StringConvertor, ClassConvertor, ArrayConvertor, FunctionConvertor, OptionConvertor, NumberConvertor, NumericConvertor, CustomTypeConvertor, UnionConvertor, MaterializedClassConvertor, BooleanConvertor, EnumConvertor, UndefinedConvertor, VoidConvertor, ImportTypeConvertor, InterfaceConvertor, BigIntToU64Convertor, ObjectConvertor, } from "../LanguageWriters/ArgConvertors";
|
|
21
21
|
import { CppNameConvertor } from '../LanguageWriters/convertors/CppConvertors';
|
|
22
22
|
import { CJTypeNameConvertor } from '../LanguageWriters/convertors/CJConvertors';
|
|
23
23
|
import { CppConvertor } from '../LanguageWriters/convertors/CppConvertors';
|
|
@@ -297,7 +297,7 @@ export class PeerLibrary {
|
|
|
297
297
|
case idl.IDLU64Type: return new NumericConvertor(param, type);
|
|
298
298
|
case idl.IDLF16Type: return new NumericConvertor(param, type);
|
|
299
299
|
case idl.IDLF32Type: return new NumericConvertor(param, type);
|
|
300
|
-
case idl.IDLF64Type: return new
|
|
300
|
+
case idl.IDLF64Type: return new NumericConvertor(param, type);
|
|
301
301
|
case idl.IDLBigintType: return new BigIntToU64Convertor(param);
|
|
302
302
|
case idl.IDLSerializerBuffer: new PointerConvertor(param);
|
|
303
303
|
case idl.IDLPointerType: return new PointerConvertor(param);
|
|
@@ -27,13 +27,14 @@ export declare class PeerMethodSignature {
|
|
|
27
27
|
static get DESTROY(): string;
|
|
28
28
|
}
|
|
29
29
|
export declare class PeerMethod {
|
|
30
|
+
decl: idl.IDLConstructor | idl.IDLMethod | idl.IDLCallable | idl.IDLProperty | undefined;
|
|
30
31
|
sig: PeerMethodSignature;
|
|
31
32
|
originalParentName: string;
|
|
32
33
|
returnType: IDLType;
|
|
33
34
|
isCallSignature: boolean;
|
|
34
35
|
uniqueOverloadName: string;
|
|
35
36
|
method: Method;
|
|
36
|
-
constructor(sig: PeerMethodSignature, originalParentName: string, returnType: IDLType, isCallSignature: boolean, uniqueOverloadName: string, method: Method);
|
|
37
|
+
constructor(decl: idl.IDLConstructor | idl.IDLMethod | idl.IDLCallable | idl.IDLProperty | undefined, sig: PeerMethodSignature, originalParentName: string, returnType: IDLType, isCallSignature: boolean, uniqueOverloadName: string, method: Method);
|
|
37
38
|
argConvertors(library: PeerLibrary): ArgConvertor[];
|
|
38
39
|
argAndOutConvertors(library: PeerLibrary): ArgConvertor[];
|
|
39
40
|
}
|
|
@@ -80,11 +80,12 @@ export class PeerMethodSignature {
|
|
|
80
80
|
static get DESTROY() { return "destroyPeer"; }
|
|
81
81
|
}
|
|
82
82
|
export class PeerMethod {
|
|
83
|
-
constructor(sig, originalParentName, returnType, isCallSignature,
|
|
83
|
+
constructor(decl, sig, originalParentName, returnType, isCallSignature,
|
|
84
84
|
// arkts specific feature, where overloads - are different functions grouped by overload keyword.
|
|
85
85
|
// Must be moved to interface description as so as `method` field
|
|
86
86
|
uniqueOverloadName, method) {
|
|
87
87
|
var _a, _b;
|
|
88
|
+
this.decl = decl;
|
|
88
89
|
this.sig = sig;
|
|
89
90
|
this.originalParentName = originalParentName;
|
|
90
91
|
this.returnType = returnType;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as idl from '../idl';
|
|
2
2
|
import { ReferenceResolver } from './ReferenceResolver';
|
|
3
|
+
export declare function getExtendsChain(declaration: idl.IDLInterface, resolver: ReferenceResolver): idl.IDLReferenceType[];
|
|
3
4
|
export declare function getSuper(declaration: idl.IDLInterface, resolver: ReferenceResolver): idl.IDLInterface | undefined;
|
|
4
5
|
export declare function getSuperType(declaration: idl.IDLInterface, resolver: ReferenceResolver): idl.IDLReferenceType | undefined;
|
|
5
6
|
//# sourceMappingURL=getSuperType.d.ts.map
|
|
@@ -44,6 +44,15 @@ function getSuperTuple(declaration, resolver) {
|
|
|
44
44
|
}
|
|
45
45
|
return [resolved, fst];
|
|
46
46
|
}
|
|
47
|
+
export function getExtendsChain(declaration, resolver) {
|
|
48
|
+
let extendsChain = [];
|
|
49
|
+
let resolved = getSuperTuple(declaration, resolver);
|
|
50
|
+
while (resolved) {
|
|
51
|
+
extendsChain.push(resolved[1]);
|
|
52
|
+
resolved = getSuperTuple(resolved[0], resolver);
|
|
53
|
+
}
|
|
54
|
+
return extendsChain;
|
|
55
|
+
}
|
|
47
56
|
export function getSuper(declaration, resolver) {
|
|
48
57
|
var _a;
|
|
49
58
|
return (_a = getSuperTuple(declaration, resolver)) === null || _a === void 0 ? void 0 : _a[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idlizer/core",
|
|
3
|
-
"version": "2.1.10-arktscgen-
|
|
3
|
+
"version": "2.1.10-arktscgen-3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "build/lib/src/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"scripts": {
|
|
48
48
|
"test": "mocha",
|
|
49
49
|
"clean": "rimraf -g build",
|
|
50
|
-
"compile": "tsc -b ."
|
|
50
|
+
"compile:self": "tsc -b .",
|
|
51
|
+
"compile": "npm run compile:self"
|
|
51
52
|
}
|
|
52
53
|
}
|