@gi.ts/parser 4.0.0-beta.25 → 4.0.0-beta.27
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/package.json +11 -23
- package/src/gir-types.ts +900 -0
- package/src/index.ts +2 -0
- package/src/parser.ts +118 -0
- package/dist/lib.d.ts +0 -2
- package/dist/lib.js +0 -2
- package/dist/parser.d.ts +0 -2
- package/dist/parser.js +0 -66
- package/dist/xml.d.ts +0 -442
- package/dist/xml.js +0 -13
package/src/index.ts
ADDED
package/src/parser.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
import type { GirXML } from "./gir-types.ts";
|
|
3
|
+
|
|
4
|
+
// TODO: Treat properties that contain only one element like `repository`, 'namespace', 'package', ... as an object instead of an array
|
|
5
|
+
const isArrayProperty = [
|
|
6
|
+
"type",
|
|
7
|
+
"include",
|
|
8
|
+
"c:include",
|
|
9
|
+
"member",
|
|
10
|
+
"parameter",
|
|
11
|
+
"parameters",
|
|
12
|
+
"return-value",
|
|
13
|
+
"class",
|
|
14
|
+
"constructor",
|
|
15
|
+
"constructors",
|
|
16
|
+
"method",
|
|
17
|
+
"virtual-method",
|
|
18
|
+
"property",
|
|
19
|
+
"field",
|
|
20
|
+
"constant",
|
|
21
|
+
"enumeration",
|
|
22
|
+
"bitfield",
|
|
23
|
+
"alias",
|
|
24
|
+
"function",
|
|
25
|
+
"callback",
|
|
26
|
+
"record",
|
|
27
|
+
"union",
|
|
28
|
+
"interface",
|
|
29
|
+
"namespace",
|
|
30
|
+
"repository",
|
|
31
|
+
"package",
|
|
32
|
+
"glib:boxed",
|
|
33
|
+
"implements",
|
|
34
|
+
"prerequisite",
|
|
35
|
+
"doc",
|
|
36
|
+
"doc-deprecated",
|
|
37
|
+
"signal",
|
|
38
|
+
"glib:signal",
|
|
39
|
+
"annotation",
|
|
40
|
+
"stability",
|
|
41
|
+
"doc-version",
|
|
42
|
+
"doc-stability",
|
|
43
|
+
"source-position",
|
|
44
|
+
"column",
|
|
45
|
+
"array",
|
|
46
|
+
"moved-to",
|
|
47
|
+
"varargs",
|
|
48
|
+
"instance-parameter",
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Attributes that should be converted from strings to numbers during parsing.
|
|
53
|
+
* This maintains type safety while handling XML's string-only attribute values.
|
|
54
|
+
*/
|
|
55
|
+
const numericAttributes = ["fixed-size", "length", "closure", "destroy", "bits"] as const;
|
|
56
|
+
|
|
57
|
+
const parser = new XMLParser({
|
|
58
|
+
attributeNamePrefix: "",
|
|
59
|
+
attributesGroupName: "$", // default is 'false',
|
|
60
|
+
textNodeName: "_",
|
|
61
|
+
ignoreAttributes: false,
|
|
62
|
+
removeNSPrefix: false,
|
|
63
|
+
allowBooleanAttributes: true,
|
|
64
|
+
parseTagValue: true,
|
|
65
|
+
parseAttributeValue: false,
|
|
66
|
+
trimValues: true,
|
|
67
|
+
isArray: (name, _jpath, isLeafNode, _isAttribute) => {
|
|
68
|
+
// Restore previous behaviour...
|
|
69
|
+
if (isArrayProperty.includes(name)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return !isLeafNode;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Recursively transforms numeric string attributes to actual numbers.
|
|
78
|
+
* This ensures type safety while maintaining clean separation of concerns:
|
|
79
|
+
* the parser handles data transformation, not the consuming lib.
|
|
80
|
+
*/
|
|
81
|
+
function transformNumericAttributes(obj: unknown): unknown {
|
|
82
|
+
if (obj === null || typeof obj !== "object") {
|
|
83
|
+
return obj;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (Array.isArray(obj)) {
|
|
87
|
+
return obj.map(transformNumericAttributes);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const result = { ...obj } as Record<string, unknown>;
|
|
91
|
+
|
|
92
|
+
// Transform attributes in the $ object (XML attributes)
|
|
93
|
+
if (result.$ && typeof result.$ === "object") {
|
|
94
|
+
const attrs = result.$ as Record<string, unknown>;
|
|
95
|
+
for (const attr of numericAttributes) {
|
|
96
|
+
if (attr in attrs && typeof attrs[attr] === "string") {
|
|
97
|
+
const numValue = Number.parseInt(attrs[attr] as string, 10);
|
|
98
|
+
if (!Number.isNaN(numValue)) {
|
|
99
|
+
attrs[attr] = numValue;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Recursively transform nested objects
|
|
106
|
+
for (const key in result) {
|
|
107
|
+
if (key !== "$" && result[key] !== null && typeof result[key] === "object") {
|
|
108
|
+
result[key] = transformNumericAttributes(result[key]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function parseGir(contents: string): GirXML {
|
|
116
|
+
const parsed = parser.parse(contents);
|
|
117
|
+
return transformNumericAttributes(parsed) as GirXML;
|
|
118
|
+
}
|
package/dist/lib.d.ts
DELETED
package/dist/lib.js
DELETED
package/dist/parser.d.ts
DELETED
package/dist/parser.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { XMLParser } from "fast-xml-parser";
|
|
2
|
-
const isArrayProperty = [
|
|
3
|
-
"type",
|
|
4
|
-
"include",
|
|
5
|
-
"c:include",
|
|
6
|
-
"member",
|
|
7
|
-
"parameter",
|
|
8
|
-
"parameters",
|
|
9
|
-
"return-value",
|
|
10
|
-
"class",
|
|
11
|
-
"constructor",
|
|
12
|
-
"constructors",
|
|
13
|
-
"method",
|
|
14
|
-
"virtual-method",
|
|
15
|
-
"property",
|
|
16
|
-
"field",
|
|
17
|
-
"constant",
|
|
18
|
-
"enumeration",
|
|
19
|
-
"bitfield",
|
|
20
|
-
"alias",
|
|
21
|
-
"function",
|
|
22
|
-
"callback",
|
|
23
|
-
"record",
|
|
24
|
-
"union",
|
|
25
|
-
"interface",
|
|
26
|
-
"namespace",
|
|
27
|
-
"repository",
|
|
28
|
-
"package",
|
|
29
|
-
"glib:boxed",
|
|
30
|
-
"implements",
|
|
31
|
-
"prerequisite",
|
|
32
|
-
"doc",
|
|
33
|
-
"doc-deprecated",
|
|
34
|
-
"signal",
|
|
35
|
-
"glib:signal",
|
|
36
|
-
"annotation",
|
|
37
|
-
"stability",
|
|
38
|
-
"doc-version",
|
|
39
|
-
"doc-stability",
|
|
40
|
-
"source-position",
|
|
41
|
-
"column",
|
|
42
|
-
"array",
|
|
43
|
-
"moved-to",
|
|
44
|
-
"varargs",
|
|
45
|
-
"instance-parameter",
|
|
46
|
-
];
|
|
47
|
-
const parser = new XMLParser({
|
|
48
|
-
attributeNamePrefix: "",
|
|
49
|
-
attributesGroupName: "$",
|
|
50
|
-
textNodeName: "_",
|
|
51
|
-
ignoreAttributes: false,
|
|
52
|
-
removeNSPrefix: false,
|
|
53
|
-
allowBooleanAttributes: true,
|
|
54
|
-
parseTagValue: true,
|
|
55
|
-
parseAttributeValue: false,
|
|
56
|
-
trimValues: true,
|
|
57
|
-
isArray: (name, _jpath, isLeafNode, _isAttribute) => {
|
|
58
|
-
if (isArrayProperty.includes(name)) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
return !isLeafNode;
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
export function parseGir(contents) {
|
|
65
|
-
return parser.parse(contents);
|
|
66
|
-
}
|
package/dist/xml.d.ts
DELETED
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
export declare enum GirDirection {
|
|
2
|
-
In = "in",
|
|
3
|
-
Inout = "inout",
|
|
4
|
-
Out = "out",
|
|
5
|
-
InOut = "in-out"
|
|
6
|
-
}
|
|
7
|
-
export interface GirXML {
|
|
8
|
-
repository: GirRepository[];
|
|
9
|
-
}
|
|
10
|
-
export type GirUnparsedNumber = string;
|
|
11
|
-
export type GirBoolean = "0" | "1";
|
|
12
|
-
export interface GirRepository {
|
|
13
|
-
$: {
|
|
14
|
-
version?: string;
|
|
15
|
-
"c:identifier-prefixes"?: string;
|
|
16
|
-
"c:symbol-prefixes"?: string;
|
|
17
|
-
};
|
|
18
|
-
include?: GirInclude[];
|
|
19
|
-
"c:include": GirCInclude[];
|
|
20
|
-
package: GirPackage[];
|
|
21
|
-
namespace?: GirNamespace[];
|
|
22
|
-
}
|
|
23
|
-
export interface GirNamespace {
|
|
24
|
-
$: GirInfoAttrs & {
|
|
25
|
-
name: string;
|
|
26
|
-
version: string;
|
|
27
|
-
"c:identifier-prefixes"?: string;
|
|
28
|
-
"c:symbol-prefixes"?: string;
|
|
29
|
-
"c:prefix"?: string;
|
|
30
|
-
"shared-library"?: string;
|
|
31
|
-
};
|
|
32
|
-
alias?: GirAliasElement[];
|
|
33
|
-
class?: GirClassElement[];
|
|
34
|
-
interface?: GirInterfaceElement[];
|
|
35
|
-
record?: GirRecordElement[];
|
|
36
|
-
enumeration?: GirEnumElement[];
|
|
37
|
-
function?: GirFunctionElement[];
|
|
38
|
-
union?: GirUnionElement[];
|
|
39
|
-
bitfield?: GirBitfieldElement[];
|
|
40
|
-
callback?: GirCallbackElement[];
|
|
41
|
-
constant?: GirConstantElement[];
|
|
42
|
-
annotation?: GirAnnotation[];
|
|
43
|
-
["glib:boxed"]?: GirBoxedElement[];
|
|
44
|
-
}
|
|
45
|
-
export interface GirAnnotation {
|
|
46
|
-
$: {
|
|
47
|
-
name: string;
|
|
48
|
-
value: string[];
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface GirCInclude {
|
|
52
|
-
$: {
|
|
53
|
-
name: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export interface GirInclude {
|
|
57
|
-
$: {
|
|
58
|
-
name: string;
|
|
59
|
-
version?: string;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export interface GirPackage {
|
|
63
|
-
$: {
|
|
64
|
-
name: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export interface GirAliasElement extends GirInfoElements {
|
|
68
|
-
$: GirInfoAttrs & {
|
|
69
|
-
name: string;
|
|
70
|
-
"c:type"?: string;
|
|
71
|
-
};
|
|
72
|
-
type?: GirType[];
|
|
73
|
-
}
|
|
74
|
-
export interface GirInterfaceElement extends GirInfoElements {
|
|
75
|
-
$: GirInfoAttrs & {
|
|
76
|
-
name: string;
|
|
77
|
-
"glib:type-name": string;
|
|
78
|
-
"glib:get-type": string;
|
|
79
|
-
"c:symbol-prefix"?: string;
|
|
80
|
-
"c:type"?: string;
|
|
81
|
-
"glib:type-struct"?: string;
|
|
82
|
-
};
|
|
83
|
-
prerequisite?: GirPrerequisite[];
|
|
84
|
-
implements?: GirImplements[];
|
|
85
|
-
function?: GirFunctionElement[];
|
|
86
|
-
constructors?: GirConstructorElement[];
|
|
87
|
-
method?: GirMethodElement[];
|
|
88
|
-
"virtual-method"?: GirVirtualMethodElement[];
|
|
89
|
-
field?: GirFieldElement[];
|
|
90
|
-
property?: GirPropertyElement[];
|
|
91
|
-
signal?: GirSignalElement[];
|
|
92
|
-
"glib:signal"?: GirSignalElement[];
|
|
93
|
-
callback?: GirCallbackElement[];
|
|
94
|
-
constant?: GirConstantElement[];
|
|
95
|
-
}
|
|
96
|
-
export interface GirClassElement extends GirInfoElements {
|
|
97
|
-
$: GirInfoAttrs & {
|
|
98
|
-
name: string;
|
|
99
|
-
"glib:type-name": string;
|
|
100
|
-
"glib:get-type": string;
|
|
101
|
-
parent?: string;
|
|
102
|
-
"glib:type-struct"?: string;
|
|
103
|
-
"glib:ref-func"?: string;
|
|
104
|
-
"glib:unref-func"?: string;
|
|
105
|
-
"glib:set-value-func"?: string;
|
|
106
|
-
"glib:get-value-func"?: string;
|
|
107
|
-
"c:type"?: string;
|
|
108
|
-
"c:symbol-prefix"?: string;
|
|
109
|
-
abstract?: GirBoolean;
|
|
110
|
-
"glib:fundamental"?: GirBoolean;
|
|
111
|
-
final: GirBoolean;
|
|
112
|
-
};
|
|
113
|
-
implements?: GirImplements[];
|
|
114
|
-
constructor?: GirConstructorElement[];
|
|
115
|
-
method?: GirMethodElement[];
|
|
116
|
-
function?: GirFunctionElement[];
|
|
117
|
-
"virtual-method"?: GirVirtualMethodElement[];
|
|
118
|
-
field?: GirFieldElement[];
|
|
119
|
-
property?: GirPropertyElement[];
|
|
120
|
-
signal?: GirSignalElement[];
|
|
121
|
-
"glib:signal"?: GirSignalElement[];
|
|
122
|
-
union?: GirUnionElement[];
|
|
123
|
-
constant?: GirConstantElement[];
|
|
124
|
-
record?: GirRecordElement[];
|
|
125
|
-
callback?: GirCallbackElement[];
|
|
126
|
-
}
|
|
127
|
-
export interface GirBoxedElement {
|
|
128
|
-
$: GirInfoAttrs & {
|
|
129
|
-
"glib:name": string;
|
|
130
|
-
"c:symbol-prefix"?: string;
|
|
131
|
-
"glib:type-name"?: string;
|
|
132
|
-
"glib:get-type"?: string;
|
|
133
|
-
};
|
|
134
|
-
function?: GirFunctionElement[];
|
|
135
|
-
}
|
|
136
|
-
export interface GirRecordElement extends GirInfoElements {
|
|
137
|
-
$: GirInfoAttrs & {
|
|
138
|
-
name: string;
|
|
139
|
-
"c:type"?: string;
|
|
140
|
-
disguised?: GirBoolean;
|
|
141
|
-
opaque?: GirBoolean;
|
|
142
|
-
pointer?: GirBoolean;
|
|
143
|
-
"glib:type-name"?: string;
|
|
144
|
-
"glib:get-type"?: string;
|
|
145
|
-
"c:symbol-prefix"?: string;
|
|
146
|
-
foreign?: GirBoolean;
|
|
147
|
-
"glib:is-gtype-struct-for"?: string;
|
|
148
|
-
};
|
|
149
|
-
field?: GirFieldElement[];
|
|
150
|
-
function?: GirFunctionElement[];
|
|
151
|
-
union?: GirUnionElement[];
|
|
152
|
-
method?: GirMethodElement[];
|
|
153
|
-
constructor?: GirConstructorElement[];
|
|
154
|
-
property?: GirPropertyElement[];
|
|
155
|
-
}
|
|
156
|
-
export interface GirInfoAttrs {
|
|
157
|
-
introspectable?: GirBoolean;
|
|
158
|
-
deprecated?: string;
|
|
159
|
-
"deprecated-version"?: string;
|
|
160
|
-
version?: string;
|
|
161
|
-
stability?: string[];
|
|
162
|
-
}
|
|
163
|
-
export interface GirDocElement {
|
|
164
|
-
"doc-version"?: [
|
|
165
|
-
{
|
|
166
|
-
$: {
|
|
167
|
-
"xml:space"?: "preserve";
|
|
168
|
-
"xml:whitespace"?: "preserve";
|
|
169
|
-
};
|
|
170
|
-
_: string;
|
|
171
|
-
}
|
|
172
|
-
];
|
|
173
|
-
"doc-stability"?: [
|
|
174
|
-
{
|
|
175
|
-
$: {
|
|
176
|
-
"xml:space"?: "preserve";
|
|
177
|
-
"xml:whitespace"?: "preserve";
|
|
178
|
-
};
|
|
179
|
-
_: string;
|
|
180
|
-
}
|
|
181
|
-
];
|
|
182
|
-
doc: [
|
|
183
|
-
{
|
|
184
|
-
$: {
|
|
185
|
-
"xml:space"?: "preserve";
|
|
186
|
-
"xml:whitespace"?: "preserve";
|
|
187
|
-
filename: string;
|
|
188
|
-
line: string;
|
|
189
|
-
column: string;
|
|
190
|
-
};
|
|
191
|
-
_: string;
|
|
192
|
-
}
|
|
193
|
-
];
|
|
194
|
-
"doc-deprecated": [
|
|
195
|
-
{
|
|
196
|
-
$: {
|
|
197
|
-
"xml:space"?: "preserve";
|
|
198
|
-
"xml:whitespace"?: "preserve";
|
|
199
|
-
};
|
|
200
|
-
_: string;
|
|
201
|
-
}
|
|
202
|
-
];
|
|
203
|
-
"source-position": [
|
|
204
|
-
{
|
|
205
|
-
filename: string;
|
|
206
|
-
line: string;
|
|
207
|
-
column: string[];
|
|
208
|
-
}
|
|
209
|
-
];
|
|
210
|
-
}
|
|
211
|
-
export interface GirInfoElements extends GirDocElement {
|
|
212
|
-
annotation: GirAnnotation[];
|
|
213
|
-
}
|
|
214
|
-
export interface GirConstantElement extends GirInfoElements, GirAnyType {
|
|
215
|
-
$: GirInfoAttrs & {
|
|
216
|
-
name: string;
|
|
217
|
-
value: string;
|
|
218
|
-
"c:type"?: string;
|
|
219
|
-
"c:identifier"?: string;
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
export interface GirPropertyElement extends GirInfoElements, GirAnyType {
|
|
223
|
-
$: GirInfoAttrs & {
|
|
224
|
-
name: string;
|
|
225
|
-
writable?: GirBoolean;
|
|
226
|
-
readable?: GirBoolean;
|
|
227
|
-
construct?: GirBoolean;
|
|
228
|
-
"construct-only"?: GirBoolean;
|
|
229
|
-
setter?: string;
|
|
230
|
-
getter?: string;
|
|
231
|
-
"default-value"?: string;
|
|
232
|
-
} & Partial<GirTransferOwnership>;
|
|
233
|
-
}
|
|
234
|
-
export interface GirSignalElement extends GirInfoElements {
|
|
235
|
-
$: GirInfoAttrs & {
|
|
236
|
-
name: string;
|
|
237
|
-
detailed?: GirBoolean;
|
|
238
|
-
when?: "first" | "last" | "cleanup";
|
|
239
|
-
action?: GirBoolean;
|
|
240
|
-
"no-hooks"?: GirBoolean;
|
|
241
|
-
"no-recurse"?: GirBoolean;
|
|
242
|
-
};
|
|
243
|
-
parameters?: [GirCallableParams];
|
|
244
|
-
"return-value"?: GirCallableReturn[];
|
|
245
|
-
}
|
|
246
|
-
export interface GirFieldElement extends GirInfoElements, GirAnyType {
|
|
247
|
-
$: GirInfoAttrs & {
|
|
248
|
-
name: string;
|
|
249
|
-
writable?: GirBoolean;
|
|
250
|
-
readable?: GirBoolean;
|
|
251
|
-
private?: GirBoolean;
|
|
252
|
-
bits?: GirUnparsedNumber;
|
|
253
|
-
};
|
|
254
|
-
callback?: GirCallbackElement[];
|
|
255
|
-
}
|
|
256
|
-
export interface GirCallbackElement extends GirInfoElements {
|
|
257
|
-
$: GirInfoAttrs & {
|
|
258
|
-
name: string;
|
|
259
|
-
"c:type"?: string;
|
|
260
|
-
throws?: GirBoolean;
|
|
261
|
-
"glib:type-name"?: string;
|
|
262
|
-
};
|
|
263
|
-
parameters?: [GirCallableParams];
|
|
264
|
-
"return-value"?: GirCallableReturn[];
|
|
265
|
-
}
|
|
266
|
-
export interface GirImplements {
|
|
267
|
-
$: GirInfoAttrs & {
|
|
268
|
-
name: string;
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
export interface GirPrerequisite {
|
|
272
|
-
$: {
|
|
273
|
-
name?: string;
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
export interface GirAnyType {
|
|
277
|
-
type?: GirType[];
|
|
278
|
-
array?: GirArrayType[];
|
|
279
|
-
}
|
|
280
|
-
export interface GirType extends GirDocElement {
|
|
281
|
-
$: GirInfoAttrs & {
|
|
282
|
-
name?: string;
|
|
283
|
-
"c:type"?: string;
|
|
284
|
-
introspectable?: GirBoolean;
|
|
285
|
-
};
|
|
286
|
-
array?: GirArrayType[];
|
|
287
|
-
type: GirType[];
|
|
288
|
-
}
|
|
289
|
-
export interface GirArrayType {
|
|
290
|
-
$: GirInfoAttrs & {
|
|
291
|
-
name?: string;
|
|
292
|
-
"zero-terminated"?: GirBoolean;
|
|
293
|
-
"fixed-size"?: GirUnparsedNumber;
|
|
294
|
-
introspectable?: GirBoolean;
|
|
295
|
-
length?: GirUnparsedNumber;
|
|
296
|
-
"c:type"?: string;
|
|
297
|
-
};
|
|
298
|
-
array?: GirArrayType[];
|
|
299
|
-
type?: GirType[];
|
|
300
|
-
}
|
|
301
|
-
export declare enum GirTransferOwnershipType {
|
|
302
|
-
Container = "container",
|
|
303
|
-
Full = "full",
|
|
304
|
-
None = "none"
|
|
305
|
-
}
|
|
306
|
-
export interface GirTransferOwnership {
|
|
307
|
-
"transfer-ownership": GirTransferOwnershipType;
|
|
308
|
-
}
|
|
309
|
-
export interface GirConstructorElement {
|
|
310
|
-
$: GirInfoAttrs & GirCallableAttrs;
|
|
311
|
-
parameters?: [GirCallableParams];
|
|
312
|
-
"return-value"?: GirCallableReturn[];
|
|
313
|
-
}
|
|
314
|
-
export interface GirCallableAttrs {
|
|
315
|
-
name: string;
|
|
316
|
-
"c:identifier"?: string;
|
|
317
|
-
"shadowed-by"?: string;
|
|
318
|
-
shadows?: string;
|
|
319
|
-
throws?: GirBoolean;
|
|
320
|
-
"moved-to"?: string[];
|
|
321
|
-
}
|
|
322
|
-
export interface GirVarArgs {
|
|
323
|
-
$: GirInfoAttrs;
|
|
324
|
-
}
|
|
325
|
-
export interface GirCallableParamElement extends GirDocElement, GirAnyType {
|
|
326
|
-
$: GirInfoAttrs & Partial<GirTransferOwnership> & {
|
|
327
|
-
name?: string;
|
|
328
|
-
nullable?: GirBoolean;
|
|
329
|
-
"null-ok"?: GirBoolean;
|
|
330
|
-
"allow-none"?: GirBoolean;
|
|
331
|
-
introspectable?: GirBoolean;
|
|
332
|
-
closure?: GirUnparsedNumber;
|
|
333
|
-
destroy?: GirUnparsedNumber;
|
|
334
|
-
scope?: "notified" | "async" | "call";
|
|
335
|
-
direction?: GirDirection;
|
|
336
|
-
"caller-allocates"?: GirBoolean;
|
|
337
|
-
optional?: GirBoolean;
|
|
338
|
-
skip?: GirBoolean;
|
|
339
|
-
};
|
|
340
|
-
varargs?: GirVarArgs[];
|
|
341
|
-
}
|
|
342
|
-
export interface GirCallableParams {
|
|
343
|
-
parameter: GirCallableParamElement[];
|
|
344
|
-
"instance-parameter"?: GirInstanceParameter[];
|
|
345
|
-
}
|
|
346
|
-
export interface GirInstanceParameter extends GirAnyType {
|
|
347
|
-
$: Partial<{
|
|
348
|
-
name: string;
|
|
349
|
-
nullable?: GirBoolean;
|
|
350
|
-
"allow-none"?: GirBoolean;
|
|
351
|
-
"null-ok"?: GirBoolean;
|
|
352
|
-
direction?: GirDirection;
|
|
353
|
-
"caller-allocates"?: GirBoolean;
|
|
354
|
-
}> & Partial<GirTransferOwnership>;
|
|
355
|
-
type?: GirType[];
|
|
356
|
-
}
|
|
357
|
-
export interface GirCallableReturn extends GirAnyType, GirDocElement {
|
|
358
|
-
$: {
|
|
359
|
-
name?: string;
|
|
360
|
-
introspectable?: GirBoolean;
|
|
361
|
-
nullable?: GirBoolean;
|
|
362
|
-
closure?: GirUnparsedNumber;
|
|
363
|
-
scope?: "notified" | "async" | "call";
|
|
364
|
-
destroy?: GirUnparsedNumber;
|
|
365
|
-
skip?: GirBoolean;
|
|
366
|
-
"allow-none"?: GirBoolean;
|
|
367
|
-
} & Partial<GirTransferOwnership>;
|
|
368
|
-
}
|
|
369
|
-
export interface GirFunctionElement extends GirDocElement {
|
|
370
|
-
$: GirInfoAttrs & GirCallableAttrs;
|
|
371
|
-
parameters?: [GirCallableParams];
|
|
372
|
-
"return-value"?: GirCallableReturn[];
|
|
373
|
-
}
|
|
374
|
-
export interface GirMethodElement extends GirDocElement {
|
|
375
|
-
$: GirInfoAttrs & GirCallableAttrs & {
|
|
376
|
-
"glib:set-property": string;
|
|
377
|
-
"glib:get-property": string;
|
|
378
|
-
};
|
|
379
|
-
parameters?: [GirCallableParams];
|
|
380
|
-
"return-value"?: GirCallableReturn[];
|
|
381
|
-
}
|
|
382
|
-
export interface GirVirtualMethodElement extends GirDocElement {
|
|
383
|
-
$: GirInfoAttrs & GirCallableAttrs & {
|
|
384
|
-
invoker?: string;
|
|
385
|
-
};
|
|
386
|
-
parameters?: [GirCallableParams];
|
|
387
|
-
"return-value"?: GirCallableReturn[];
|
|
388
|
-
}
|
|
389
|
-
export interface GirUnionElement extends GirInfoElements {
|
|
390
|
-
$: GirInfoAttrs & {
|
|
391
|
-
name?: string;
|
|
392
|
-
"c:type"?: string;
|
|
393
|
-
"c:symbol-prefix"?: string;
|
|
394
|
-
"glib:type-name"?: string;
|
|
395
|
-
"glib:get-type"?: string;
|
|
396
|
-
};
|
|
397
|
-
field?: GirFieldElement[];
|
|
398
|
-
constructor?: GirConstructorElement[];
|
|
399
|
-
method?: GirMethodElement[];
|
|
400
|
-
function?: GirFunctionElement[];
|
|
401
|
-
record?: GirRecordElement[];
|
|
402
|
-
}
|
|
403
|
-
export interface GirBitfieldElement extends GirInfoElements {
|
|
404
|
-
$: GirInfoAttrs & {
|
|
405
|
-
name: string;
|
|
406
|
-
"c:type": string;
|
|
407
|
-
"glib:type-name"?: string;
|
|
408
|
-
"glib:get-type"?: string;
|
|
409
|
-
};
|
|
410
|
-
member: GirMemberElement[];
|
|
411
|
-
function: GirFunctionElement[];
|
|
412
|
-
}
|
|
413
|
-
export interface GirEnumElement extends GirInfoElements {
|
|
414
|
-
$: GirInfoAttrs & {
|
|
415
|
-
name: string;
|
|
416
|
-
"c:type": string;
|
|
417
|
-
"glib:type-name"?: string;
|
|
418
|
-
"glib:get-type"?: string;
|
|
419
|
-
"glib:error-domain"?: string;
|
|
420
|
-
};
|
|
421
|
-
member?: GirMemberElement[];
|
|
422
|
-
function?: GirFunctionElement[];
|
|
423
|
-
}
|
|
424
|
-
export interface GirFieldElement extends GirInfoElements, GirAnyType {
|
|
425
|
-
$: GirInfoAttrs & {
|
|
426
|
-
name: string;
|
|
427
|
-
writable?: GirBoolean;
|
|
428
|
-
readable?: GirBoolean;
|
|
429
|
-
private?: GirBoolean;
|
|
430
|
-
bits?: GirUnparsedNumber;
|
|
431
|
-
};
|
|
432
|
-
callback?: GirCallbackElement[];
|
|
433
|
-
}
|
|
434
|
-
export interface GirMemberElement extends GirInfoElements {
|
|
435
|
-
$: GirInfoAttrs & {
|
|
436
|
-
name: string;
|
|
437
|
-
value: string;
|
|
438
|
-
"c:identifier": string;
|
|
439
|
-
"glib:nick"?: string;
|
|
440
|
-
"glib:name"?: string;
|
|
441
|
-
};
|
|
442
|
-
}
|
package/dist/xml.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export var GirDirection;
|
|
2
|
-
(function (GirDirection) {
|
|
3
|
-
GirDirection["In"] = "in";
|
|
4
|
-
GirDirection["Inout"] = "inout";
|
|
5
|
-
GirDirection["Out"] = "out";
|
|
6
|
-
GirDirection["InOut"] = "in-out";
|
|
7
|
-
})(GirDirection || (GirDirection = {}));
|
|
8
|
-
export var GirTransferOwnershipType;
|
|
9
|
-
(function (GirTransferOwnershipType) {
|
|
10
|
-
GirTransferOwnershipType["Container"] = "container";
|
|
11
|
-
GirTransferOwnershipType["Full"] = "full";
|
|
12
|
-
GirTransferOwnershipType["None"] = "none";
|
|
13
|
-
})(GirTransferOwnershipType || (GirTransferOwnershipType = {}));
|