@idlizer/core 2.1.10-arktscgen-4 → 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.
Files changed (122) hide show
  1. package/build/lib/src/Language.d.ts +0 -1
  2. package/build/lib/src/Language.js +1 -3
  3. package/build/lib/src/LanguageWriters/ArgConvertors.d.ts +18 -7
  4. package/build/lib/src/LanguageWriters/ArgConvertors.js +95 -103
  5. package/build/lib/src/LanguageWriters/LanguageWriter.d.ts +13 -7
  6. package/build/lib/src/LanguageWriters/LanguageWriter.js +10 -2
  7. package/build/lib/src/LanguageWriters/common.d.ts +1 -0
  8. package/build/lib/src/LanguageWriters/common.js +2 -1
  9. package/build/lib/src/LanguageWriters/convertors/CJConvertors.d.ts +0 -1
  10. package/build/lib/src/LanguageWriters/convertors/CJConvertors.js +1 -3
  11. package/build/lib/src/LanguageWriters/convertors/CppConvertors.d.ts +14 -8
  12. package/build/lib/src/LanguageWriters/convertors/CppConvertors.js +88 -36
  13. package/build/lib/src/LanguageWriters/convertors/ETSConvertors.d.ts +1 -0
  14. package/build/lib/src/LanguageWriters/convertors/ETSConvertors.js +10 -8
  15. package/build/lib/src/LanguageWriters/convertors/InteropConvertors.js +1 -1
  16. package/build/lib/src/LanguageWriters/convertors/KotlinConvertors.js +9 -5
  17. package/build/lib/src/LanguageWriters/convertors/TSConvertors.d.ts +4 -4
  18. package/build/lib/src/LanguageWriters/convertors/TSConvertors.js +98 -44
  19. package/build/lib/src/LanguageWriters/index.d.ts +5 -4
  20. package/build/lib/src/LanguageWriters/index.js +8 -15
  21. package/build/lib/src/LanguageWriters/nameConvertor.d.ts +2 -0
  22. package/build/lib/src/LanguageWriters/nameConvertor.js +11 -0
  23. package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.d.ts +2 -0
  24. package/build/lib/src/LanguageWriters/writers/CJLanguageWriter.js +13 -1
  25. package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.d.ts +2 -0
  26. package/build/lib/src/LanguageWriters/writers/CppLanguageWriter.js +8 -2
  27. package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.d.ts +2 -10
  28. package/build/lib/src/LanguageWriters/writers/ETSLanguageWriter.js +52 -92
  29. package/build/lib/src/LanguageWriters/writers/KotlinLanguageWriter.d.ts +8 -0
  30. package/build/lib/src/LanguageWriters/writers/KotlinLanguageWriter.js +75 -27
  31. package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.d.ts +5 -0
  32. package/build/lib/src/LanguageWriters/writers/TsLanguageWriter.js +58 -18
  33. package/build/lib/src/LibraryInterface.d.ts +0 -1
  34. package/build/lib/src/config.d.ts +2 -1461
  35. package/build/lib/src/config.js +16 -32
  36. package/build/lib/src/configMerge.d.ts +3 -0
  37. package/build/lib/src/configMerge.js +63 -0
  38. package/build/lib/src/diagnostictypes.d.ts +1 -5
  39. package/build/lib/src/diagnostictypes.js +1 -27
  40. package/build/lib/src/from-idl/DtsPrinter.js +13 -6
  41. package/build/lib/src/from-idl/IDLLinter.d.ts +3 -4
  42. package/build/lib/src/from-idl/IDLLinter.js +30 -32
  43. package/build/lib/src/from-idl/deserialize.d.ts +3 -4
  44. package/build/lib/src/from-idl/deserialize.js +30 -642
  45. package/build/lib/src/from-idl/parser.d.ts +20 -2
  46. package/build/lib/src/from-idl/parser.js +97 -29
  47. package/build/lib/src/idl/builders.d.ts +43 -0
  48. package/build/lib/src/idl/builders.js +135 -0
  49. package/build/lib/src/idl/discriminators.d.ts +53 -0
  50. package/build/lib/src/idl/discriminators.js +232 -0
  51. package/build/lib/src/idl/dump.d.ts +48 -0
  52. package/build/lib/src/idl/dump.js +327 -0
  53. package/build/lib/src/idl/index.d.ts +9 -0
  54. package/build/lib/src/idl/index.js +23 -0
  55. package/build/lib/src/idl/keywords.d.ts +2 -0
  56. package/build/lib/src/{options.js → idl/keywords.js} +7 -3
  57. package/build/lib/src/idl/node.d.ts +233 -0
  58. package/build/lib/src/idl/node.js +103 -0
  59. package/build/lib/src/idl/stdlib.d.ts +34 -0
  60. package/build/lib/src/idl/stdlib.js +54 -0
  61. package/build/lib/src/idl/utils.d.ts +44 -0
  62. package/build/lib/src/idl/utils.js +215 -0
  63. package/build/lib/src/idl/visitors.d.ts +15 -0
  64. package/build/lib/src/idl/visitors.js +593 -0
  65. package/build/lib/src/index.d.ts +5 -6
  66. package/build/lib/src/index.js +6 -7
  67. package/build/lib/src/inheritance.d.ts +0 -2
  68. package/build/lib/src/inheritance.js +0 -17
  69. package/build/lib/src/inputPaths.d.ts +11 -0
  70. package/build/lib/src/inputPaths.js +81 -0
  71. package/build/lib/src/languageSpecificKeywords.d.ts +0 -1
  72. package/build/lib/src/languageSpecificKeywords.js +0 -5
  73. package/build/lib/src/peer-generation/ConflictingDeclarations.d.ts +6 -0
  74. package/build/lib/src/peer-generation/ConflictingDeclarations.js +43 -0
  75. package/build/lib/src/peer-generation/LayoutManager.d.ts +3 -1
  76. package/build/lib/src/peer-generation/LayoutManager.js +15 -0
  77. package/build/lib/src/peer-generation/Materialized.d.ts +8 -0
  78. package/build/lib/src/peer-generation/Materialized.js +26 -1
  79. package/build/lib/src/peer-generation/PeerLibrary.d.ts +10 -18
  80. package/build/lib/src/peer-generation/PeerLibrary.js +63 -227
  81. package/build/lib/src/peer-generation/ReferenceResolver.d.ts +6 -1
  82. package/build/lib/src/peer-generation/ReferenceResolver.js +93 -2
  83. package/build/lib/src/peer-generation/idl/IdlNameConvertor.d.ts +6 -0
  84. package/build/lib/src/peer-generation/idl/IdlNameConvertor.js +15 -3
  85. package/build/lib/src/peer-generation/idl/common.d.ts +6 -2
  86. package/build/lib/src/peer-generation/idl/common.js +7 -7
  87. package/build/lib/src/peer-generation/isMaterialized.js +2 -3
  88. package/build/lib/src/peer-generation/modules.js +2 -0
  89. package/build/lib/src/peer-generation/toDeclaration.d.ts +4 -0
  90. package/build/lib/src/peer-generation/toDeclaration.js +53 -0
  91. package/build/lib/src/peer-generation/unions.d.ts +1 -1
  92. package/build/lib/src/peer-generation/unions.js +15 -7
  93. package/build/lib/src/resolveNamedNode.d.ts +1 -0
  94. package/build/lib/src/resolveNamedNode.js +7 -0
  95. package/build/lib/src/transformers/FqnTransformer.d.ts +1 -1
  96. package/build/lib/src/transformers/FqnTransformer.js +20 -12
  97. package/build/lib/src/transformers/GenericTransformer.d.ts +4 -3
  98. package/build/lib/src/transformers/GenericTransformer.js +252 -158
  99. package/build/lib/src/transformers/IdlTransformer.d.ts +6 -0
  100. package/build/lib/src/transformers/IdlTransformer.js +7 -0
  101. package/build/lib/src/transformers/NullTransformer.d.ts +1 -1
  102. package/build/lib/src/transformers/NullTransformer.js +27 -21
  103. package/build/lib/src/transformers/OnSerializeTransformer.d.ts +1 -1
  104. package/build/lib/src/transformers/OnSerializeTransformer.js +28 -13
  105. package/build/lib/src/util.d.ts +9 -39
  106. package/build/lib/src/util.js +65 -369
  107. package/package.json +44 -49
  108. package/build/lib/src/LanguageWriters/convertors/JavaConvertors.d.ts +0 -37
  109. package/build/lib/src/LanguageWriters/convertors/JavaConvertors.js +0 -210
  110. package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.d.ts +0 -83
  111. package/build/lib/src/LanguageWriters/writers/JavaLanguageWriter.js +0 -295
  112. package/build/lib/src/from-idl/webidl2-utils.d.ts +0 -21
  113. package/build/lib/src/from-idl/webidl2-utils.js +0 -87
  114. package/build/lib/src/idl.d.ts +0 -439
  115. package/build/lib/src/idl.js +0 -1367
  116. package/build/lib/src/idlize.d.ts +0 -25
  117. package/build/lib/src/idlize.js +0 -198
  118. package/build/lib/src/options.d.ts +0 -13
  119. package/build/lib/src/peer-generation/BuilderClass.d.ts +0 -20
  120. package/build/lib/src/peer-generation/BuilderClass.js +0 -68
  121. package/webidl2.js/dist/webidl2.js +0 -4622
  122. package/webidl2.js/package.json +0 -55
@@ -1,87 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 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 { IDLEntity } from "../idl";
16
- export function isEnum(node) {
17
- return node.type === "enum";
18
- }
19
- export function isInterface(node) {
20
- return node.type === "interface";
21
- }
22
- export function isImport(node) {
23
- return node.type === "import";
24
- }
25
- export function isPackage(node) {
26
- return node.type === "package";
27
- }
28
- export function isClass(node) {
29
- var _a, _b;
30
- return isInterface(node)
31
- && ((_b = (_a = node.extAttrs.find(it => it.name === "Entity")) === null || _a === void 0 ? void 0 : _a.rhs) === null || _b === void 0 ? void 0 : _b.value) === IDLEntity.Class;
32
- }
33
- export function isCallback(node) {
34
- return node.type === "callback";
35
- }
36
- export function isTypedef(node) {
37
- return node.type === "typedef";
38
- }
39
- export function isDictionary(node) {
40
- return node.type === "dictionary";
41
- }
42
- export function isAttribute(node) {
43
- return node.type === "attribute";
44
- }
45
- export function isOperation(node) {
46
- return node.type === "operation";
47
- }
48
- export function isConstructor(node) {
49
- return node.type === "constructor";
50
- }
51
- export function isUnionTypeDescription(node) {
52
- return node.union;
53
- }
54
- export function isSingleTypeDescription(node) {
55
- return (typeof node.idlType === "string");
56
- }
57
- export function isSequenceTypeDescription(node) {
58
- return node.generic === "sequence";
59
- }
60
- export function isPromiseTypeDescription(node) {
61
- return node.generic === "Promise";
62
- }
63
- export function isRecordTypeDescription(node) {
64
- return node.generic === "record";
65
- }
66
- export function isConstant(node) {
67
- return node.type === "const";
68
- }
69
- export function isUnspecifiedGenericTypeDescription(node) {
70
- switch (node.generic) {
71
- case "FrozenArray":
72
- case "ObservableArray":
73
- case "Promise":
74
- case "record":
75
- case "sequence":
76
- case "":
77
- return false;
78
- }
79
- return true;
80
- }
81
- export function isOptional(node) {
82
- return node.extAttrs
83
- .map((it) => it.name)
84
- .map((it) => it.toLowerCase())
85
- .includes("optional");
86
- }
87
- //# sourceMappingURL=webidl2-utils.js.map
@@ -1,439 +0,0 @@
1
- import { stringOrNone } from "./util";
2
- import { Location } from "./diagnostictypes";
3
- export declare enum IDLKind {
4
- Interface = "Interface",
5
- Import = "Import",
6
- Callback = "Callback",
7
- Const = "Const",
8
- Property = "Property",
9
- Parameter = "Parameter",
10
- Method = "Method",
11
- Callable = "Callable",
12
- Constructor = "Constructor",
13
- Enum = "Enum",
14
- EnumMember = "EnumMember",
15
- Typedef = "Typedef",
16
- PrimitiveType = "PrimitiveType",
17
- ContainerType = "ContainerType",
18
- UnspecifiedGenericType = "UnspecifiedGenericType",
19
- ReferenceType = "ReferenceType",
20
- UnionType = "UnionType",
21
- TypeParameterType = "TypeParameterType",
22
- OptionalType = "OptionalType",
23
- Version = "Version",
24
- Namespace = "Namespace",
25
- File = "File"
26
- }
27
- export declare enum IDLEntity {
28
- Class = "Class",
29
- Interface = "Interface",
30
- Import = "Import",
31
- Intersection = "Intersection",
32
- Literal = "Literal",
33
- NamedTuple = "NamedTuple",
34
- Tuple = "Tuple"
35
- }
36
- export declare enum IDLExtendedAttributes {
37
- Accessor = "Accessor",
38
- Annotations = "Annotations",
39
- Async = "Async",
40
- CallSignature = "CallSignature",
41
- CommonMethod = "CommonMethod",
42
- Component = "Component",
43
- ComponentInterface = "ComponentInterface",
44
- ComponentModifier = "ComponentModifier",
45
- Deprecated = "Deprecated",
46
- Documentation = "Documentation",
47
- DtsName = "DtsName",
48
- DtsTag = "DtsTag",
49
- Entity = "Entity",
50
- Extends = "Extends",
51
- ExtensionMethod = "ExtensionMethod",
52
- Import = "Import",
53
- DefaultExport = "DefaultExport",
54
- IndexSignature = "IndexSignature",
55
- Interfaces = "Interfaces",
56
- NativeModule = "NativeModule",
57
- Optional = "Optional",
58
- UnionOnlyNull = "OptionalOnlyNull",
59
- UnionWithNull = "OptionalWithNull",
60
- OriginalEnumMemberName = "OriginalEnumMemberName",
61
- OriginalGenericName = "OriginalGenericName",
62
- Predefined = "Predefined",
63
- Protected = "Protected",
64
- Abstract = "Abstract",
65
- Synthetic = "Synthetic",
66
- Throws = "Throws",
67
- TraceKey = "TraceKey",
68
- TypeAnnotations = "TypeAnnotations",
69
- TypeArguments = "TypeArguments",
70
- TypeParameters = "TypeParameters",
71
- TypeParametersDefaults = "TypeParametersDefaults",
72
- VerbatimDts = "VerbatimDts",
73
- HandWrittenImplementation = "HandWrittenImplementation",
74
- ExtraMethod = "ExtraMethod",
75
- OverloadAlias = "OverloadAlias",
76
- OverloadPriority = "OverloadPriority",
77
- TransformOnSerialize = "TransformOnSerialize"
78
- }
79
- export declare enum IDLAccessorAttribute {
80
- Getter = "Getter",
81
- Setter = "Setter"
82
- }
83
- export interface IDLExtendedAttribute {
84
- name: string;
85
- value?: string;
86
- typesValue?: IDLType[];
87
- nameLocation?: Location;
88
- valueLocation?: Location;
89
- }
90
- export interface IDLNode {
91
- _idlNodeBrand: any;
92
- kind: IDLKind;
93
- parent?: IDLNode;
94
- fileName?: string;
95
- extendedAttributes?: IDLExtendedAttribute[];
96
- documentation?: string;
97
- nodeLocation?: Location;
98
- nameLocation?: Location;
99
- valueLocation?: Location;
100
- }
101
- export interface IDLFile extends IDLNode {
102
- packageClause: string[];
103
- entries: IDLEntry[];
104
- text?: string;
105
- fileName?: string;
106
- }
107
- export interface IDLNamedNode extends IDLNode {
108
- _idlNamedNodeBrand: any;
109
- name: string;
110
- }
111
- export interface IDLEntry extends IDLNode, IDLNamedNode {
112
- _idlEntryBrand: any;
113
- comment?: string;
114
- }
115
- export interface IDLType extends IDLNode {
116
- _idlTypeBrand: any;
117
- }
118
- export interface IDLTypedef extends IDLEntry {
119
- kind: IDLKind.Typedef;
120
- type: IDLType;
121
- typeParameters?: string[];
122
- }
123
- export interface IDLPrimitiveType extends IDLType, IDLNamedNode {
124
- kind: IDLKind.PrimitiveType;
125
- }
126
- export interface IDLOptionalType extends IDLType {
127
- kind: IDLKind.OptionalType;
128
- type: IDLType;
129
- }
130
- export type IDLContainerKind = 'sequence' | 'record' | 'Promise';
131
- export interface IDLContainerType extends IDLType {
132
- kind: IDLKind.ContainerType;
133
- elementType: IDLType[];
134
- containerKind: IDLContainerKind;
135
- }
136
- export interface IDLReferenceType extends IDLType, IDLNamedNode {
137
- kind: IDLKind.ReferenceType;
138
- typeArguments?: IDLType[];
139
- }
140
- export interface IDLUnspecifiedGenericType extends IDLType, IDLNamedNode {
141
- kind: IDLKind.UnspecifiedGenericType;
142
- typeArguments: IDLType[];
143
- }
144
- export interface IDLUnionType extends IDLType, IDLNamedNode {
145
- kind: IDLKind.UnionType;
146
- types: IDLType[];
147
- }
148
- export interface IDLTypeParameterType extends IDLType, IDLNamedNode {
149
- kind: IDLKind.TypeParameterType;
150
- }
151
- export interface IDLVersion extends IDLEntry {
152
- kind: IDLKind.Version;
153
- value: string[];
154
- }
155
- export interface IDLVariable extends IDLEntry {
156
- type?: IDLType;
157
- }
158
- export interface IDLTypedEntry extends IDLEntry {
159
- type: IDLType;
160
- }
161
- export interface IDLEnum extends IDLEntry {
162
- kind: IDLKind.Enum;
163
- elements: IDLEnumMember[];
164
- }
165
- export interface IDLEnumMember extends IDLEntry {
166
- kind: IDLKind.EnumMember;
167
- parent: IDLEnum;
168
- type: IDLPrimitiveType;
169
- initializer: number | string | undefined;
170
- }
171
- export interface IDLConstant extends IDLTypedEntry {
172
- kind: IDLKind.Const;
173
- type: IDLType;
174
- value: string;
175
- }
176
- export interface IDLProperty extends IDLTypedEntry, IDLNamedNode {
177
- kind: IDLKind.Property;
178
- type: IDLType;
179
- isReadonly: boolean;
180
- isStatic: boolean;
181
- isOptional: boolean;
182
- }
183
- export interface IDLParameter extends IDLTypedEntry, IDLNamedNode {
184
- kind: IDLKind.Parameter;
185
- isVariadic: boolean;
186
- isOptional: boolean;
187
- type: IDLType;
188
- }
189
- export interface IDLSignature extends IDLEntry {
190
- typeParameters?: string[];
191
- parameters: IDLParameter[];
192
- returnType?: IDLType;
193
- }
194
- export interface IDLFunction extends IDLSignature {
195
- isAsync: boolean;
196
- }
197
- export interface IDLMethod extends IDLFunction, IDLNamedNode {
198
- kind: IDLKind.Method;
199
- returnType: IDLType;
200
- isStatic: boolean;
201
- isOptional: boolean;
202
- isFree: boolean;
203
- }
204
- export interface IDLCallable extends IDLFunction {
205
- kind: IDLKind.Callable;
206
- returnType: IDLType;
207
- isStatic: boolean;
208
- }
209
- export interface IDLConstructor extends IDLSignature {
210
- kind: IDLKind.Constructor;
211
- }
212
- export declare enum IDLInterfaceSubkind {
213
- Interface = 0,
214
- Class = 1,
215
- AnonymousInterface = 2,
216
- Tuple = 3
217
- }
218
- export interface IDLInterface extends IDLEntry {
219
- kind: IDLKind.Interface;
220
- subkind: IDLInterfaceSubkind;
221
- typeParameters?: string[];
222
- inheritance: IDLReferenceType[];
223
- constructors: IDLConstructor[];
224
- constants: IDLConstant[];
225
- properties: IDLProperty[];
226
- methods: IDLMethod[];
227
- callables: IDLCallable[];
228
- }
229
- export interface IDLImport extends IDLEntry {
230
- kind: IDLKind.Import;
231
- clause: string[];
232
- }
233
- export interface IDLNamespace extends IDLEntry {
234
- kind: IDLKind.Namespace;
235
- members: IDLEntry[];
236
- }
237
- export interface IDLCallback extends IDLEntry, IDLSignature {
238
- kind: IDLKind.Callback;
239
- returnType: IDLType;
240
- }
241
- type IDLNodeVisitorVoid = (node: IDLNode) => void;
242
- type IDLNodeVisitorValue = (node: IDLNode) => () => void;
243
- type IDLNodeVisitor = IDLNodeVisitorVoid | IDLNodeVisitorValue;
244
- export declare function forEachChild(node: IDLNode, cbEnter: IDLNodeVisitor, cbLeave?: (entry: IDLNode) => void): void;
245
- /** Updates tree in place! */
246
- export declare function updateEachChild(node: IDLNode, op: (node: IDLNode) => IDLNode, cbLeave?: (entry: IDLNode) => void): IDLNode;
247
- export declare function isNamedNode(type: IDLNode): type is IDLNamedNode;
248
- export declare function forceAsNamedNode(type: IDLNode): IDLNamedNode;
249
- export declare function isFile(node: IDLNode): node is IDLFile;
250
- export declare function isUndefinedType(type: IDLNode): type is IDLPrimitiveType;
251
- export declare function isVoidType(type: IDLNode): type is IDLPrimitiveType;
252
- export declare function isPrimitiveType(type: IDLNode): type is IDLPrimitiveType;
253
- export declare function isContainerType(type: IDLNode): type is IDLContainerType;
254
- export declare function isReferenceType(type: IDLNode): type is IDLReferenceType;
255
- export declare function isUnspecifiedGenericType(type: IDLNode): type is IDLUnspecifiedGenericType;
256
- export declare function isEnum(type: IDLNode): type is IDLEnum;
257
- export declare function isEnumMember(type: IDLNode): type is IDLEnumMember;
258
- export declare function isUnionType(type: IDLNode): type is IDLUnionType;
259
- export declare function isTypeParameterType(type: IDLNode): type is IDLTypeParameterType;
260
- export declare function isInterface(node: IDLNode): node is IDLInterface;
261
- export declare function isImport(type: IDLNode): type is IDLImport;
262
- export declare function isCallable(node: IDLNode): node is IDLCallable;
263
- export declare function isMethod(node: IDLNode): node is IDLMethod;
264
- export declare function isParameter(node: IDLNode): node is IDLParameter;
265
- export declare function isConstructor(node: IDLNode): node is IDLConstructor;
266
- export declare function isProperty(node: IDLNode): node is IDLProperty;
267
- export declare function isCallback(node: IDLNode): node is IDLCallback;
268
- export declare function isInterfaceSubkind(idl: IDLInterface): boolean;
269
- export declare function isClassSubkind(idl: IDLInterface): boolean;
270
- export declare function isConstant(node: IDLNode): node is IDLConstant;
271
- export declare function isTypedef(node: IDLNode): node is IDLTypedef;
272
- export declare function isType(node: IDLNode): node is IDLType;
273
- export declare function isEntry(node: IDLNode): node is IDLEntry;
274
- export declare function isNamespace(node: IDLNode): node is IDLNamespace;
275
- export declare function isSyntheticEntry(node: IDLNode): boolean;
276
- export declare function isOptionalType(type: IDLNode): type is IDLOptionalType;
277
- export declare function isVersion(node: IDLNode): node is IDLVersion;
278
- export declare function createOptionalType(element: IDLType, nodeInitializer?: IDLNodeInitializer): IDLOptionalType;
279
- export declare const IDLPointerType: IDLPrimitiveType;
280
- export declare const IDLVoidType: IDLPrimitiveType;
281
- export declare const IDLBooleanType: IDLPrimitiveType;
282
- export declare const IDLI8Type: IDLPrimitiveType;
283
- export declare const IDLU8Type: IDLPrimitiveType;
284
- export declare const IDLI16Type: IDLPrimitiveType;
285
- export declare const IDLU16Type: IDLPrimitiveType;
286
- export declare const IDLI32Type: IDLPrimitiveType;
287
- export declare const IDLU32Type: IDLPrimitiveType;
288
- export declare const IDLI64Type: IDLPrimitiveType;
289
- export declare const IDLU64Type: IDLPrimitiveType;
290
- export declare const IDLF16Type: IDLPrimitiveType;
291
- export declare const IDLF32Type: IDLPrimitiveType;
292
- export declare const IDLF64Type: IDLPrimitiveType;
293
- export declare const IDLBigintType: IDLPrimitiveType;
294
- export declare const IDLNumberType: IDLPrimitiveType;
295
- export declare const IDLStringType: IDLPrimitiveType;
296
- export declare const IDLAnyType: IDLPrimitiveType;
297
- export declare const IDLUndefinedType: IDLPrimitiveType;
298
- export declare const IDLUnknownType: IDLPrimitiveType;
299
- export declare const IDLObjectType: IDLPrimitiveType;
300
- export declare const IDLThisType: IDLPrimitiveType;
301
- export declare const IDLDate: IDLPrimitiveType;
302
- export declare const IDLBufferType: IDLPrimitiveType;
303
- export declare const IDLUint8ArrayType: IDLContainerType;
304
- export declare const IDLSerializerBuffer: IDLPrimitiveType;
305
- export declare const IDLFunctionType: IDLPrimitiveType;
306
- export declare const IDLCustomObjectType: IDLPrimitiveType;
307
- export declare const IDLInteropReturnBufferType: IDLPrimitiveType;
308
- export declare const IDLNullTypeName = "idlize.stdlib.Null";
309
- export type IDLNodeInitializer = {
310
- extendedAttributes?: IDLExtendedAttribute[];
311
- fileName?: string;
312
- documentation?: string;
313
- nodeLocation?: Location;
314
- nameLocation?: Location;
315
- valueLocation?: Location;
316
- };
317
- export declare function createNamespace(name: string, members?: IDLEntry[], nodeInitializer?: IDLNodeInitializer): IDLNamespace;
318
- export declare function linkParentBack<T extends IDLNode>(node: T): T;
319
- export declare function getNamespacesPathFor(node: IDLNode): IDLNamespace[];
320
- export declare function getFileFor(node: IDLNode): IDLFile | undefined;
321
- export declare function isEqualByQualifedName(a?: IDLNamedNode, b?: IDLNamedNode, pattern?: QNPattern): boolean;
322
- export declare function getPackageClause(node: IDLNode): string[];
323
- export declare function getPackageName(node: IDLNode): string;
324
- export declare function isInPackage(entry: IDLEntry | IDLFile, packageName: string, exactMatch?: boolean): boolean;
325
- export declare function getNamespaceName(a: IDLEntry): string;
326
- export type QNPattern = "package.namespace.name" | "namespace.name" | "name";
327
- export declare function deriveQualifiedNameFrom(name: string, from: IDLNode): string;
328
- export declare function getQualifiedName(a: IDLNode, pattern: QNPattern): string;
329
- export declare function getFQName(a: IDLNode): string;
330
- export declare function createVersion(value: string[], nodeInitializer?: IDLNodeInitializer): IDLVersion;
331
- export declare function fetchNamespaceFrom(pointOfView?: IDLNode): IDLNamespace | undefined;
332
- export declare function createReferenceType(name: string, typeArguments?: IDLType[], nodeInitializer?: IDLNodeInitializer): IDLReferenceType;
333
- export declare function createReferenceType(source: IDLEntry, typeArguments?: IDLType[], nodeInitializer?: IDLNodeInitializer): IDLReferenceType;
334
- export declare function createUnspecifiedGenericType(name: string, typeArguments: IDLType[], nodeInitializer?: IDLNodeInitializer): IDLUnspecifiedGenericType;
335
- export declare function entityToType(entity: IDLNode): IDLType;
336
- export declare function createContainerType(container: IDLContainerKind, element: IDLType[], nodeInitializer?: IDLNodeInitializer): IDLContainerType;
337
- export declare function createUnionType(types: IDLType[], name?: string, nodeInitializer?: IDLNodeInitializer): IDLUnionType;
338
- export declare function createFile(entries: IDLEntry[], fileName?: string, packageClause?: string[], nodeInitializer?: IDLNodeInitializer): IDLFile;
339
- export declare function createImport(clause: string[], name?: string, nodeInitializer?: IDLNodeInitializer): IDLImport;
340
- export declare function createEnum(name: string, elements: IDLEnumMember[], nodeInitializer: IDLNodeInitializer): IDLEnum;
341
- export declare function createEnumMember(name: string, parent: IDLEnum, type: IDLPrimitiveType, initializer: number | string | undefined, nodeInitializer?: IDLNodeInitializer): IDLEnumMember;
342
- export declare function createInterface(name: string, subkind: IDLInterfaceSubkind, inheritance?: IDLReferenceType[], constructors?: IDLConstructor[], constants?: IDLConstant[], properties?: IDLProperty[], methods?: IDLMethod[], callables?: IDLCallable[], typeParameters?: string[], nodeInitializer?: IDLNodeInitializer): IDLInterface;
343
- export declare function createProperty(name: string, type: IDLType, isReadonly?: boolean, isStatic?: boolean, isOptional?: boolean, nodeInitializer?: IDLNodeInitializer): IDLProperty;
344
- export declare function createParameter(name: string, type: IDLType, isOptional?: boolean, isVariadic?: boolean, nodeInitializer?: IDLNodeInitializer): IDLParameter;
345
- export type IDLMethodInitializer = {
346
- isAsync: boolean;
347
- isStatic: boolean;
348
- isOptional: boolean;
349
- isFree: boolean;
350
- };
351
- export declare function createMethod(name: string, parameters: IDLParameter[], returnType: IDLType, methodInitializer?: IDLMethodInitializer, nodeInitializer?: IDLNodeInitializer, typeParameters?: string[]): IDLMethod;
352
- export type IDLCallableInitializer = {
353
- isAsync: boolean;
354
- isStatic: boolean;
355
- };
356
- export declare function createCallable(name: string, parameters: IDLParameter[], returnType: IDLType, callableInitializer: IDLCallableInitializer, nodeInitializer?: IDLNodeInitializer, typeParameters?: string[]): IDLCallable;
357
- export declare function createConstructor(parameters: IDLParameter[], returnType: IDLType | undefined, nodeInitializer?: IDLNodeInitializer): IDLConstructor;
358
- export declare function createCallback(name: string, parameters: IDLParameter[], returnType: IDLType, nodeInitializer?: IDLNodeInitializer, typeParameters?: string[]): IDLCallback;
359
- export declare function createTypeParameterReference(name: string, nodeInitializer?: IDLNodeInitializer): IDLTypeParameterType;
360
- export declare function createTypedef(name: string, type: IDLType, typeParameters?: string[], nodeInitializer?: IDLNodeInitializer): IDLTypedef;
361
- export declare function createConstant(name: string, type: IDLType, value: string, nodeInitializer?: IDLNodeInitializer): IDLConstant;
362
- export declare function clone<T extends IDLNode>(node: T): T;
363
- export declare function hasTypeParameters(entry: IDLEntry): boolean;
364
- export declare function escapeIDLKeyword(name: string): string;
365
- export declare function unescapeKeyword(name: string): string;
366
- type PrintedIndentInc = "[[indent-inc]]";
367
- type PrintedIndentDec = "[[indent-dec]]";
368
- type PrintedLine = undefined | string | PrintedIndentInc | PrintedIndentDec;
369
- type PrintTypeOptions = {
370
- [key: string]: any;
371
- };
372
- export declare function printType(type: IDLType | IDLInterface | undefined, options?: PrintTypeOptions): string;
373
- export declare function printReturnType(type: IDLType | IDLInterface | undefined): string;
374
- export declare function printParameters(parameters: IDLParameter[] | undefined): string;
375
- export declare function printConstructor(idl: IDLConstructor): PrintedLine[];
376
- export declare function nameWithType(idl: IDLVariable, isVariadic?: boolean, isOptional?: boolean): string;
377
- export declare function printConstant(idl: IDLConstant): PrintedLine[];
378
- export declare function printProperty(idl: IDLProperty): PrintedLine[];
379
- export declare function printExtendedAttributes(idl: IDLNode, indentLevel: number): PrintedLine[];
380
- export declare const attributesToQuote: Set<IDLExtendedAttributes>;
381
- export declare function printFunction(idl: IDLFunction): PrintedLine[];
382
- export declare function printMethod(idl: IDLMethod): PrintedLine[];
383
- export declare function printPackage(idl: IDLFile): PrintedLine[];
384
- export declare function printImport(idl: IDLImport): PrintedLine[];
385
- export declare function printNamespace(idl: IDLNamespace): PrintedLine[];
386
- export declare function printCallback(idl: IDLCallback): PrintedLine[];
387
- export declare function printScoped(idl: IDLEntry): PrintedLine[];
388
- export declare function printInterface(idl: IDLInterface): PrintedLine[];
389
- export declare function printEnumMember(idl: IDLEnumMember): PrintedLine[];
390
- export declare function printEnum(idl: IDLEnum, skipInitializers: boolean): PrintedLine[];
391
- export declare function printTypedef(idl: IDLTypedef): PrintedLine[];
392
- export declare function printIDL(idl: IDLNode, options?: Partial<IDLPrintOptions>): PrintedLine[];
393
- export interface IDLPrintOptions {
394
- verifyIdl: boolean;
395
- disableEnumInitializers: boolean;
396
- allowUnknownKinds: boolean;
397
- }
398
- export declare function toIDLString(file: IDLFile, options: Partial<IDLPrintOptions>): string;
399
- export declare function verifyIDLString(source: string): true;
400
- export declare function hasExtAttribute(node: IDLNode, attribute: IDLExtendedAttributes): boolean;
401
- export declare function getExtAttribute(node: IDLNode, name: IDLExtendedAttributes): stringOrNone;
402
- export declare function removeExtAttribute(node: IDLNode, name: IDLExtendedAttributes): void;
403
- export declare function updateExtAttribute(node: IDLNode, name: IDLExtendedAttributes, value: string | undefined): void;
404
- export declare function getVerbatimDts(node: IDLEntry): stringOrNone;
405
- export declare const IDLContainerUtils: {
406
- isRecord: (x: IDLNode) => boolean;
407
- isSequence: (x: IDLNode) => boolean;
408
- isPromise: (x: IDLNode) => boolean;
409
- };
410
- /**
411
- * @returns tuple of qualifier name and real type name
412
- */
413
- export declare function decomposeQualifiedName(type: IDLReferenceType): [string | undefined, string];
414
- export declare function qualifiedNameStartsWith(node: IDLNode | string[], template: string[]): boolean;
415
- export declare function maybeUnwrapOptionalType(type: IDLType): IDLType;
416
- export declare function maybeOptional(type: IDLType, optional?: boolean): IDLType;
417
- export declare const DebugUtils: {
418
- debugPrintType: (type: IDLType) => string;
419
- };
420
- export declare function forEachFunction(node: IDLNode, cb: (node: IDLFunction) => void): void;
421
- export declare function asPromise(type?: IDLType): IDLContainerType | undefined;
422
- export declare function transformMethodsAsync2ReturnPromise(entry: IDLEntry): void;
423
- export declare function transformMethodsReturnPromise2Async(entry: IDLEntry): void;
424
- export interface SignatureTag {
425
- index: number;
426
- name: string;
427
- value: string;
428
- }
429
- export declare function fetchSignatureTags(node: IDLSignature): SignatureTag[];
430
- export declare function mixMethodParametersAndTags(node: IDLSignature): (IDLParameter | SignatureTag)[];
431
- export declare function isHandwritten(decl: IDLEntry): boolean;
432
- export declare function isStringEnum(decl: IDLEnum): boolean;
433
- export declare function linearizeNamespaceMembers(entries: IDLEntry[]): IDLEntry[];
434
- export declare function extremumOfOrdinals(enumEntry: IDLEnum): {
435
- low: number;
436
- high: number;
437
- };
438
- export {};
439
- //# sourceMappingURL=idl.d.ts.map