@idlizer/core 2.1.10-arktscgen-5 → 2.1.10-arktscgen-6
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/Language.js +1 -1
- package/build/lib/src/LanguageWriters/ArgConvertors.d.ts +16 -6
- package/build/lib/src/LanguageWriters/ArgConvertors.js +80 -92
- package/build/lib/src/LanguageWriters/LanguageWriter.d.ts +8 -6
- package/build/lib/src/LanguageWriters/LanguageWriter.js +8 -2
- package/build/lib/src/LanguageWriters/common.d.ts +1 -0
- package/build/lib/src/LanguageWriters/common.js +2 -1
- package/build/lib/src/LanguageWriters/convertors/CppConvertors.d.ts +7 -1
- package/build/lib/src/LanguageWriters/convertors/CppConvertors.js +53 -15
- package/build/lib/src/LanguageWriters/convertors/ETSConvertors.d.ts +1 -0
- package/build/lib/src/LanguageWriters/convertors/ETSConvertors.js +10 -8
- package/build/lib/src/LanguageWriters/convertors/InteropConvertors.js +1 -1
- package/build/lib/src/LanguageWriters/convertors/TSConvertors.js +25 -14
- package/build/lib/src/LanguageWriters/index.d.ts +4 -3
- package/build/lib/src/LanguageWriters/index.js +9 -11
- package/build/lib/src/LanguageWriters/nameConvertor.d.ts +2 -0
- package/build/lib/src/LanguageWriters/nameConvertor.js +11 -0
- package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.js +1 -1
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.d.ts +1 -8
- package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.js +52 -89
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.d.ts +3 -0
- package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.js +24 -7
- package/build/lib/src/config.d.ts +2 -1461
- package/build/lib/src/config.js +16 -32
- package/build/lib/src/configMerge.d.ts +3 -0
- package/build/lib/src/configMerge.js +63 -0
- package/build/lib/src/diagnostictypes.d.ts +1 -5
- package/build/lib/src/diagnostictypes.js +1 -27
- package/build/lib/src/from-idl/DtsPrinter.js +12 -5
- package/build/lib/src/from-idl/IDLLinter.d.ts +3 -4
- package/build/lib/src/from-idl/IDLLinter.js +30 -32
- package/build/lib/src/from-idl/deserialize.d.ts +3 -4
- package/build/lib/src/from-idl/deserialize.js +29 -641
- package/build/lib/src/from-idl/parser.d.ts +20 -2
- package/build/lib/src/from-idl/parser.js +97 -29
- package/build/lib/src/idl/builders.d.ts +43 -0
- package/build/lib/src/idl/builders.js +135 -0
- package/build/lib/src/idl/discriminators.d.ts +53 -0
- package/build/lib/src/idl/discriminators.js +232 -0
- package/build/lib/src/idl/dump.d.ts +48 -0
- package/build/lib/src/idl/dump.js +327 -0
- package/build/lib/src/idl/index.d.ts +9 -0
- package/build/lib/src/idl/index.js +23 -0
- package/build/lib/src/idl/keywords.d.ts +2 -0
- package/build/lib/src/{options.js → idl/keywords.js} +7 -3
- package/build/lib/src/idl/node.d.ts +233 -0
- package/build/lib/src/idl/node.js +103 -0
- package/build/lib/src/idl/stdlib.d.ts +34 -0
- package/build/lib/src/idl/stdlib.js +54 -0
- package/build/lib/src/idl/utils.d.ts +44 -0
- package/build/lib/src/idl/utils.js +215 -0
- package/build/lib/src/idl/visitors.d.ts +15 -0
- package/build/lib/src/idl/visitors.js +593 -0
- package/build/lib/src/index.d.ts +4 -2
- package/build/lib/src/index.js +5 -3
- package/build/lib/src/inputPaths.d.ts +11 -0
- package/build/lib/src/inputPaths.js +81 -0
- package/build/lib/src/languageSpecificKeywords.d.ts +0 -1
- package/build/lib/src/languageSpecificKeywords.js +0 -5
- package/build/lib/src/peer-generation/LayoutManager.d.ts +1 -1
- package/build/lib/src/peer-generation/Materialized.d.ts +8 -2
- package/build/lib/src/peer-generation/Materialized.js +24 -12
- package/build/lib/src/peer-generation/PeerLibrary.d.ts +10 -15
- package/build/lib/src/peer-generation/PeerLibrary.js +35 -215
- package/build/lib/src/peer-generation/ReferenceResolver.d.ts +6 -1
- package/build/lib/src/peer-generation/ReferenceResolver.js +93 -2
- package/build/lib/src/peer-generation/idl/common.d.ts +6 -2
- package/build/lib/src/peer-generation/idl/common.js +7 -7
- package/build/lib/src/peer-generation/isMaterialized.js +2 -3
- package/build/lib/src/peer-generation/modules.js +2 -0
- package/build/lib/src/peer-generation/toDeclaration.d.ts +4 -0
- package/build/lib/src/peer-generation/toDeclaration.js +53 -0
- package/build/lib/src/peer-generation/unions.d.ts +1 -1
- package/build/lib/src/peer-generation/unions.js +15 -7
- package/build/lib/src/resolveNamedNode.d.ts +1 -0
- package/build/lib/src/resolveNamedNode.js +7 -0
- package/build/lib/src/transformers/FqnTransformer.d.ts +1 -1
- package/build/lib/src/transformers/FqnTransformer.js +20 -12
- package/build/lib/src/transformers/GenericTransformer.d.ts +4 -3
- package/build/lib/src/transformers/GenericTransformer.js +252 -158
- package/build/lib/src/transformers/IdlTransformer.d.ts +6 -0
- package/build/lib/src/transformers/IdlTransformer.js +7 -0
- package/build/lib/src/transformers/NullTransformer.d.ts +1 -1
- package/build/lib/src/transformers/NullTransformer.js +27 -21
- package/build/lib/src/transformers/OnSerializeTransformer.d.ts +1 -1
- package/build/lib/src/transformers/OnSerializeTransformer.js +28 -13
- package/build/lib/src/util.d.ts +4 -0
- package/build/lib/src/util.js +22 -0
- package/package.json +6 -7
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.d.ts +0 -37
- package/build/lib/src/LanguageWriters/convertors/JavaConvertors.js +0 -210
- package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.d.ts +0 -85
- package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.js +0 -306
- package/build/lib/src/from-idl/webidl2-utils.d.ts +0 -21
- package/build/lib/src/from-idl/webidl2-utils.js +0 -87
- package/build/lib/src/idl.d.ts +0 -444
- package/build/lib/src/idl.js +0 -1385
- package/build/lib/src/idlize.d.ts +0 -25
- package/build/lib/src/idlize.js +0 -198
- package/build/lib/src/options.d.ts +0 -13
- package/build/lib/src/peer-generation/BuilderClass.d.ts +0 -20
- package/build/lib/src/peer-generation/BuilderClass.js +0 -68
- package/webidl2.js/dist/webidl2.js +0 -4622
- package/webidl2.js/package.json +0 -55
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { Location } from "../diagnostictypes";
|
|
2
|
+
export declare enum IDLKind {
|
|
3
|
+
Interface = "Interface",
|
|
4
|
+
Import = "Import",
|
|
5
|
+
Callback = "Callback",
|
|
6
|
+
Const = "Const",
|
|
7
|
+
Property = "Property",
|
|
8
|
+
Parameter = "Parameter",
|
|
9
|
+
Method = "Method",
|
|
10
|
+
Callable = "Callable",
|
|
11
|
+
Constructor = "Constructor",
|
|
12
|
+
Enum = "Enum",
|
|
13
|
+
EnumMember = "EnumMember",
|
|
14
|
+
Typedef = "Typedef",
|
|
15
|
+
PrimitiveType = "PrimitiveType",
|
|
16
|
+
ContainerType = "ContainerType",
|
|
17
|
+
ReferenceType = "ReferenceType",
|
|
18
|
+
UnionType = "UnionType",
|
|
19
|
+
TypeParameterType = "TypeParameterType",
|
|
20
|
+
OptionalType = "OptionalType",
|
|
21
|
+
Version = "Version",
|
|
22
|
+
Namespace = "Namespace",
|
|
23
|
+
File = "File"
|
|
24
|
+
}
|
|
25
|
+
export declare enum IDLEntity {
|
|
26
|
+
Class = "Class",
|
|
27
|
+
Interface = "Interface",
|
|
28
|
+
Import = "Import",
|
|
29
|
+
Intersection = "Intersection",
|
|
30
|
+
Literal = "Literal",
|
|
31
|
+
NamedTuple = "NamedTuple",
|
|
32
|
+
Tuple = "Tuple"
|
|
33
|
+
}
|
|
34
|
+
export declare enum IDLExtendedAttributes {
|
|
35
|
+
Accessor = "Accessor",
|
|
36
|
+
Annotations = "Annotations",
|
|
37
|
+
Async = "Async",
|
|
38
|
+
CallSignature = "CallSignature",
|
|
39
|
+
CommonMethod = "CommonMethod",
|
|
40
|
+
Component = "Component",
|
|
41
|
+
ComponentInterface = "ComponentInterface",
|
|
42
|
+
ComponentModifier = "ComponentModifier",
|
|
43
|
+
Deprecated = "Deprecated",
|
|
44
|
+
Documentation = "Documentation",
|
|
45
|
+
DtsName = "DtsName",
|
|
46
|
+
DtsTag = "DtsTag",
|
|
47
|
+
Entity = "Entity",
|
|
48
|
+
Extends = "Extends",
|
|
49
|
+
ExtensionMethod = "ExtensionMethod",
|
|
50
|
+
Import = "Import",
|
|
51
|
+
DefaultExport = "DefaultExport",
|
|
52
|
+
IndexSignature = "IndexSignature",
|
|
53
|
+
Interfaces = "Interfaces",
|
|
54
|
+
NativeModule = "NativeModule",
|
|
55
|
+
Optional = "Optional",
|
|
56
|
+
UnionOnlyNull = "OptionalOnlyNull",
|
|
57
|
+
UnionWithNull = "OptionalWithNull",
|
|
58
|
+
OriginalEnumMemberName = "OriginalEnumMemberName",
|
|
59
|
+
OriginalGenericName = "OriginalGenericName",
|
|
60
|
+
Predefined = "Predefined",
|
|
61
|
+
Protected = "Protected",
|
|
62
|
+
Abstract = "Abstract",
|
|
63
|
+
Synthetic = "Synthetic",
|
|
64
|
+
Throws = "Throws",
|
|
65
|
+
TraceKey = "TraceKey",
|
|
66
|
+
TypeAnnotations = "TypeAnnotations",
|
|
67
|
+
TypeParametersDefaults = "TypeParametersDefaults",
|
|
68
|
+
VerbatimDts = "VerbatimDts",
|
|
69
|
+
HandWrittenImplementation = "HandWrittenImplementation",
|
|
70
|
+
ExtraMethod = "ExtraMethod",
|
|
71
|
+
OverloadAlias = "OverloadAlias",
|
|
72
|
+
OverloadPriority = "OverloadPriority",
|
|
73
|
+
TransformOnSerialize = "TransformOnSerialize"
|
|
74
|
+
}
|
|
75
|
+
export declare enum IDLAccessorAttribute {
|
|
76
|
+
Getter = "Getter",
|
|
77
|
+
Setter = "Setter"
|
|
78
|
+
}
|
|
79
|
+
export interface IDLExtendedAttribute {
|
|
80
|
+
name: string;
|
|
81
|
+
value?: string;
|
|
82
|
+
typesValue?: IDLType[];
|
|
83
|
+
nameLocation?: Location;
|
|
84
|
+
valueLocation?: Location;
|
|
85
|
+
}
|
|
86
|
+
export interface IDLNode {
|
|
87
|
+
_idlNodeBrand: any;
|
|
88
|
+
kind: IDLKind;
|
|
89
|
+
parent?: IDLNode;
|
|
90
|
+
fileName?: string;
|
|
91
|
+
extendedAttributes?: IDLExtendedAttribute[];
|
|
92
|
+
documentation?: string;
|
|
93
|
+
nodeLocation?: Location;
|
|
94
|
+
nameLocation?: Location;
|
|
95
|
+
valueLocation?: Location;
|
|
96
|
+
}
|
|
97
|
+
export interface IDLFile extends IDLNode {
|
|
98
|
+
packageClause: string[];
|
|
99
|
+
entries: IDLEntry[];
|
|
100
|
+
text?: string;
|
|
101
|
+
fileName?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface IDLNamedNode extends IDLNode {
|
|
104
|
+
_idlNamedNodeBrand: any;
|
|
105
|
+
name: string;
|
|
106
|
+
}
|
|
107
|
+
export interface IDLEntry extends IDLNode, IDLNamedNode {
|
|
108
|
+
_idlEntryBrand: any;
|
|
109
|
+
comment?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface IDLType extends IDLNode {
|
|
112
|
+
_idlTypeBrand: any;
|
|
113
|
+
}
|
|
114
|
+
export interface IDLTypedef extends IDLEntry {
|
|
115
|
+
kind: IDLKind.Typedef;
|
|
116
|
+
type: IDLType;
|
|
117
|
+
typeParameters?: string[];
|
|
118
|
+
}
|
|
119
|
+
export interface IDLPrimitiveType extends IDLType, IDLNamedNode {
|
|
120
|
+
kind: IDLKind.PrimitiveType;
|
|
121
|
+
}
|
|
122
|
+
export interface IDLOptionalType extends IDLType {
|
|
123
|
+
kind: IDLKind.OptionalType;
|
|
124
|
+
type: IDLType;
|
|
125
|
+
}
|
|
126
|
+
export type IDLContainerKind = 'sequence' | 'record' | 'Promise';
|
|
127
|
+
export interface IDLContainerType extends IDLType {
|
|
128
|
+
kind: IDLKind.ContainerType;
|
|
129
|
+
elementType: IDLType[];
|
|
130
|
+
containerKind: IDLContainerKind;
|
|
131
|
+
}
|
|
132
|
+
export interface IDLReferenceType extends IDLType, IDLNamedNode {
|
|
133
|
+
kind: IDLKind.ReferenceType;
|
|
134
|
+
typeArguments?: IDLType[];
|
|
135
|
+
}
|
|
136
|
+
export interface IDLUnionType extends IDLType, IDLNamedNode {
|
|
137
|
+
kind: IDLKind.UnionType;
|
|
138
|
+
types: IDLType[];
|
|
139
|
+
}
|
|
140
|
+
export interface IDLTypeParameterType extends IDLType, IDLNamedNode {
|
|
141
|
+
kind: IDLKind.TypeParameterType;
|
|
142
|
+
}
|
|
143
|
+
export interface IDLVersion extends IDLEntry {
|
|
144
|
+
kind: IDLKind.Version;
|
|
145
|
+
value: string[];
|
|
146
|
+
}
|
|
147
|
+
export interface IDLVariable extends IDLEntry {
|
|
148
|
+
type?: IDLType;
|
|
149
|
+
}
|
|
150
|
+
export interface IDLTypedEntry extends IDLEntry {
|
|
151
|
+
type: IDLType;
|
|
152
|
+
}
|
|
153
|
+
export interface IDLEnum extends IDLEntry {
|
|
154
|
+
kind: IDLKind.Enum;
|
|
155
|
+
elements: IDLEnumMember[];
|
|
156
|
+
}
|
|
157
|
+
export interface IDLEnumMember extends IDLEntry {
|
|
158
|
+
kind: IDLKind.EnumMember;
|
|
159
|
+
parent: IDLEnum;
|
|
160
|
+
type: IDLPrimitiveType;
|
|
161
|
+
initializer: number | string | undefined;
|
|
162
|
+
}
|
|
163
|
+
export interface IDLConstant extends IDLTypedEntry {
|
|
164
|
+
kind: IDLKind.Const;
|
|
165
|
+
type: IDLType;
|
|
166
|
+
value?: string;
|
|
167
|
+
}
|
|
168
|
+
export interface IDLProperty extends IDLTypedEntry, IDLNamedNode {
|
|
169
|
+
kind: IDLKind.Property;
|
|
170
|
+
type: IDLType;
|
|
171
|
+
isReadonly: boolean;
|
|
172
|
+
isStatic: boolean;
|
|
173
|
+
isOptional: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface IDLParameter extends IDLTypedEntry, IDLNamedNode {
|
|
176
|
+
kind: IDLKind.Parameter;
|
|
177
|
+
isVariadic: boolean;
|
|
178
|
+
isOptional: boolean;
|
|
179
|
+
type: IDLType;
|
|
180
|
+
}
|
|
181
|
+
export interface IDLSignature extends IDLEntry {
|
|
182
|
+
typeParameters?: string[];
|
|
183
|
+
parameters: IDLParameter[];
|
|
184
|
+
returnType?: IDLType;
|
|
185
|
+
}
|
|
186
|
+
export interface IDLFunction extends IDLSignature {
|
|
187
|
+
isAsync: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface IDLMethod extends IDLFunction, IDLNamedNode {
|
|
190
|
+
kind: IDLKind.Method;
|
|
191
|
+
returnType: IDLType;
|
|
192
|
+
isStatic: boolean;
|
|
193
|
+
isOptional: boolean;
|
|
194
|
+
isFree: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface IDLCallable extends IDLFunction {
|
|
197
|
+
kind: IDLKind.Callable;
|
|
198
|
+
returnType: IDLType;
|
|
199
|
+
isStatic: boolean;
|
|
200
|
+
}
|
|
201
|
+
export interface IDLConstructor extends IDLSignature {
|
|
202
|
+
kind: IDLKind.Constructor;
|
|
203
|
+
}
|
|
204
|
+
export declare enum IDLInterfaceSubkind {
|
|
205
|
+
Interface = 0,
|
|
206
|
+
Class = 1,
|
|
207
|
+
AnonymousInterface = 2,
|
|
208
|
+
Tuple = 3
|
|
209
|
+
}
|
|
210
|
+
export interface IDLInterface extends IDLEntry {
|
|
211
|
+
kind: IDLKind.Interface;
|
|
212
|
+
subkind: IDLInterfaceSubkind;
|
|
213
|
+
typeParameters?: string[];
|
|
214
|
+
inheritance: IDLReferenceType[];
|
|
215
|
+
constructors: IDLConstructor[];
|
|
216
|
+
constants: IDLConstant[];
|
|
217
|
+
properties: IDLProperty[];
|
|
218
|
+
methods: IDLMethod[];
|
|
219
|
+
callables: IDLCallable[];
|
|
220
|
+
}
|
|
221
|
+
export interface IDLImport extends IDLEntry {
|
|
222
|
+
kind: IDLKind.Import;
|
|
223
|
+
clause: string[];
|
|
224
|
+
}
|
|
225
|
+
export interface IDLNamespace extends IDLEntry {
|
|
226
|
+
kind: IDLKind.Namespace;
|
|
227
|
+
members: IDLEntry[];
|
|
228
|
+
}
|
|
229
|
+
export interface IDLCallback extends IDLEntry, IDLSignature {
|
|
230
|
+
kind: IDLKind.Callback;
|
|
231
|
+
returnType: IDLType;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
export var IDLKind;
|
|
16
|
+
(function (IDLKind) {
|
|
17
|
+
IDLKind["Interface"] = "Interface";
|
|
18
|
+
IDLKind["Import"] = "Import";
|
|
19
|
+
IDLKind["Callback"] = "Callback";
|
|
20
|
+
IDLKind["Const"] = "Const";
|
|
21
|
+
IDLKind["Property"] = "Property";
|
|
22
|
+
IDLKind["Parameter"] = "Parameter";
|
|
23
|
+
IDLKind["Method"] = "Method";
|
|
24
|
+
IDLKind["Callable"] = "Callable";
|
|
25
|
+
IDLKind["Constructor"] = "Constructor";
|
|
26
|
+
IDLKind["Enum"] = "Enum";
|
|
27
|
+
IDLKind["EnumMember"] = "EnumMember";
|
|
28
|
+
IDLKind["Typedef"] = "Typedef";
|
|
29
|
+
IDLKind["PrimitiveType"] = "PrimitiveType";
|
|
30
|
+
IDLKind["ContainerType"] = "ContainerType";
|
|
31
|
+
IDLKind["ReferenceType"] = "ReferenceType";
|
|
32
|
+
IDLKind["UnionType"] = "UnionType";
|
|
33
|
+
IDLKind["TypeParameterType"] = "TypeParameterType";
|
|
34
|
+
IDLKind["OptionalType"] = "OptionalType";
|
|
35
|
+
IDLKind["Version"] = "Version";
|
|
36
|
+
IDLKind["Namespace"] = "Namespace";
|
|
37
|
+
IDLKind["File"] = "File";
|
|
38
|
+
})(IDLKind || (IDLKind = {}));
|
|
39
|
+
export var IDLEntity;
|
|
40
|
+
(function (IDLEntity) {
|
|
41
|
+
IDLEntity["Class"] = "Class";
|
|
42
|
+
IDLEntity["Interface"] = "Interface";
|
|
43
|
+
IDLEntity["Import"] = "Import";
|
|
44
|
+
IDLEntity["Intersection"] = "Intersection";
|
|
45
|
+
IDLEntity["Literal"] = "Literal";
|
|
46
|
+
IDLEntity["NamedTuple"] = "NamedTuple";
|
|
47
|
+
IDLEntity["Tuple"] = "Tuple";
|
|
48
|
+
})(IDLEntity || (IDLEntity = {}));
|
|
49
|
+
export var IDLExtendedAttributes;
|
|
50
|
+
(function (IDLExtendedAttributes) {
|
|
51
|
+
IDLExtendedAttributes["Accessor"] = "Accessor";
|
|
52
|
+
IDLExtendedAttributes["Annotations"] = "Annotations";
|
|
53
|
+
IDLExtendedAttributes["Async"] = "Async";
|
|
54
|
+
IDLExtendedAttributes["CallSignature"] = "CallSignature";
|
|
55
|
+
IDLExtendedAttributes["CommonMethod"] = "CommonMethod";
|
|
56
|
+
IDLExtendedAttributes["Component"] = "Component";
|
|
57
|
+
IDLExtendedAttributes["ComponentInterface"] = "ComponentInterface";
|
|
58
|
+
IDLExtendedAttributes["ComponentModifier"] = "ComponentModifier";
|
|
59
|
+
IDLExtendedAttributes["Deprecated"] = "Deprecated";
|
|
60
|
+
IDLExtendedAttributes["Documentation"] = "Documentation";
|
|
61
|
+
IDLExtendedAttributes["DtsName"] = "DtsName";
|
|
62
|
+
IDLExtendedAttributes["DtsTag"] = "DtsTag";
|
|
63
|
+
IDLExtendedAttributes["Entity"] = "Entity";
|
|
64
|
+
IDLExtendedAttributes["Extends"] = "Extends";
|
|
65
|
+
IDLExtendedAttributes["ExtensionMethod"] = "ExtensionMethod";
|
|
66
|
+
IDLExtendedAttributes["Import"] = "Import";
|
|
67
|
+
IDLExtendedAttributes["DefaultExport"] = "DefaultExport";
|
|
68
|
+
IDLExtendedAttributes["IndexSignature"] = "IndexSignature";
|
|
69
|
+
IDLExtendedAttributes["Interfaces"] = "Interfaces";
|
|
70
|
+
IDLExtendedAttributes["NativeModule"] = "NativeModule";
|
|
71
|
+
IDLExtendedAttributes["Optional"] = "Optional";
|
|
72
|
+
IDLExtendedAttributes["UnionOnlyNull"] = "OptionalOnlyNull";
|
|
73
|
+
IDLExtendedAttributes["UnionWithNull"] = "OptionalWithNull";
|
|
74
|
+
IDLExtendedAttributes["OriginalEnumMemberName"] = "OriginalEnumMemberName";
|
|
75
|
+
IDLExtendedAttributes["OriginalGenericName"] = "OriginalGenericName";
|
|
76
|
+
IDLExtendedAttributes["Predefined"] = "Predefined";
|
|
77
|
+
IDLExtendedAttributes["Protected"] = "Protected";
|
|
78
|
+
IDLExtendedAttributes["Abstract"] = "Abstract";
|
|
79
|
+
IDLExtendedAttributes["Synthetic"] = "Synthetic";
|
|
80
|
+
IDLExtendedAttributes["Throws"] = "Throws";
|
|
81
|
+
IDLExtendedAttributes["TraceKey"] = "TraceKey";
|
|
82
|
+
IDLExtendedAttributes["TypeAnnotations"] = "TypeAnnotations";
|
|
83
|
+
IDLExtendedAttributes["TypeParametersDefaults"] = "TypeParametersDefaults";
|
|
84
|
+
IDLExtendedAttributes["VerbatimDts"] = "VerbatimDts";
|
|
85
|
+
IDLExtendedAttributes["HandWrittenImplementation"] = "HandWrittenImplementation";
|
|
86
|
+
IDLExtendedAttributes["ExtraMethod"] = "ExtraMethod";
|
|
87
|
+
IDLExtendedAttributes["OverloadAlias"] = "OverloadAlias";
|
|
88
|
+
IDLExtendedAttributes["OverloadPriority"] = "OverloadPriority";
|
|
89
|
+
IDLExtendedAttributes["TransformOnSerialize"] = "TransformOnSerialize";
|
|
90
|
+
})(IDLExtendedAttributes || (IDLExtendedAttributes = {}));
|
|
91
|
+
export var IDLAccessorAttribute;
|
|
92
|
+
(function (IDLAccessorAttribute) {
|
|
93
|
+
IDLAccessorAttribute["Getter"] = "Getter";
|
|
94
|
+
IDLAccessorAttribute["Setter"] = "Setter";
|
|
95
|
+
})(IDLAccessorAttribute || (IDLAccessorAttribute = {}));
|
|
96
|
+
export var IDLInterfaceSubkind;
|
|
97
|
+
(function (IDLInterfaceSubkind) {
|
|
98
|
+
IDLInterfaceSubkind[IDLInterfaceSubkind["Interface"] = 0] = "Interface";
|
|
99
|
+
IDLInterfaceSubkind[IDLInterfaceSubkind["Class"] = 1] = "Class";
|
|
100
|
+
IDLInterfaceSubkind[IDLInterfaceSubkind["AnonymousInterface"] = 2] = "AnonymousInterface";
|
|
101
|
+
IDLInterfaceSubkind[IDLInterfaceSubkind["Tuple"] = 3] = "Tuple";
|
|
102
|
+
})(IDLInterfaceSubkind || (IDLInterfaceSubkind = {}));
|
|
103
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IDLNode, IDLPrimitiveType } from "./node";
|
|
2
|
+
export declare const IDLPointerType: IDLPrimitiveType;
|
|
3
|
+
export declare const IDLVoidType: IDLPrimitiveType;
|
|
4
|
+
export declare const IDLBooleanType: IDLPrimitiveType;
|
|
5
|
+
export declare const IDLI8Type: IDLPrimitiveType;
|
|
6
|
+
export declare const IDLU8Type: IDLPrimitiveType;
|
|
7
|
+
export declare const IDLI16Type: IDLPrimitiveType;
|
|
8
|
+
export declare const IDLU16Type: IDLPrimitiveType;
|
|
9
|
+
export declare const IDLI32Type: IDLPrimitiveType;
|
|
10
|
+
export declare const IDLU32Type: IDLPrimitiveType;
|
|
11
|
+
export declare const IDLI64Type: IDLPrimitiveType;
|
|
12
|
+
export declare const IDLU64Type: IDLPrimitiveType;
|
|
13
|
+
export declare const IDLF16Type: IDLPrimitiveType;
|
|
14
|
+
export declare const IDLF32Type: IDLPrimitiveType;
|
|
15
|
+
export declare const IDLF64Type: IDLPrimitiveType;
|
|
16
|
+
export declare const IDLBigintType: IDLPrimitiveType;
|
|
17
|
+
export declare const IDLNumberType: IDLPrimitiveType;
|
|
18
|
+
export declare const IDLStringType: IDLPrimitiveType;
|
|
19
|
+
export declare const IDLAnyType: IDLPrimitiveType;
|
|
20
|
+
export declare const IDLUndefinedType: IDLPrimitiveType;
|
|
21
|
+
export declare const IDLUnknownType: IDLPrimitiveType;
|
|
22
|
+
export declare const IDLObjectType: IDLPrimitiveType;
|
|
23
|
+
export declare const IDLThisType: IDLPrimitiveType;
|
|
24
|
+
export declare const IDLDate: IDLPrimitiveType;
|
|
25
|
+
export declare const IDLBufferType: IDLPrimitiveType;
|
|
26
|
+
export declare const IDLUint8ArrayType: import("./node").IDLContainerType;
|
|
27
|
+
export declare const IDLSerializerBuffer: IDLPrimitiveType;
|
|
28
|
+
export declare const IDLFunctionType: IDLPrimitiveType;
|
|
29
|
+
export declare const IDLCustomObjectType: IDLPrimitiveType;
|
|
30
|
+
export declare const IDLInteropReturnBufferType: IDLPrimitiveType;
|
|
31
|
+
export declare const IDLNullTypeName = "idlize.stdlib.Null";
|
|
32
|
+
export declare function isUndefinedType(type: IDLNode): type is IDLPrimitiveType;
|
|
33
|
+
export declare function isVoidType(type: IDLNode): type is IDLPrimitiveType;
|
|
34
|
+
//# sourceMappingURL=stdlib.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { createContainerType, createPrimitiveType } from "./builders";
|
|
16
|
+
import { isPrimitiveType } from "./discriminators";
|
|
17
|
+
export const IDLPointerType = createPrimitiveType('pointer');
|
|
18
|
+
export const IDLVoidType = createPrimitiveType('void');
|
|
19
|
+
export const IDLBooleanType = createPrimitiveType('boolean');
|
|
20
|
+
export const IDLI8Type = createPrimitiveType('i8');
|
|
21
|
+
export const IDLU8Type = createPrimitiveType('u8');
|
|
22
|
+
export const IDLI16Type = createPrimitiveType('i16');
|
|
23
|
+
export const IDLU16Type = createPrimitiveType('u16');
|
|
24
|
+
export const IDLI32Type = createPrimitiveType('i32');
|
|
25
|
+
export const IDLU32Type = createPrimitiveType('u32');
|
|
26
|
+
export const IDLI64Type = createPrimitiveType('i64');
|
|
27
|
+
export const IDLU64Type = createPrimitiveType('u64');
|
|
28
|
+
export const IDLF16Type = createPrimitiveType('f16');
|
|
29
|
+
export const IDLF32Type = createPrimitiveType('f32');
|
|
30
|
+
export const IDLF64Type = createPrimitiveType('f64');
|
|
31
|
+
export const IDLBigintType = createPrimitiveType("bigint");
|
|
32
|
+
export const IDLNumberType = createPrimitiveType('number');
|
|
33
|
+
export const IDLStringType = createPrimitiveType('String');
|
|
34
|
+
export const IDLAnyType = createPrimitiveType('any');
|
|
35
|
+
export const IDLUndefinedType = createPrimitiveType('undefined');
|
|
36
|
+
export const IDLUnknownType = createPrimitiveType('unknown');
|
|
37
|
+
export const IDLObjectType = createPrimitiveType('Object');
|
|
38
|
+
export const IDLThisType = createPrimitiveType('this');
|
|
39
|
+
export const IDLDate = createPrimitiveType('date');
|
|
40
|
+
export const IDLBufferType = createPrimitiveType('buffer');
|
|
41
|
+
export const IDLUint8ArrayType = createContainerType('sequence', [IDLU8Type]);
|
|
42
|
+
export const IDLSerializerBuffer = createPrimitiveType('SerializerBuffer');
|
|
43
|
+
// Stub for IdlPeerLibrary
|
|
44
|
+
export const IDLFunctionType = createPrimitiveType('Function');
|
|
45
|
+
export const IDLCustomObjectType = createPrimitiveType('CustomObject');
|
|
46
|
+
export const IDLInteropReturnBufferType = createPrimitiveType('InteropReturnBuffer');
|
|
47
|
+
export const IDLNullTypeName = "idlize.stdlib.Null";
|
|
48
|
+
export function isUndefinedType(type) {
|
|
49
|
+
return isPrimitiveType(type) && type.name === IDLUndefinedType.name;
|
|
50
|
+
}
|
|
51
|
+
export function isVoidType(type) {
|
|
52
|
+
return isPrimitiveType(type) && type.name === IDLVoidType.name;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=stdlib.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { stringOrNone } from "../util";
|
|
2
|
+
import { QNPattern } from "./discriminators";
|
|
3
|
+
import { IDLNode, IDLNamedNode, IDLType, IDLEntry, IDLReferenceType, IDLContainerType, IDLSignature, IDLParameter, IDLEnum, IDLFile } from "./node";
|
|
4
|
+
export declare function entityToType(entity: IDLNode): IDLType;
|
|
5
|
+
export declare function forceAsNamedNode(type: IDLNode): IDLNamedNode;
|
|
6
|
+
export declare function isEqualByQualifedName(a?: IDLNamedNode, b?: IDLNamedNode, pattern?: QNPattern): boolean;
|
|
7
|
+
export declare function getVerbatimDts(node: IDLEntry): stringOrNone;
|
|
8
|
+
/**
|
|
9
|
+
* @returns tuple of qualifier name and real type name
|
|
10
|
+
*/
|
|
11
|
+
export declare function decomposeQualifiedName(type: IDLReferenceType): [string | undefined, string];
|
|
12
|
+
export declare function qualifiedNameStartsWith(node: IDLNode | string[], template: string[]): boolean;
|
|
13
|
+
export declare function maybeUnwrapOptionalType(type: IDLType): IDLType;
|
|
14
|
+
export declare function maybeOptional(type: IDLType, optional?: boolean): IDLType;
|
|
15
|
+
export declare const DebugUtils: {
|
|
16
|
+
debugPrintType: (type: IDLType) => string;
|
|
17
|
+
};
|
|
18
|
+
export declare function asPromise(type?: IDLType): IDLContainerType | undefined;
|
|
19
|
+
export declare function transformMethodsAsync2ReturnPromise(entry: IDLEntry): void;
|
|
20
|
+
export declare function transformMethodsReturnPromise2Async(entry: IDLEntry): void;
|
|
21
|
+
export interface SignatureTag {
|
|
22
|
+
index: number;
|
|
23
|
+
name: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function fetchSignatureTags(node: IDLSignature): SignatureTag[];
|
|
27
|
+
export declare function mixMethodParametersAndTags(node: IDLSignature): (IDLParameter | SignatureTag)[];
|
|
28
|
+
export declare function isHandwritten(decl: IDLEntry): boolean;
|
|
29
|
+
export declare function isStringEnum(decl: IDLEnum): boolean;
|
|
30
|
+
export declare function linearizeNamespaceMembers(entries: IDLEntry[]): IDLEntry[];
|
|
31
|
+
export declare function extremumOfOrdinals(enumEntry: IDLEnum): {
|
|
32
|
+
low: number;
|
|
33
|
+
high: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const PACKAGE_IDLIZE_INTERNAL = "idlize.internal";
|
|
36
|
+
export declare function isInIdlize(entry: IDLEntry | IDLFile): boolean;
|
|
37
|
+
export declare function isInIdlizeInterop(entry: IDLEntry | IDLFile): boolean;
|
|
38
|
+
export declare function isInIdlizeInternal(entry: IDLEntry | IDLFile): boolean;
|
|
39
|
+
export declare function isInIdlizeStdlib(entry: IDLEntry | IDLFile): boolean;
|
|
40
|
+
export declare function hasTypeParameters(entry: IDLEntry): boolean;
|
|
41
|
+
export declare function isGeneric(entry: IDLEntry): entry is IDLEntry & {
|
|
42
|
+
typeParameters?: string[];
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { createOptionalType, createContainerType, createReferenceType } from "./builders";
|
|
16
|
+
import { isNamedNode, getQualifiedName, getFQName, isOptionalType, isContainerType, IDLContainerUtils, isNamespace, isInPackage, isType, isEntry, isTypeParameterType, isInterface, isTypedef, isCallback, isMethod, isCallable, getExtAttribute, hasExtAttribute } from "./discriminators";
|
|
17
|
+
import { printType } from "./dump";
|
|
18
|
+
import { IDLKind, IDLExtendedAttributes } from "./node";
|
|
19
|
+
import { IDLVoidType, IDLStringType } from "./stdlib";
|
|
20
|
+
import { forEachChild, forEachFunction } from "./visitors";
|
|
21
|
+
export function entityToType(entity) {
|
|
22
|
+
if (isType(entity)) {
|
|
23
|
+
return entity;
|
|
24
|
+
}
|
|
25
|
+
else if (isEntry(entity)) {
|
|
26
|
+
return createReferenceType(entity);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error(`Expected to have IDLType or IDLEntry, got ${entity}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function forceAsNamedNode(type) {
|
|
33
|
+
if (!isNamedNode(type)) {
|
|
34
|
+
throw new Error(`Expected to be an IDLNamedNode, but got '${IDLKind[type.kind]}'`);
|
|
35
|
+
}
|
|
36
|
+
return type;
|
|
37
|
+
}
|
|
38
|
+
export function isEqualByQualifedName(a, b, pattern = "package.namespace.name") {
|
|
39
|
+
if (a === b)
|
|
40
|
+
return true;
|
|
41
|
+
if (!a || !b)
|
|
42
|
+
return false;
|
|
43
|
+
if (a.kind !== b.kind || a.name !== b.name)
|
|
44
|
+
return false;
|
|
45
|
+
return getQualifiedName(a, pattern) === getQualifiedName(b, pattern);
|
|
46
|
+
}
|
|
47
|
+
export function getVerbatimDts(node) {
|
|
48
|
+
let value = getExtAttribute(node, IDLExtendedAttributes.VerbatimDts);
|
|
49
|
+
return value ? value.substring(1, value.length - 1) : undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @returns tuple of qualifier name and real type name
|
|
53
|
+
*/
|
|
54
|
+
export function decomposeQualifiedName(type) {
|
|
55
|
+
const typeName = type.name;
|
|
56
|
+
const lastDot = typeName.lastIndexOf(".");
|
|
57
|
+
if (lastDot >= 0) {
|
|
58
|
+
const qualifier = typeName.slice(0, lastDot);
|
|
59
|
+
const realTypeName = typeName.slice(lastDot + 1);
|
|
60
|
+
return [qualifier, realTypeName];
|
|
61
|
+
}
|
|
62
|
+
return [undefined, typeName];
|
|
63
|
+
}
|
|
64
|
+
export function qualifiedNameStartsWith(node, template) {
|
|
65
|
+
const name = Array.isArray(node) ? node : getFQName(node).split(".");
|
|
66
|
+
if (name.length < template.length)
|
|
67
|
+
return false;
|
|
68
|
+
for (let i = 0; i < template.length; i++) {
|
|
69
|
+
if (name[i] != template[i])
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
export function maybeUnwrapOptionalType(type) {
|
|
75
|
+
if (isOptionalType(type)) {
|
|
76
|
+
return type.type;
|
|
77
|
+
}
|
|
78
|
+
return type;
|
|
79
|
+
}
|
|
80
|
+
export function maybeOptional(type, optional = false) {
|
|
81
|
+
if (optional) {
|
|
82
|
+
return createOptionalType(type);
|
|
83
|
+
}
|
|
84
|
+
return type;
|
|
85
|
+
}
|
|
86
|
+
export const DebugUtils = {
|
|
87
|
+
debugPrintType: (type) => {
|
|
88
|
+
const filename = type.fileName ? `, fileName: '${type.fileName}'` : "";
|
|
89
|
+
if (isContainerType(type)) {
|
|
90
|
+
return `[IDLType, name: '${printType(type)}', kind: '${IDLKind[type.kind]}', elements: [${type.elementType.map(DebugUtils.debugPrintType).join(', ')}]${filename}]`;
|
|
91
|
+
}
|
|
92
|
+
return `[IDLType, name: '${printType(type)}', kind: '${IDLKind[type.kind]}'${filename}]`;
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export function asPromise(type) {
|
|
96
|
+
if (!type)
|
|
97
|
+
return undefined;
|
|
98
|
+
if (!isContainerType(type))
|
|
99
|
+
return undefined;
|
|
100
|
+
const container = type;
|
|
101
|
+
if (!IDLContainerUtils.isPromise(container))
|
|
102
|
+
return undefined;
|
|
103
|
+
return container;
|
|
104
|
+
}
|
|
105
|
+
export function transformMethodsAsync2ReturnPromise(entry) {
|
|
106
|
+
forEachFunction(entry, function_ => {
|
|
107
|
+
var _a;
|
|
108
|
+
if (function_.isAsync) {
|
|
109
|
+
function_.isAsync = false;
|
|
110
|
+
if (!asPromise(function_.returnType))
|
|
111
|
+
function_.returnType = createContainerType("Promise", [(_a = function_.returnType) !== null && _a !== void 0 ? _a : IDLVoidType]);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export function transformMethodsReturnPromise2Async(entry) {
|
|
116
|
+
forEachFunction(entry, function_ => {
|
|
117
|
+
const promise = asPromise(function_.returnType);
|
|
118
|
+
if (promise) {
|
|
119
|
+
function_.returnType = promise.elementType[0];
|
|
120
|
+
function_.isAsync = true;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export function fetchSignatureTags(node) {
|
|
125
|
+
if (!node.extendedAttributes)
|
|
126
|
+
return [];
|
|
127
|
+
return node.extendedAttributes
|
|
128
|
+
.filter((ea) => ea.name === IDLExtendedAttributes.DtsTag)
|
|
129
|
+
.map((ea) => {
|
|
130
|
+
if (!ea.value)
|
|
131
|
+
throw new Error('Empty DtsTag is not allowed');
|
|
132
|
+
let indexNameValue = ea.value.split('|');
|
|
133
|
+
if (indexNameValue.length === 1) {
|
|
134
|
+
return {
|
|
135
|
+
index: 0,
|
|
136
|
+
name: 'type',
|
|
137
|
+
value: indexNameValue[0],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (indexNameValue.length !== 3)
|
|
141
|
+
throw new Error(`Malformed DtsTag: "${ea.value}"`);
|
|
142
|
+
return {
|
|
143
|
+
index: Number(indexNameValue[0]),
|
|
144
|
+
name: indexNameValue[1],
|
|
145
|
+
value: indexNameValue[2],
|
|
146
|
+
};
|
|
147
|
+
})
|
|
148
|
+
.sort((a, b) => a.index - b.index);
|
|
149
|
+
}
|
|
150
|
+
export function mixMethodParametersAndTags(node) {
|
|
151
|
+
let mix = node.parameters.slice(0);
|
|
152
|
+
for (const tag of fetchSignatureTags(node))
|
|
153
|
+
mix.splice(tag.index, 0, tag);
|
|
154
|
+
return mix;
|
|
155
|
+
}
|
|
156
|
+
export function isHandwritten(decl) {
|
|
157
|
+
return hasExtAttribute(decl, IDLExtendedAttributes.HandWrittenImplementation);
|
|
158
|
+
}
|
|
159
|
+
export function isStringEnum(decl) {
|
|
160
|
+
return decl.elements.some(e => e.type === IDLStringType);
|
|
161
|
+
}
|
|
162
|
+
export function linearizeNamespaceMembers(entries) {
|
|
163
|
+
const linearized = [];
|
|
164
|
+
for (const entry of entries) {
|
|
165
|
+
linearized.push(entry);
|
|
166
|
+
if (isNamespace(entry))
|
|
167
|
+
linearized.push(...linearizeNamespaceMembers(entry.members));
|
|
168
|
+
}
|
|
169
|
+
return linearized;
|
|
170
|
+
}
|
|
171
|
+
export function extremumOfOrdinals(enumEntry) {
|
|
172
|
+
let low = 0;
|
|
173
|
+
let high = 0;
|
|
174
|
+
enumEntry.elements.forEach((member, index) => {
|
|
175
|
+
let value = index;
|
|
176
|
+
if ((typeof member.initializer === 'number') && !isStringEnum(enumEntry)) {
|
|
177
|
+
value = member.initializer;
|
|
178
|
+
}
|
|
179
|
+
if (low > value)
|
|
180
|
+
low = value;
|
|
181
|
+
if (high < value)
|
|
182
|
+
high = value;
|
|
183
|
+
});
|
|
184
|
+
return { low, high };
|
|
185
|
+
}
|
|
186
|
+
export const PACKAGE_IDLIZE_INTERNAL = "idlize.internal";
|
|
187
|
+
export function isInIdlize(entry) {
|
|
188
|
+
return isInPackage(entry, "idlize");
|
|
189
|
+
}
|
|
190
|
+
export function isInIdlizeInterop(entry) {
|
|
191
|
+
return isInPackage(entry, `${PACKAGE_IDLIZE_INTERNAL}.interop`);
|
|
192
|
+
}
|
|
193
|
+
export function isInIdlizeInternal(entry) {
|
|
194
|
+
return isInPackage(entry, PACKAGE_IDLIZE_INTERNAL);
|
|
195
|
+
}
|
|
196
|
+
export function isInIdlizeStdlib(entry) {
|
|
197
|
+
return isInPackage(entry, "idlize.stdlib");
|
|
198
|
+
}
|
|
199
|
+
export function hasTypeParameters(entry) {
|
|
200
|
+
let foundTypeParameter = false;
|
|
201
|
+
forEachChild(entry, n => {
|
|
202
|
+
if (isTypeParameterType(n)) {
|
|
203
|
+
foundTypeParameter = true;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return foundTypeParameter;
|
|
207
|
+
}
|
|
208
|
+
export function isGeneric(entry) {
|
|
209
|
+
return isInterface(entry)
|
|
210
|
+
|| isTypedef(entry)
|
|
211
|
+
|| isCallback(entry)
|
|
212
|
+
|| isMethod(entry)
|
|
213
|
+
|| isCallable(entry);
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=utils.js.map
|