@idlizer/core 2.1.9-arktscgen-9 → 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.js +5 -3
- 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 +3 -1
- 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/config.d.ts +66 -0
- package/build/lib/src/config.js +2 -0
- package/build/lib/src/configDescriber.js +1 -1
- package/build/lib/src/diagnosticmessages.d.ts +18 -12
- package/build/lib/src/diagnosticmessages.js +22 -14
- package/build/lib/src/diagnostictypes.d.ts +3 -9
- package/build/lib/src/formatter.d.ts +2 -1
- package/build/lib/src/formatter.js +3 -3
- package/build/lib/src/from-idl/deserialize.js +139 -6
- package/build/lib/src/from-idl/parser.d.ts +99 -0
- package/build/lib/src/from-idl/parser.js +943 -0
- package/build/lib/src/idl.d.ts +13 -1
- package/build/lib/src/idl.js +6 -0
- package/build/lib/src/index.d.ts +1 -0
- package/build/lib/src/index.js +1 -0
- package/build/lib/src/peer-generation/LayoutManager.d.ts +1 -1
- 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 +8 -2
- package/build/lib/src/peer-generation/PeerClass.js +4 -2
- package/build/lib/src/peer-generation/PeerLibrary.d.ts +1 -0
- package/build/lib/src/peer-generation/PeerLibrary.js +6 -0
- package/build/lib/src/peer-generation/PeerMethod.d.ts +9 -2
- package/build/lib/src/peer-generation/PeerMethod.js +23 -4
- package/build/lib/src/peer-generation/getSuperType.d.ts +1 -0
- package/build/lib/src/peer-generation/getSuperType.js +9 -0
- package/package.json +12 -4
package/build/lib/src/idl.d.ts
CHANGED
|
@@ -35,11 +35,13 @@ export declare enum IDLEntity {
|
|
|
35
35
|
}
|
|
36
36
|
export declare enum IDLExtendedAttributes {
|
|
37
37
|
Accessor = "Accessor",
|
|
38
|
+
Annotations = "Annotations",
|
|
38
39
|
Async = "Async",
|
|
39
40
|
CallSignature = "CallSignature",
|
|
40
41
|
CommonMethod = "CommonMethod",
|
|
41
42
|
Component = "Component",
|
|
42
43
|
ComponentInterface = "ComponentInterface",
|
|
44
|
+
ComponentModifier = "ComponentModifier",
|
|
43
45
|
Deprecated = "Deprecated",
|
|
44
46
|
Documentation = "Documentation",
|
|
45
47
|
DtsName = "DtsName",
|
|
@@ -57,14 +59,18 @@ export declare enum IDLExtendedAttributes {
|
|
|
57
59
|
OriginalGenericName = "OriginalGenericName",
|
|
58
60
|
Predefined = "Predefined",
|
|
59
61
|
Protected = "Protected",
|
|
62
|
+
Abstract = "Abstract",
|
|
60
63
|
Synthetic = "Synthetic",
|
|
61
64
|
Throws = "Throws",
|
|
62
65
|
TraceKey = "TraceKey",
|
|
66
|
+
TypeAnnotations = "TypeAnnotations",
|
|
63
67
|
TypeArguments = "TypeArguments",
|
|
64
68
|
TypeParameters = "TypeParameters",
|
|
65
69
|
VerbatimDts = "VerbatimDts",
|
|
66
70
|
HandWrittenImplementation = "HandWrittenImplementation",
|
|
67
|
-
ExtraMethod = "ExtraMethod"
|
|
71
|
+
ExtraMethod = "ExtraMethod",
|
|
72
|
+
OverloadAlias = "OverloadAlias",
|
|
73
|
+
OverloadPriority = "OverloadPriority"
|
|
68
74
|
}
|
|
69
75
|
export declare enum IDLAccessorAttribute {
|
|
70
76
|
Getter = "Getter",
|
|
@@ -73,6 +79,9 @@ export declare enum IDLAccessorAttribute {
|
|
|
73
79
|
export interface IDLExtendedAttribute {
|
|
74
80
|
name: string;
|
|
75
81
|
value?: string;
|
|
82
|
+
typesValue?: IDLType[];
|
|
83
|
+
nameLocation?: Location;
|
|
84
|
+
valueLocation?: Location;
|
|
76
85
|
}
|
|
77
86
|
export interface IDLNode {
|
|
78
87
|
_idlNodeBrand: any;
|
|
@@ -296,6 +305,9 @@ export type IDLNodeInitializer = {
|
|
|
296
305
|
extendedAttributes?: IDLExtendedAttribute[];
|
|
297
306
|
fileName?: string;
|
|
298
307
|
documentation?: string;
|
|
308
|
+
nodeLocation?: Location;
|
|
309
|
+
nameLocation?: Location;
|
|
310
|
+
valueLocation?: Location;
|
|
299
311
|
};
|
|
300
312
|
export declare function createNamespace(name: string, members?: IDLEntry[], nodeInitializer?: IDLNodeInitializer): IDLNamespace;
|
|
301
313
|
export declare function linkParentBack<T extends IDLNode>(node: T): T;
|
package/build/lib/src/idl.js
CHANGED
|
@@ -54,11 +54,13 @@ export var IDLEntity;
|
|
|
54
54
|
export var IDLExtendedAttributes;
|
|
55
55
|
(function (IDLExtendedAttributes) {
|
|
56
56
|
IDLExtendedAttributes["Accessor"] = "Accessor";
|
|
57
|
+
IDLExtendedAttributes["Annotations"] = "Annotations";
|
|
57
58
|
IDLExtendedAttributes["Async"] = "Async";
|
|
58
59
|
IDLExtendedAttributes["CallSignature"] = "CallSignature";
|
|
59
60
|
IDLExtendedAttributes["CommonMethod"] = "CommonMethod";
|
|
60
61
|
IDLExtendedAttributes["Component"] = "Component";
|
|
61
62
|
IDLExtendedAttributes["ComponentInterface"] = "ComponentInterface";
|
|
63
|
+
IDLExtendedAttributes["ComponentModifier"] = "ComponentModifier";
|
|
62
64
|
IDLExtendedAttributes["Deprecated"] = "Deprecated";
|
|
63
65
|
IDLExtendedAttributes["Documentation"] = "Documentation";
|
|
64
66
|
IDLExtendedAttributes["DtsName"] = "DtsName";
|
|
@@ -76,14 +78,18 @@ export var IDLExtendedAttributes;
|
|
|
76
78
|
IDLExtendedAttributes["OriginalGenericName"] = "OriginalGenericName";
|
|
77
79
|
IDLExtendedAttributes["Predefined"] = "Predefined";
|
|
78
80
|
IDLExtendedAttributes["Protected"] = "Protected";
|
|
81
|
+
IDLExtendedAttributes["Abstract"] = "Abstract";
|
|
79
82
|
IDLExtendedAttributes["Synthetic"] = "Synthetic";
|
|
80
83
|
IDLExtendedAttributes["Throws"] = "Throws";
|
|
81
84
|
IDLExtendedAttributes["TraceKey"] = "TraceKey";
|
|
85
|
+
IDLExtendedAttributes["TypeAnnotations"] = "TypeAnnotations";
|
|
82
86
|
IDLExtendedAttributes["TypeArguments"] = "TypeArguments";
|
|
83
87
|
IDLExtendedAttributes["TypeParameters"] = "TypeParameters";
|
|
84
88
|
IDLExtendedAttributes["VerbatimDts"] = "VerbatimDts";
|
|
85
89
|
IDLExtendedAttributes["HandWrittenImplementation"] = "HandWrittenImplementation";
|
|
86
90
|
IDLExtendedAttributes["ExtraMethod"] = "ExtraMethod";
|
|
91
|
+
IDLExtendedAttributes["OverloadAlias"] = "OverloadAlias";
|
|
92
|
+
IDLExtendedAttributes["OverloadPriority"] = "OverloadPriority";
|
|
87
93
|
})(IDLExtendedAttributes || (IDLExtendedAttributes = {}));
|
|
88
94
|
export var IDLAccessorAttribute;
|
|
89
95
|
(function (IDLAccessorAttribute) {
|
package/build/lib/src/index.d.ts
CHANGED
|
@@ -58,5 +58,6 @@ export * from "./from-idl/IDLLinter";
|
|
|
58
58
|
export { fromIDL, scanIDL } from "./from-idl/common";
|
|
59
59
|
export { idlToDtsString, CustomPrintVisitor } from "./from-idl/DtsPrinter";
|
|
60
60
|
export { toIDLFile, addSyntheticType, resolveSyntheticType, IDLTokenInfoMap } from "./from-idl/deserialize";
|
|
61
|
+
export { Parser, FatalParserException } from "./from-idl/parser";
|
|
61
62
|
export { D, ConfigTypeInfer, ConfigSchema, inspectSchema } from './configDescriber';
|
|
62
63
|
//# sourceMappingURL=index.d.ts.map
|
package/build/lib/src/index.js
CHANGED
|
@@ -72,5 +72,6 @@ export * from "./from-idl/IDLLinter";
|
|
|
72
72
|
export { fromIDL, scanIDL } from "./from-idl/common";
|
|
73
73
|
export { idlToDtsString, CustomPrintVisitor } from "./from-idl/DtsPrinter";
|
|
74
74
|
export { toIDLFile, addSyntheticType, resolveSyntheticType } from "./from-idl/deserialize";
|
|
75
|
+
export { Parser, FatalParserException } from "./from-idl/parser";
|
|
75
76
|
export { D, inspectSchema } from './configDescriber';
|
|
76
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ export declare enum LayoutNodeRole {
|
|
|
6
6
|
COMPONENT = 3,
|
|
7
7
|
SERIALIZER = 4
|
|
8
8
|
}
|
|
9
|
-
export type LayoutTargetDescriptionHint = 'component.implementation' | 'component.interface' | 'component.function';
|
|
9
|
+
export type LayoutTargetDescriptionHint = 'component.implementation' | 'component.interface' | 'component.function' | 'component.modifier';
|
|
10
10
|
export interface LayoutTargetDescription {
|
|
11
11
|
node: IDLEntry;
|
|
12
12
|
role: LayoutNodeRole;
|
|
@@ -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, 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, method) {
|
|
31
|
-
super(sig, originalParentName, returnType, isCallSignature, 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, (_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, new Method(
|
|
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,15 +1,21 @@
|
|
|
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;
|
|
5
5
|
}
|
|
6
|
+
export interface ComponentBuilderInfo {
|
|
7
|
+
uniqueOverloadName: string;
|
|
8
|
+
peerMethodName: string;
|
|
9
|
+
}
|
|
6
10
|
export declare class PeerClass implements PeerClassBase {
|
|
11
|
+
readonly decl: IDLInterface;
|
|
7
12
|
readonly file: IDLFile;
|
|
8
13
|
readonly componentName: string;
|
|
9
14
|
readonly originalFilename: string;
|
|
10
|
-
constructor(file: IDLFile, componentName: string, originalFilename: string);
|
|
15
|
+
constructor(decl: IDLInterface, file: IDLFile, componentName: string, originalFilename: string);
|
|
11
16
|
generatedName(isCallSignature: boolean): string;
|
|
12
17
|
methods: PeerMethod[];
|
|
18
|
+
componentBuilderInfos: ComponentBuilderInfo[];
|
|
13
19
|
originalClassName: string | undefined;
|
|
14
20
|
originalInterfaceName: string | undefined;
|
|
15
21
|
originalParentName: string | undefined;
|
|
@@ -16,11 +16,13 @@ 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;
|
|
23
24
|
this.methods = [];
|
|
25
|
+
this.componentBuilderInfos = [];
|
|
24
26
|
this.originalClassName = undefined;
|
|
25
27
|
this.originalInterfaceName = undefined;
|
|
26
28
|
this.originalParentName = undefined;
|
|
@@ -36,6 +38,6 @@ export class PeerClass {
|
|
|
36
38
|
export function createConstructPeerMethod(clazz) {
|
|
37
39
|
// TODO here is class FQName needed, but can not calculate if from current PeerClass data
|
|
38
40
|
const classFQN = [clazz.componentName];
|
|
39
|
-
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, 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]));
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=PeerClass.js.map
|
|
@@ -10297,6 +10297,7 @@ export declare class PeerLibrary implements LibraryInterface {
|
|
|
10297
10297
|
getInteropName(node: idl.IDLNode): string;
|
|
10298
10298
|
toDeclaration(type: idl.IDLType | idl.IDLTypedef | idl.IDLCallback | idl.IDLEnum | idl.IDLInterface): idl.IDLEntry | idl.IDLType;
|
|
10299
10299
|
setFileLayout(strategy: LayoutManagerStrategy): void;
|
|
10300
|
+
withFileLayout(strategy: LayoutManagerStrategy, op: () => void): void;
|
|
10300
10301
|
}
|
|
10301
10302
|
export declare const ArkInt32: idl.IDLPrimitiveType;
|
|
10302
10303
|
export declare const ArkInt64: idl.IDLPrimitiveType;
|
|
@@ -474,6 +474,12 @@ export class PeerLibrary {
|
|
|
474
474
|
setFileLayout(strategy) {
|
|
475
475
|
this.layout = new LayoutManager(strategy);
|
|
476
476
|
}
|
|
477
|
+
withFileLayout(strategy, op) {
|
|
478
|
+
const old = this.layout;
|
|
479
|
+
this.layout = new LayoutManager(strategy);
|
|
480
|
+
op();
|
|
481
|
+
this.layout = old;
|
|
482
|
+
}
|
|
477
483
|
}
|
|
478
484
|
export const ArkInt32 = idl.IDLI32Type;
|
|
479
485
|
export const ArkInt64 = idl.IDLI64Type;
|
|
@@ -8,6 +8,11 @@ export declare class PeerMethodArg {
|
|
|
8
8
|
readonly type: idl.IDLType;
|
|
9
9
|
constructor(name: string, type: idl.IDLType);
|
|
10
10
|
}
|
|
11
|
+
export type OverloadInfo = {
|
|
12
|
+
postfix: string;
|
|
13
|
+
alias?: string;
|
|
14
|
+
priority?: number;
|
|
15
|
+
};
|
|
11
16
|
export declare class PeerMethodSignature {
|
|
12
17
|
readonly name: string;
|
|
13
18
|
readonly fqname: string;
|
|
@@ -16,18 +21,20 @@ export declare class PeerMethodSignature {
|
|
|
16
21
|
readonly context: idl.IDLEntry | undefined;
|
|
17
22
|
readonly modifiers: (MethodModifier.FORCE_CONTEXT | MethodModifier.THROWS)[];
|
|
18
23
|
constructor(name: string, fqname: string, args: PeerMethodArg[], returnType: idl.IDLType, context?: idl.IDLEntry | undefined, modifiers?: (MethodModifier.FORCE_CONTEXT | MethodModifier.THROWS)[]);
|
|
19
|
-
static
|
|
24
|
+
static mangleOverloadedName(decl: idl.IDLConstructor | idl.IDLMethod | idl.IDLCallable | idl.IDLProperty): OverloadInfo;
|
|
20
25
|
static get CTOR(): string;
|
|
21
26
|
static get GET_FINALIZER(): string;
|
|
22
27
|
static get DESTROY(): string;
|
|
23
28
|
}
|
|
24
29
|
export declare class PeerMethod {
|
|
30
|
+
decl: idl.IDLConstructor | idl.IDLMethod | idl.IDLCallable | idl.IDLProperty | undefined;
|
|
25
31
|
sig: PeerMethodSignature;
|
|
26
32
|
originalParentName: string;
|
|
27
33
|
returnType: IDLType;
|
|
28
34
|
isCallSignature: boolean;
|
|
35
|
+
uniqueOverloadName: string;
|
|
29
36
|
method: Method;
|
|
30
|
-
constructor(sig: PeerMethodSignature, originalParentName: string, returnType: IDLType, isCallSignature: boolean, 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);
|
|
31
38
|
argConvertors(library: PeerLibrary): ArgConvertor[];
|
|
32
39
|
argAndOutConvertors(library: PeerLibrary): ArgConvertor[];
|
|
33
40
|
}
|
|
@@ -36,9 +36,15 @@ export class PeerMethodSignature {
|
|
|
36
36
|
this.context = context;
|
|
37
37
|
this.modifiers = modifiers;
|
|
38
38
|
}
|
|
39
|
-
static
|
|
39
|
+
static mangleOverloadedName(decl) {
|
|
40
40
|
if (!decl.parent)
|
|
41
|
-
return
|
|
41
|
+
return { postfix: "", };
|
|
42
|
+
let alias;
|
|
43
|
+
let forcedPriority;
|
|
44
|
+
if (idl.hasExtAttribute(decl, idl.IDLExtendedAttributes.OverloadAlias)) {
|
|
45
|
+
alias = idl.getExtAttribute(decl, idl.IDLExtendedAttributes.OverloadAlias);
|
|
46
|
+
forcedPriority = Number.parseInt(idl.getExtAttribute(decl, idl.IDLExtendedAttributes.OverloadPriority));
|
|
47
|
+
}
|
|
42
48
|
let sameNamed = [];
|
|
43
49
|
if (idl.isMethod(decl) || idl.isProperty(decl)) {
|
|
44
50
|
let members = [];
|
|
@@ -59,19 +65,32 @@ export class PeerMethodSignature {
|
|
|
59
65
|
else {
|
|
60
66
|
throw new Error("unexpected type of declaration");
|
|
61
67
|
}
|
|
62
|
-
return sameNamed.length > 1 ?
|
|
68
|
+
return sameNamed.length > 1 ? {
|
|
69
|
+
postfix: sameNamed.indexOf(decl).toString(),
|
|
70
|
+
alias,
|
|
71
|
+
priority: forcedPriority !== null && forcedPriority !== void 0 ? forcedPriority : sameNamed.indexOf(decl)
|
|
72
|
+
} : {
|
|
73
|
+
postfix: '',
|
|
74
|
+
alias,
|
|
75
|
+
priority: forcedPriority,
|
|
76
|
+
};
|
|
63
77
|
}
|
|
64
78
|
static get CTOR() { return "construct"; }
|
|
65
79
|
static get GET_FINALIZER() { return "getFinalizer"; }
|
|
66
80
|
static get DESTROY() { return "destroyPeer"; }
|
|
67
81
|
}
|
|
68
82
|
export class PeerMethod {
|
|
69
|
-
constructor(sig, originalParentName, returnType, isCallSignature,
|
|
83
|
+
constructor(decl, sig, originalParentName, returnType, isCallSignature,
|
|
84
|
+
// arkts specific feature, where overloads - are different functions grouped by overload keyword.
|
|
85
|
+
// Must be moved to interface description as so as `method` field
|
|
86
|
+
uniqueOverloadName, method) {
|
|
70
87
|
var _a, _b;
|
|
88
|
+
this.decl = decl;
|
|
71
89
|
this.sig = sig;
|
|
72
90
|
this.originalParentName = originalParentName;
|
|
73
91
|
this.returnType = returnType;
|
|
74
92
|
this.isCallSignature = isCallSignature;
|
|
93
|
+
this.uniqueOverloadName = uniqueOverloadName;
|
|
75
94
|
this.method = method;
|
|
76
95
|
// todo remove me
|
|
77
96
|
if ((_a = method.modifiers) === null || _a === void 0 ? void 0 : _a.includes(MethodModifier.FORCE_CONTEXT))
|
|
@@ -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.
|
|
3
|
+
"version": "2.1.10-arktscgen-3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "build/lib/src/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -27,19 +27,27 @@
|
|
|
27
27
|
"webidl2.js/dist/**/*.js",
|
|
28
28
|
"webidl2.js/package.json"
|
|
29
29
|
],
|
|
30
|
-
"type": "module",
|
|
31
30
|
"engines": {
|
|
32
31
|
"npm": ">= 8",
|
|
33
32
|
"node": ">= 18"
|
|
34
33
|
},
|
|
35
34
|
"keywords": [],
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@koalaui/interop": "1.7.
|
|
36
|
+
"@koalaui/interop": "1.7.9",
|
|
38
37
|
"typescript": "4.9.5",
|
|
39
38
|
"@types/node": "^18.0.0"
|
|
40
39
|
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@koalaui/harness": "1.7.6+devel",
|
|
42
|
+
"@koalaui/ets-tsc": "4.9.5-r5",
|
|
43
|
+
"@types/mocha": "^9.1.0",
|
|
44
|
+
"mocha": "^9.2.2",
|
|
45
|
+
"ts-node": "^10.9.2"
|
|
46
|
+
},
|
|
41
47
|
"scripts": {
|
|
48
|
+
"test": "mocha",
|
|
42
49
|
"clean": "rimraf -g build",
|
|
43
|
-
"compile": "tsc -b ."
|
|
50
|
+
"compile:self": "tsc -b .",
|
|
51
|
+
"compile": "npm run compile:self"
|
|
44
52
|
}
|
|
45
53
|
}
|