@ts-for-gir/lib 4.0.0-beta.1 → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dependency-manager.d.ts +90 -11
- package/lib/dependency-manager.js +209 -35
- package/lib/dependency-manager.js.map +1 -1
- package/lib/generators/dts-inline.d.ts +2 -2
- package/lib/generators/dts-inline.js +7 -7
- package/lib/generators/dts-inline.js.map +1 -1
- package/lib/generators/dts-modules.d.ts +2 -2
- package/lib/generators/dts-modules.js +9 -9
- package/lib/generators/dts-modules.js.map +1 -1
- package/lib/generators/dts.d.ts +2 -2
- package/lib/generators/dts.js +8 -8
- package/lib/generators/dts.js.map +1 -1
- package/lib/generators/generator.d.ts +3 -3
- package/lib/generators/generator.js.map +1 -1
- package/lib/generators/json.d.ts +2 -2
- package/lib/generators/json.js +14 -14
- package/lib/generators/json.js.map +1 -1
- package/lib/generics/visitor.js +5 -9
- package/lib/generics/visitor.js.map +1 -1
- package/lib/gir/alias.d.ts +2 -2
- package/lib/gir/alias.js +3 -3
- package/lib/gir/alias.js.map +1 -1
- package/lib/gir/base.d.ts +3 -3
- package/lib/gir/base.js.map +1 -1
- package/lib/gir/class.d.ts +5 -5
- package/lib/gir/class.js +32 -33
- package/lib/gir/class.js.map +1 -1
- package/lib/gir/const.d.ts +2 -2
- package/lib/gir/const.js +1 -1
- package/lib/gir/const.js.map +1 -1
- package/lib/gir/enum.d.ts +5 -5
- package/lib/gir/enum.js +7 -7
- package/lib/gir/enum.js.map +1 -1
- package/lib/gir/function.d.ts +9 -9
- package/lib/gir/function.js +4 -4
- package/lib/gir/function.js.map +1 -1
- package/lib/gir/nodes.d.ts +1 -1
- package/lib/gir/nodes.js +1 -1
- package/lib/gir/nodes.js.map +1 -1
- package/lib/gir/property.d.ts +2 -2
- package/lib/gir/property.js.map +1 -1
- package/lib/gir/registry.d.ts +6 -6
- package/lib/gir/registry.js +3 -3
- package/lib/gir/registry.js.map +1 -1
- package/lib/gir/signal.d.ts +2 -2
- package/lib/gir/signal.js.map +1 -1
- package/lib/gir/util.d.ts +3 -3
- package/lib/gir/util.js +17 -14
- package/lib/gir/util.js.map +1 -1
- package/lib/gir-module.d.ts +21 -27
- package/lib/gir-module.js +140 -144
- package/lib/gir-module.js.map +1 -1
- package/lib/gir.d.ts +42 -40
- package/lib/gir.js +26 -22
- package/lib/gir.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/library-version.d.ts +2 -0
- package/lib/library-version.js +13 -0
- package/lib/library-version.js.map +1 -1
- package/lib/logger.d.ts +18 -16
- package/lib/logger.js +28 -26
- package/lib/logger.js.map +1 -1
- package/lib/registry.d.ts +0 -1
- package/lib/registry.js +0 -1
- package/lib/registry.js.map +1 -1
- package/lib/transformation.d.ts +5 -3
- package/lib/transformation.js +7 -0
- package/lib/transformation.js.map +1 -1
- package/lib/types/dependency.d.ts +13 -1
- package/lib/types/format.d.ts +1 -0
- package/lib/types/format.js +2 -0
- package/lib/types/format.js.map +1 -0
- package/lib/types/gir-module-resolved-by.d.ts +5 -0
- package/lib/types/index.d.ts +7 -2
- package/lib/types/index.js +7 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/metadata.d.ts +8 -0
- package/lib/types/metadata.js +2 -0
- package/lib/types/metadata.js.map +1 -0
- package/lib/types/options-base.d.ts +4 -0
- package/lib/types/options-base.js +2 -0
- package/lib/types/options-base.js.map +1 -0
- package/lib/types/{generate-config.d.ts → options-generation.d.ts} +2 -3
- package/lib/types/options-generation.js +2 -0
- package/lib/types/options-generation.js.map +1 -0
- package/lib/types/options-load.d.ts +5 -0
- package/lib/types/options-load.js +2 -0
- package/lib/types/options-load.js.map +1 -0
- package/lib/types/options-transform.d.ts +4 -0
- package/lib/types/options-transform.js +2 -0
- package/lib/types/options-transform.js.map +1 -0
- package/lib/types/output-format.d.ts +1 -0
- package/lib/types/output-format.js +2 -0
- package/lib/types/output-format.js.map +1 -0
- package/lib/types/property-case.d.ts +1 -0
- package/lib/types/property-case.js +2 -0
- package/lib/types/property-case.js.map +1 -0
- package/lib/types/template-data.d.ts +2 -2
- package/lib/utils.d.ts +8 -1
- package/lib/utils.js +58 -13
- package/lib/utils.js.map +1 -1
- package/lib/validators/interface.js +1 -1
- package/lib/validators/interface.js.map +1 -1
- package/package.json +8 -7
- package/lib/conflict-resolver.d.ts +0 -119
- package/lib/conflict-resolver.js +0 -893
- package/lib/conflict-resolver.js.map +0 -1
- package/lib/generators/dts/gio.d.ts +0 -2
- package/lib/generators/dts/gio.js +0 -9
- package/lib/generators/dts/gio.js.map +0 -1
- package/lib/gir-factory.d.ts +0 -52
- package/lib/gir-factory.js +0 -340
- package/lib/gir-factory.js.map +0 -1
- package/lib/injection/callbacks/gjs/Gio-2.0.d.ts +0 -2
- package/lib/injection/callbacks/gjs/Gio-2.0.js +0 -36
- package/lib/injection/callbacks/gjs/Gio-2.0.js.map +0 -1
- package/lib/injection/callbacks/gjs/index.d.ts +0 -2
- package/lib/injection/callbacks/gjs/index.js +0 -3
- package/lib/injection/callbacks/gjs/index.js.map +0 -1
- package/lib/injection/callbacks/index.d.ts +0 -3
- package/lib/injection/callbacks/index.js +0 -3
- package/lib/injection/callbacks/index.js.map +0 -1
- package/lib/injection/classes/gjs/gio-2.0.d.ts +0 -5
- package/lib/injection/classes/gjs/gio-2.0.js +0 -254
- package/lib/injection/classes/gjs/gio-2.0.js.map +0 -1
- package/lib/injection/classes/gjs/glib-2.0.d.ts +0 -2
- package/lib/injection/classes/gjs/glib-2.0.js +0 -225
- package/lib/injection/classes/gjs/glib-2.0.js.map +0 -1
- package/lib/injection/classes/gjs/gobject-2.0.d.ts +0 -2
- package/lib/injection/classes/gjs/gobject-2.0.js +0 -634
- package/lib/injection/classes/gjs/gobject-2.0.js.map +0 -1
- package/lib/injection/classes/gjs/index.d.ts +0 -2
- package/lib/injection/classes/gjs/index.js +0 -5
- package/lib/injection/classes/gjs/index.js.map +0 -1
- package/lib/injection/classes/glib-2.0.d.ts +0 -2
- package/lib/injection/classes/glib-2.0.js +0 -35
- package/lib/injection/classes/glib-2.0.js.map +0 -1
- package/lib/injection/classes/index.d.ts +0 -3
- package/lib/injection/classes/index.js +0 -4
- package/lib/injection/classes/index.js.map +0 -1
- package/lib/injection/index.d.ts +0 -3
- package/lib/injection/index.js +0 -4
- package/lib/injection/index.js.map +0 -1
- package/lib/injection/injector.d.ts +0 -16
- package/lib/injection/injector.js +0 -138
- package/lib/injection/injector.js.map +0 -1
- package/lib/symtable.d.ts +0 -24
- package/lib/symtable.js +0 -63
- package/lib/symtable.js.map +0 -1
- package/lib/types/conflict-child-element.d.ts +0 -10
- package/lib/types/conflict-child-element.js +0 -2
- package/lib/types/conflict-child-element.js.map +0 -1
- package/lib/types/conflict-grouped-element.d.ts +0 -6
- package/lib/types/conflict-grouped-element.js +0 -2
- package/lib/types/conflict-grouped-element.js.map +0 -1
- package/lib/types/conflict-grouped-elements.d.ts +0 -4
- package/lib/types/conflict-grouped-elements.js +0 -2
- package/lib/types/conflict-grouped-elements.js.map +0 -1
- package/lib/types/generate-config.js +0 -2
- package/lib/types/generate-config.js.map +0 -1
- package/lib/types/injection-callback.d.ts +0 -16
- package/lib/types/injection-callback.js +0 -2
- package/lib/types/injection-callback.js.map +0 -1
- package/lib/types/injection-class.d.ts +0 -25
- package/lib/types/injection-class.js +0 -2
- package/lib/types/injection-class.js.map +0 -1
- package/lib/types/injection-function.d.ts +0 -7
- package/lib/types/injection-function.js +0 -2
- package/lib/types/injection-function.js.map +0 -1
- package/lib/types/injection-generic-parameter.d.ts +0 -2
- package/lib/types/injection-generic-parameter.js +0 -2
- package/lib/types/injection-generic-parameter.js.map +0 -1
- package/lib/types/injection-instance-parameter.d.ts +0 -2
- package/lib/types/injection-instance-parameter.js +0 -2
- package/lib/types/injection-instance-parameter.js.map +0 -1
- package/lib/types/injection-parameter.d.ts +0 -8
- package/lib/types/injection-parameter.js +0 -2
- package/lib/types/injection-parameter.js.map +0 -1
- package/lib/types/injection-property.d.ts +0 -4
- package/lib/types/injection-property.js +0 -2
- package/lib/types/injection-property.js.map +0 -1
- package/lib/types/injection-type.d.ts +0 -2
- package/lib/types/injection-type.js +0 -2
- package/lib/types/injection-type.js.map +0 -1
- package/lib/types/injection.d.ts +0 -5
- package/lib/types/injection.js +0 -2
- package/lib/types/injection.js.map +0 -1
- package/lib/types/promisify-func.d.ts +0 -7
- package/lib/types/promisify-func.js +0 -2
- package/lib/types/promisify-func.js.map +0 -1
- package/lib/types/sym-table-items.d.ts +0 -4
- package/lib/types/sym-table-items.js +0 -2
- package/lib/types/sym-table-items.js.map +0 -1
- package/lib/types/ts-alias.d.ts +0 -10
- package/lib/types/ts-alias.js +0 -2
- package/lib/types/ts-alias.js.map +0 -1
- package/lib/types/ts-callback-interface.d.ts +0 -10
- package/lib/types/ts-callback-interface.js +0 -2
- package/lib/types/ts-callback-interface.js.map +0 -1
- package/lib/types/ts-callback.d.ts +0 -17
- package/lib/types/ts-callback.js +0 -2
- package/lib/types/ts-callback.js.map +0 -1
- package/lib/types/ts-class.d.ts +0 -85
- package/lib/types/ts-class.js +0 -2
- package/lib/types/ts-class.js.map +0 -1
- package/lib/types/ts-enum.d.ts +0 -12
- package/lib/types/ts-enum.js +0 -2
- package/lib/types/ts-enum.js.map +0 -1
- package/lib/types/ts-function.d.ts +0 -55
- package/lib/types/ts-function.js +0 -2
- package/lib/types/ts-function.js.map +0 -1
- package/lib/types/ts-generic-parameter.d.ts +0 -8
- package/lib/types/ts-generic-parameter.js +0 -2
- package/lib/types/ts-generic-parameter.js.map +0 -1
- package/lib/types/ts-instance-parameter.d.ts +0 -4
- package/lib/types/ts-instance-parameter.js +0 -2
- package/lib/types/ts-instance-parameter.js.map +0 -1
- package/lib/types/ts-member.d.ts +0 -10
- package/lib/types/ts-member.js +0 -2
- package/lib/types/ts-member.js.map +0 -1
- package/lib/types/ts-method.d.ts +0 -5
- package/lib/types/ts-method.js +0 -2
- package/lib/types/ts-method.js.map +0 -1
- package/lib/types/ts-parameter.d.ts +0 -15
- package/lib/types/ts-parameter.js +0 -2
- package/lib/types/ts-parameter.js.map +0 -1
- package/lib/types/ts-property.d.ts +0 -17
- package/lib/types/ts-property.js +0 -2
- package/lib/types/ts-property.js.map +0 -1
- package/lib/types/ts-signal.d.ts +0 -17
- package/lib/types/ts-signal.js +0 -2
- package/lib/types/ts-signal.js.map +0 -1
- package/lib/types/ts-type-name.d.ts +0 -1
- package/lib/types/ts-type-name.js +0 -2
- package/lib/types/ts-type-name.js.map +0 -1
- package/lib/types/ts-type-separator.d.ts +0 -1
- package/lib/types/ts-type-separator.js +0 -2
- package/lib/types/ts-type-separator.js.map +0 -1
- package/lib/types/ts-type.d.ts +0 -26
- package/lib/types/ts-type.js +0 -2
- package/lib/types/ts-type.js.map +0 -1
- package/lib/types/ts-var.d.ts +0 -17
- package/lib/types/ts-var.js +0 -2
- package/lib/types/ts-var.js.map +0 -1
- package/lib/types.d.ts +0 -23
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
package/lib/gir-module.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Transformation } from './transformation.js';
|
|
2
2
|
import { Logger } from './logger.js';
|
|
3
3
|
import { DependencyManager } from './dependency-manager.js';
|
|
4
|
-
import { SymTable } from './symtable.js';
|
|
5
4
|
import { LibraryVersion } from './library-version.js';
|
|
6
|
-
import type { Dependency,
|
|
5
|
+
import type { Dependency, GirConstantElement, TsDocTag, GirInfoAttrs, OptionsGeneration } from './types/index.js';
|
|
7
6
|
import { GirNSMember } from './gir.js';
|
|
8
7
|
import { IntrospectedAlias } from './gir/alias.js';
|
|
9
8
|
import { IntrospectedNamespaceMember } from './gir/base.js';
|
|
@@ -13,39 +12,37 @@ import { IntrospectedFunction, IntrospectedFunctionParameter, IntrospectedClassF
|
|
|
13
12
|
import { NSRegistry } from './gir/registry.js';
|
|
14
13
|
import { GirVisitor } from './visitor.js';
|
|
15
14
|
export declare class GirModule {
|
|
15
|
+
readonly dependency: Dependency;
|
|
16
16
|
/**
|
|
17
17
|
* E.g. 'Gtk'
|
|
18
18
|
*/
|
|
19
|
-
namespace: string;
|
|
19
|
+
get namespace(): string;
|
|
20
20
|
/**
|
|
21
21
|
* E.g. '4.0'
|
|
22
22
|
*/
|
|
23
|
-
version: string;
|
|
23
|
+
get version(): string;
|
|
24
24
|
/**
|
|
25
25
|
* E.g. 'Gtk-4.0'
|
|
26
26
|
*/
|
|
27
|
-
packageName: string;
|
|
27
|
+
get packageName(): string;
|
|
28
28
|
/**
|
|
29
29
|
* E.g. 'Gtk40'
|
|
30
30
|
* Is used in the generated index.d.ts, for example: `import * as Gtk40 from "./Gtk-4.0.js";`
|
|
31
31
|
*/
|
|
32
|
-
importNamespace: string;
|
|
33
|
-
importName: string;
|
|
32
|
+
get importNamespace(): string;
|
|
33
|
+
get importName(): string;
|
|
34
|
+
get importPath(): string;
|
|
34
35
|
prefixes: string[];
|
|
35
36
|
/**
|
|
36
37
|
* The version of the library as an object.
|
|
37
38
|
* E.g. `{ major: 4, minor: 0, patch: 0 }` or as string `4.0.0`'
|
|
38
39
|
*/
|
|
39
|
-
libraryVersion: LibraryVersion;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
get libraryVersion(): LibraryVersion;
|
|
41
|
+
protected _dependencies: Dependency[] | null;
|
|
42
|
+
protected _transitiveDependencies: Dependency[] | null;
|
|
43
|
+
get dependencies(): Dependency[];
|
|
43
44
|
get transitiveDependencies(): Dependency[];
|
|
44
45
|
get allDependencies(): Dependency[];
|
|
45
|
-
/**
|
|
46
|
-
* Used to find namespaces that are used in other modules
|
|
47
|
-
*/
|
|
48
|
-
symTable: SymTable;
|
|
49
46
|
transformation: Transformation;
|
|
50
47
|
dependencyManager: DependencyManager;
|
|
51
48
|
log: Logger;
|
|
@@ -57,7 +54,6 @@ export declare class GirModule {
|
|
|
57
54
|
constNames: {
|
|
58
55
|
[varName: string]: GirConstantElement;
|
|
59
56
|
};
|
|
60
|
-
readonly name: string;
|
|
61
57
|
readonly c_prefixes: string[];
|
|
62
58
|
private _members?;
|
|
63
59
|
private _enum_constants?;
|
|
@@ -65,12 +61,12 @@ export declare class GirModule {
|
|
|
65
61
|
__dts__references?: string[];
|
|
66
62
|
package_version: readonly [string, string] | readonly [string, string, string];
|
|
67
63
|
parent: NSRegistry;
|
|
68
|
-
config:
|
|
69
|
-
constructor(
|
|
64
|
+
config: OptionsGeneration;
|
|
65
|
+
constructor(dependency: Dependency, prefixes: string[], config: OptionsGeneration);
|
|
66
|
+
initDependencies(): Promise<void>;
|
|
67
|
+
initTransitiveDependencies(transitiveDependencies: Dependency[]): Promise<void>;
|
|
70
68
|
get ns(): this;
|
|
71
69
|
private checkTransitiveDependencies;
|
|
72
|
-
private getTsDoc;
|
|
73
|
-
private getTsDocGirElementTags;
|
|
74
70
|
getTsDocReturnTags(girElement?: IntrospectedFunction | IntrospectedClassFunction): TsDocTag[];
|
|
75
71
|
getTsDocInParamTags(inParams?: IntrospectedFunctionParameter[]): TsDocTag[];
|
|
76
72
|
registerResolveName(resolveName: string, namespace: string, name: string): void;
|
|
@@ -80,8 +76,8 @@ export declare class GirModule {
|
|
|
80
76
|
getImportsForCPrefix(c_prefix: string): GirModule[];
|
|
81
77
|
hasImport(name: string): boolean;
|
|
82
78
|
private _getImport;
|
|
83
|
-
getInstalledImport(
|
|
84
|
-
assertInstalledImport(
|
|
79
|
+
getInstalledImport(_namespace: string): GirModule | null;
|
|
80
|
+
assertInstalledImport(_namespace: string): GirModule;
|
|
85
81
|
getMembers(name: string): IntrospectedNamespaceMember[];
|
|
86
82
|
getMemberWithoutOverrides(name: string): GirNSMember | null | undefined;
|
|
87
83
|
assertClass(name: string): IntrospectedBaseClass;
|
|
@@ -97,11 +93,9 @@ export declare class GirModule {
|
|
|
97
93
|
* libraries that are newer than default.
|
|
98
94
|
*/
|
|
99
95
|
___dts___addReference(reference: string): void;
|
|
100
|
-
static load(
|
|
101
|
-
/**
|
|
102
|
-
|
|
103
|
-
*/
|
|
104
|
-
start(girModules: GirModule[]): void;
|
|
96
|
+
static load(dependency: Dependency, config: OptionsGeneration, registry: NSRegistry): Promise<GirModule>;
|
|
97
|
+
/** Start to parse all the data from the XML we need for the typescript generation */
|
|
98
|
+
parse(): void;
|
|
105
99
|
}
|
|
106
100
|
export declare const isIntrospectable: (e: {
|
|
107
101
|
$?: GirInfoAttrs;
|
package/lib/gir-module.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// TODO move this class into a web-worker? https://www.npmjs.com/package/web-worker
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
import {
|
|
3
|
+
import { Transformation } from './transformation.js';
|
|
4
4
|
import { Logger } from './logger.js';
|
|
5
5
|
import { DependencyManager } from './dependency-manager.js';
|
|
6
6
|
import { find } from './utils.js';
|
|
7
|
-
import { SymTable } from './symtable.js';
|
|
8
|
-
import { LibraryVersion } from './library-version.js';
|
|
9
7
|
import { ClosureType, TypeIdentifier, PromiseType, VoidType, BooleanType, TupleType, BinaryType, NullableType, ObjectType, } from './gir.js';
|
|
10
8
|
import { IntrospectedAlias } from './gir/alias.js';
|
|
11
9
|
import { IntrospectedBase } from './gir/base.js';
|
|
@@ -15,45 +13,73 @@ import { IntrospectedEnum, IntrospectedError } from './gir/enum.js';
|
|
|
15
13
|
import { IntrospectedFunction, IntrospectedCallback, } from './gir/function.js';
|
|
16
14
|
import { isPrimitiveType } from './gir/util.js';
|
|
17
15
|
export class GirModule {
|
|
16
|
+
dependency;
|
|
18
17
|
/**
|
|
19
18
|
* E.g. 'Gtk'
|
|
20
19
|
*/
|
|
21
|
-
namespace
|
|
20
|
+
get namespace() {
|
|
21
|
+
return this.dependency.namespace;
|
|
22
|
+
}
|
|
22
23
|
/**
|
|
23
24
|
* E.g. '4.0'
|
|
24
25
|
*/
|
|
25
|
-
version
|
|
26
|
+
get version() {
|
|
27
|
+
return this.dependency.version;
|
|
28
|
+
}
|
|
26
29
|
/**
|
|
27
30
|
* E.g. 'Gtk-4.0'
|
|
28
31
|
*/
|
|
29
|
-
packageName
|
|
32
|
+
get packageName() {
|
|
33
|
+
return this.dependency.packageName;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
* E.g. 'Gtk40'
|
|
32
37
|
* Is used in the generated index.d.ts, for example: `import * as Gtk40 from "./Gtk-4.0.js";`
|
|
33
38
|
*/
|
|
34
|
-
importNamespace
|
|
35
|
-
|
|
39
|
+
get importNamespace() {
|
|
40
|
+
return this.dependency.importNamespace;
|
|
41
|
+
}
|
|
42
|
+
get importName() {
|
|
43
|
+
return this.dependency.importName;
|
|
44
|
+
}
|
|
45
|
+
get importPath() {
|
|
46
|
+
return this.dependency.importPath;
|
|
47
|
+
}
|
|
36
48
|
prefixes = [];
|
|
37
49
|
/**
|
|
38
50
|
* The version of the library as an object.
|
|
39
51
|
* E.g. `{ major: 4, minor: 0, patch: 0 }` or as string `4.0.0`'
|
|
40
52
|
*/
|
|
41
|
-
libraryVersion
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
get libraryVersion() {
|
|
54
|
+
// GObject and Gio are following the version of GLib
|
|
55
|
+
if (this.namespace === 'GObject' || this.namespace === 'Gio') {
|
|
56
|
+
const dep = this.allDependencies.find((girModule) => girModule.namespace === 'GLib');
|
|
57
|
+
if (dep) {
|
|
58
|
+
return dep.libraryVersion;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return this.dependency.libraryVersion;
|
|
62
|
+
}
|
|
63
|
+
_dependencies = null;
|
|
64
|
+
_transitiveDependencies = null;
|
|
65
|
+
get dependencies() {
|
|
66
|
+
if (!this._dependencies) {
|
|
67
|
+
throw new Error('dependencies is not initialized, run initDependencies() first');
|
|
68
|
+
}
|
|
69
|
+
return this._dependencies;
|
|
46
70
|
}
|
|
47
71
|
get transitiveDependencies() {
|
|
72
|
+
if (!this._transitiveDependencies) {
|
|
73
|
+
throw new Error('transitiveDependencies is not initialized, run initTransitiveDependencies() first');
|
|
74
|
+
}
|
|
48
75
|
return this._transitiveDependencies;
|
|
49
76
|
}
|
|
50
77
|
get allDependencies() {
|
|
78
|
+
if (!this.dependencies) {
|
|
79
|
+
throw new Error('dependencies is not initialized, run init() first');
|
|
80
|
+
}
|
|
51
81
|
return [...new Set([...this.dependencies, ...this.transitiveDependencies])];
|
|
52
82
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Used to find namespaces that are used in other modules
|
|
55
|
-
*/
|
|
56
|
-
symTable;
|
|
57
83
|
transformation;
|
|
58
84
|
dependencyManager;
|
|
59
85
|
log;
|
|
@@ -63,7 +89,6 @@ export class GirModule {
|
|
|
63
89
|
* Please note: Such a case is only known for Zeitgeist-2.0 with the constant "ATTACHMENT"
|
|
64
90
|
*/
|
|
65
91
|
constNames = {};
|
|
66
|
-
name;
|
|
67
92
|
c_prefixes;
|
|
68
93
|
_members;
|
|
69
94
|
_enum_constants;
|
|
@@ -72,68 +97,48 @@ export class GirModule {
|
|
|
72
97
|
package_version;
|
|
73
98
|
parent;
|
|
74
99
|
config;
|
|
75
|
-
constructor(
|
|
76
|
-
this.
|
|
77
|
-
this.version = version;
|
|
100
|
+
constructor(dependency, prefixes, config) {
|
|
101
|
+
this.dependency = dependency;
|
|
78
102
|
this.c_prefixes = [...prefixes];
|
|
79
103
|
this.package_version = ['0', '0'];
|
|
80
104
|
this.config = config;
|
|
105
|
+
// TODO: Make this a singleton
|
|
81
106
|
this.dependencyManager = DependencyManager.getInstance(this.config);
|
|
82
|
-
|
|
107
|
+
}
|
|
108
|
+
async initDependencies() {
|
|
109
|
+
this._dependencies = await this.dependencyManager.fromGirIncludes(this.dependency.girXML?.repository[0]?.include || []);
|
|
110
|
+
}
|
|
111
|
+
async initTransitiveDependencies(transitiveDependencies) {
|
|
112
|
+
this._transitiveDependencies = await this.checkTransitiveDependencies(transitiveDependencies);
|
|
83
113
|
}
|
|
84
114
|
get ns() {
|
|
85
115
|
return this;
|
|
86
116
|
}
|
|
87
|
-
checkTransitiveDependencies(transitiveDependencies) {
|
|
117
|
+
async checkTransitiveDependencies(transitiveDependencies) {
|
|
88
118
|
// Always pull in GObject-2.0, as we may need it for e.g. GObject-2.0.type
|
|
89
119
|
if (this.packageName !== 'GObject-2.0') {
|
|
90
120
|
if (!find(transitiveDependencies, (x) => x.packageName === 'GObject-2.0')) {
|
|
91
|
-
transitiveDependencies.push(this.dependencyManager.get('GObject', '2.0'));
|
|
121
|
+
transitiveDependencies.push(await this.dependencyManager.get('GObject', '2.0'));
|
|
92
122
|
}
|
|
93
123
|
}
|
|
94
124
|
// Add missing dependencies
|
|
95
125
|
if (this.packageName === 'UnityExtras-7.0') {
|
|
96
126
|
if (!find(transitiveDependencies, (x) => x.packageName === 'Unity-7.0')) {
|
|
97
|
-
transitiveDependencies.push(this.dependencyManager.get('Unity', '7.0'));
|
|
127
|
+
transitiveDependencies.push(await this.dependencyManager.get('Unity', '7.0'));
|
|
98
128
|
}
|
|
99
129
|
}
|
|
100
130
|
if (this.packageName === 'UnityExtras-6.0') {
|
|
101
131
|
if (!find(transitiveDependencies, (x) => x.packageName === 'Unity-6.0')) {
|
|
102
|
-
transitiveDependencies.push(this.dependencyManager.get('Unity', '6.0'));
|
|
132
|
+
transitiveDependencies.push(await this.dependencyManager.get('Unity', '6.0'));
|
|
103
133
|
}
|
|
104
134
|
}
|
|
105
135
|
if (this.packageName === 'GTop-2.0') {
|
|
106
136
|
if (!find(transitiveDependencies, (x) => x.packageName === 'GLib-2.0')) {
|
|
107
|
-
transitiveDependencies.push(this.dependencyManager.get('GLib', '2.0'));
|
|
137
|
+
transitiveDependencies.push(await this.dependencyManager.get('GLib', '2.0'));
|
|
108
138
|
}
|
|
109
139
|
}
|
|
110
140
|
return transitiveDependencies;
|
|
111
141
|
}
|
|
112
|
-
getTsDoc(girDoc) {
|
|
113
|
-
const tsDoc = {
|
|
114
|
-
text: '',
|
|
115
|
-
tags: [],
|
|
116
|
-
};
|
|
117
|
-
if (girDoc.doc?.[0]?._) {
|
|
118
|
-
// TODO: Somehow _ is not a string
|
|
119
|
-
let text = `${girDoc.doc?.[0]?._ || ''}`;
|
|
120
|
-
text = this.transformation.transformGirDocText(text);
|
|
121
|
-
tsDoc.text = text;
|
|
122
|
-
}
|
|
123
|
-
return tsDoc;
|
|
124
|
-
}
|
|
125
|
-
getTsDocGirElementTags(tsTypeName, girTypeName) {
|
|
126
|
-
const tags = [];
|
|
127
|
-
if (!girTypeName || IGNORE_GIR_TYPE_TS_DOC_TYPES.includes(girTypeName)) {
|
|
128
|
-
return tags;
|
|
129
|
-
}
|
|
130
|
-
tags.push({
|
|
131
|
-
tagName: girTypeName,
|
|
132
|
-
paramName: '',
|
|
133
|
-
text: '',
|
|
134
|
-
});
|
|
135
|
-
return tags;
|
|
136
|
-
}
|
|
137
142
|
getTsDocReturnTags(girElement) {
|
|
138
143
|
const girReturnValue = girElement?.returnTypeDoc;
|
|
139
144
|
if (!girReturnValue) {
|
|
@@ -200,58 +205,58 @@ export class GirModule {
|
|
|
200
205
|
hasImport(name) {
|
|
201
206
|
return this.dependencies.some((dep) => dep.importName === name);
|
|
202
207
|
}
|
|
203
|
-
_getImport(
|
|
204
|
-
if (
|
|
208
|
+
_getImport(namespace) {
|
|
209
|
+
if (namespace === this.namespace) {
|
|
205
210
|
return this;
|
|
206
211
|
}
|
|
207
|
-
const dep = this.dependencies
|
|
208
|
-
this.transitiveDependencies.find((dep) => dep.namespace ===
|
|
212
|
+
const dep = this.dependencies?.find((dep) => dep.namespace === namespace) ??
|
|
213
|
+
this.transitiveDependencies.find((dep) => dep.namespace === namespace);
|
|
209
214
|
// Handle finding imports via their other prefixes
|
|
210
215
|
if (!dep) {
|
|
211
|
-
this.log.info(`Failed to find namespace ${
|
|
216
|
+
this.log.info(`Failed to find namespace ${namespace} in dependencies, resolving via c:prefixes`);
|
|
212
217
|
// TODO: It might make more sense to move this conversion _before_
|
|
213
218
|
// the _getImport call.
|
|
214
|
-
const resolvedNamespaces = this.dependencyManager.namespacesForPrefix(
|
|
219
|
+
const resolvedNamespaces = this.dependencyManager.namespacesForPrefix(namespace);
|
|
215
220
|
if (resolvedNamespaces.length > 0) {
|
|
216
|
-
this.log.info(`Found namespaces for prefix ${
|
|
221
|
+
this.log.info(`Found namespaces for prefix ${namespace}: ${resolvedNamespaces.map((r) => `${r.namespace} (${r.version})`).join(', ')}`);
|
|
217
222
|
}
|
|
218
223
|
for (const resolvedNamespace of resolvedNamespaces) {
|
|
219
|
-
if (resolvedNamespace.
|
|
224
|
+
if (resolvedNamespace.namespace === this.namespace && resolvedNamespace.version === this.version) {
|
|
220
225
|
return this;
|
|
221
226
|
}
|
|
222
|
-
const dep = this.dependencies
|
|
223
|
-
this.transitiveDependencies.find((dep) => dep.namespace === resolvedNamespace.
|
|
227
|
+
const dep = this.dependencies?.find((dep) => dep.namespace === resolvedNamespace.namespace && dep.version === resolvedNamespace.version) ??
|
|
228
|
+
this.transitiveDependencies.find((dep) => dep.namespace === resolvedNamespace.namespace && dep.version === resolvedNamespace.version);
|
|
224
229
|
if (dep) {
|
|
225
|
-
return this.parent.namespace(resolvedNamespace.
|
|
230
|
+
return this.parent.namespace(resolvedNamespace.namespace, dep.version);
|
|
226
231
|
}
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
234
|
let version = dep?.version;
|
|
230
235
|
if (!version) {
|
|
231
|
-
version = this.parent.assertDefaultVersionOf(
|
|
236
|
+
version = this.parent.assertDefaultVersionOf(namespace);
|
|
232
237
|
}
|
|
233
|
-
return this.parent.namespace(
|
|
238
|
+
return this.parent.namespace(namespace, version);
|
|
234
239
|
}
|
|
235
|
-
getInstalledImport(
|
|
236
|
-
if (
|
|
240
|
+
getInstalledImport(_namespace) {
|
|
241
|
+
if (_namespace === this.namespace) {
|
|
237
242
|
return this;
|
|
238
243
|
}
|
|
239
|
-
const dep = this.dependencies
|
|
240
|
-
this.transitiveDependencies.find((dep) => dep.namespace ===
|
|
244
|
+
const dep = this.dependencies?.find((dep) => dep.namespace === _namespace) ??
|
|
245
|
+
this.transitiveDependencies.find((dep) => dep.namespace === _namespace);
|
|
241
246
|
let version = dep?.version;
|
|
242
247
|
if (!version) {
|
|
243
|
-
version = this.parent.defaultVersionOf(
|
|
248
|
+
version = this.parent.defaultVersionOf(_namespace) ?? undefined;
|
|
244
249
|
}
|
|
245
250
|
if (!version) {
|
|
246
251
|
return null;
|
|
247
252
|
}
|
|
248
|
-
const namespace = this.parent.namespace(
|
|
253
|
+
const namespace = this.parent.namespace(_namespace, version);
|
|
249
254
|
return namespace;
|
|
250
255
|
}
|
|
251
|
-
assertInstalledImport(
|
|
252
|
-
const namespace = this._getImport(
|
|
256
|
+
assertInstalledImport(_namespace) {
|
|
257
|
+
const namespace = this._getImport(_namespace);
|
|
253
258
|
if (!namespace) {
|
|
254
|
-
throw new Error(`Failed to import ${
|
|
259
|
+
throw new Error(`Failed to import ${_namespace} in ${this.namespace}, not installed or accessible.`);
|
|
255
260
|
}
|
|
256
261
|
return namespace;
|
|
257
262
|
}
|
|
@@ -282,7 +287,7 @@ export class GirModule {
|
|
|
282
287
|
assertClass(name) {
|
|
283
288
|
const clazz = this.getClass(name);
|
|
284
289
|
if (!clazz) {
|
|
285
|
-
throw new Error(`Class ${name} does not exist in namespace ${this.
|
|
290
|
+
throw new Error(`Class ${name} does not exist in namespace ${this.namespace}.`);
|
|
286
291
|
}
|
|
287
292
|
return clazz;
|
|
288
293
|
}
|
|
@@ -342,22 +347,17 @@ export class GirModule {
|
|
|
342
347
|
this.__dts__references ??= [];
|
|
343
348
|
this.__dts__references.push(reference);
|
|
344
349
|
}
|
|
345
|
-
static load(
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
350
|
+
static async load(dependency, config, registry) {
|
|
351
|
+
const girXML = dependency.girXML;
|
|
352
|
+
const ns = girXML?.repository[0]?.namespace?.[0];
|
|
353
|
+
if (!girXML) {
|
|
354
|
+
throw new Error(`Failed to load gir xml of ${dependency.packageName}`);
|
|
355
|
+
}
|
|
356
|
+
if (!ns) {
|
|
357
|
+
throw new Error(`Missing namespace in ${girXML.repository[0].package[0].$.name}`);
|
|
358
|
+
}
|
|
349
359
|
const modName = ns.$['name'];
|
|
350
360
|
const version = ns.$['version'];
|
|
351
|
-
// TODO: Hardcoding HarfBuzz here leads to issues when loading...
|
|
352
|
-
// Hardcode harfbuzz version for now...
|
|
353
|
-
// if (modName === 'HarfBuzz' && version === '0.0') {
|
|
354
|
-
// version = '2.0'
|
|
355
|
-
// }
|
|
356
|
-
const options = {
|
|
357
|
-
loadDocs: !config.noComments,
|
|
358
|
-
propertyCase: 'both',
|
|
359
|
-
verbose: config.verbose,
|
|
360
|
-
};
|
|
361
361
|
if (!modName) {
|
|
362
362
|
throw new Error('Invalid GIR file: no namespace name specified.');
|
|
363
363
|
}
|
|
@@ -365,112 +365,130 @@ export class GirModule {
|
|
|
365
365
|
throw new Error('Invalid GIR file: no version name specified.');
|
|
366
366
|
}
|
|
367
367
|
const c_prefix = ns.$?.['c:identifier-prefixes']?.split(',') ?? [];
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
const building = new GirModule(repo.repository[0], modName, version, c_prefix, config);
|
|
368
|
+
const building = new GirModule(dependency, c_prefix, config);
|
|
369
|
+
await building.initDependencies();
|
|
372
370
|
building.parent = registry;
|
|
373
371
|
// Set the namespace object here to prevent re-parsing the namespace if
|
|
374
372
|
// another namespace imports it.
|
|
375
373
|
registry.register(building);
|
|
376
|
-
const prefixes =
|
|
374
|
+
const prefixes = girXML.repository[0]?.$?.['c:identifier-prefixes']?.split(',');
|
|
377
375
|
const unknownPrefixes = prefixes?.filter((pre) => pre !== modName);
|
|
378
376
|
if (unknownPrefixes && unknownPrefixes.length > 0) {
|
|
379
|
-
|
|
377
|
+
Logger.log(`Found additional prefixes for ${modName}: ${unknownPrefixes.join(', ')}`);
|
|
380
378
|
building.prefixes.push(...unknownPrefixes);
|
|
381
379
|
}
|
|
380
|
+
building.transformation = Transformation.getSingleton(config);
|
|
381
|
+
building.log = new Logger(config.verbose, `GirModule(${building.packageName})`);
|
|
382
|
+
return building;
|
|
383
|
+
}
|
|
384
|
+
/** Start to parse all the data from the XML we need for the typescript generation */
|
|
385
|
+
parse() {
|
|
386
|
+
this.log.debug(`Parsing ${this.dependency.packageName}...`);
|
|
387
|
+
const girXML = this.dependency.girXML;
|
|
388
|
+
const ns = girXML?.repository[0]?.namespace?.[0];
|
|
389
|
+
const options = {
|
|
390
|
+
loadDocs: !this.config.noComments,
|
|
391
|
+
propertyCase: 'both',
|
|
392
|
+
verbose: this.config.verbose,
|
|
393
|
+
};
|
|
394
|
+
if (!girXML) {
|
|
395
|
+
throw new Error(`Failed to load gir xml of ${this.dependency.packageName}`);
|
|
396
|
+
}
|
|
397
|
+
if (!ns) {
|
|
398
|
+
throw new Error(`Missing namespace in ${girXML.repository[0].package[0].$.name}`);
|
|
399
|
+
}
|
|
382
400
|
const importConflicts = (el) => {
|
|
383
|
-
return !
|
|
401
|
+
return !this.hasImport(el.name);
|
|
384
402
|
};
|
|
385
403
|
if (ns.enumeration) {
|
|
386
404
|
// Get the requested enums
|
|
387
405
|
ns.enumeration
|
|
388
406
|
?.map((enumeration) => {
|
|
389
407
|
if (enumeration.$['glib:error-domain']) {
|
|
390
|
-
return IntrospectedError.fromXML(enumeration,
|
|
408
|
+
return IntrospectedError.fromXML(enumeration, this, options);
|
|
391
409
|
}
|
|
392
410
|
else {
|
|
393
|
-
return IntrospectedEnum.fromXML(enumeration,
|
|
411
|
+
return IntrospectedEnum.fromXML(enumeration, this, options);
|
|
394
412
|
}
|
|
395
413
|
})
|
|
396
|
-
.forEach((c) =>
|
|
414
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
397
415
|
}
|
|
398
416
|
// Constants
|
|
399
417
|
if (ns.constant) {
|
|
400
418
|
ns.constant
|
|
401
419
|
?.filter(isIntrospectable)
|
|
402
|
-
.map((constant) => IntrospectedConstant.fromXML(constant,
|
|
420
|
+
.map((constant) => IntrospectedConstant.fromXML(constant, this, options))
|
|
403
421
|
.filter(importConflicts)
|
|
404
|
-
.forEach((c) =>
|
|
422
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
405
423
|
}
|
|
406
424
|
// Get the requested functions
|
|
407
425
|
if (ns.function) {
|
|
408
426
|
ns.function
|
|
409
427
|
?.filter(isIntrospectable)
|
|
410
|
-
.map((func) => IntrospectedFunction.fromXML(func,
|
|
428
|
+
.map((func) => IntrospectedFunction.fromXML(func, this, options))
|
|
411
429
|
.filter(importConflicts)
|
|
412
|
-
.forEach((c) =>
|
|
430
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
413
431
|
}
|
|
414
432
|
if (ns.callback) {
|
|
415
433
|
ns.callback
|
|
416
434
|
?.filter(isIntrospectable)
|
|
417
|
-
.map((callback) => IntrospectedCallback.fromXML(callback,
|
|
435
|
+
.map((callback) => IntrospectedCallback.fromXML(callback, this, options))
|
|
418
436
|
.filter(importConflicts)
|
|
419
|
-
.forEach((c) =>
|
|
437
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
420
438
|
}
|
|
421
439
|
if (ns['glib:boxed']) {
|
|
422
440
|
ns['glib:boxed']
|
|
423
441
|
?.filter(isIntrospectable)
|
|
424
442
|
.map((boxed) => new IntrospectedAlias({
|
|
425
443
|
name: boxed.$['glib:name'],
|
|
426
|
-
namespace:
|
|
444
|
+
namespace: this,
|
|
427
445
|
type: new NullableType(ObjectType),
|
|
428
446
|
}))
|
|
429
|
-
.forEach((c) =>
|
|
447
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
430
448
|
}
|
|
431
449
|
// Bitfield is a type of enum
|
|
432
450
|
if (ns.bitfield) {
|
|
433
451
|
ns.bitfield
|
|
434
452
|
?.filter(isIntrospectable)
|
|
435
|
-
.map((field) => IntrospectedEnum.fromXML(field,
|
|
436
|
-
.forEach((c) =>
|
|
453
|
+
.map((field) => IntrospectedEnum.fromXML(field, this, options, true))
|
|
454
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
437
455
|
}
|
|
438
456
|
// The `enum_constants` map maps the C identifiers (GTK_BUTTON_TYPE_Y)
|
|
439
457
|
// to the name of the enum (Button) to resolve references (Gtk.Button.Y)
|
|
440
|
-
Array.from(
|
|
458
|
+
Array.from(this.members.values())
|
|
441
459
|
.filter((m) => m instanceof IntrospectedEnum)
|
|
442
460
|
.forEach((m) => {
|
|
443
461
|
m.members.forEach((member) => {
|
|
444
|
-
|
|
462
|
+
this.enum_constants.set(member.c_identifier, [m.name, member.name]);
|
|
445
463
|
});
|
|
446
464
|
});
|
|
447
465
|
// Get the requested classes
|
|
448
466
|
if (ns.class) {
|
|
449
467
|
ns.class
|
|
450
468
|
?.filter(isIntrospectable)
|
|
451
|
-
.map((klass) => IntrospectedClass.fromXML(klass,
|
|
469
|
+
.map((klass) => IntrospectedClass.fromXML(klass, this, options))
|
|
452
470
|
.filter(importConflicts)
|
|
453
|
-
.forEach((c) =>
|
|
471
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
454
472
|
}
|
|
455
473
|
if (ns.record) {
|
|
456
474
|
ns.record
|
|
457
475
|
?.filter(isIntrospectable)
|
|
458
|
-
.map((record) => IntrospectedRecord.fromXML(record,
|
|
476
|
+
.map((record) => IntrospectedRecord.fromXML(record, this, options))
|
|
459
477
|
.filter(importConflicts)
|
|
460
|
-
.forEach((c) =>
|
|
478
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
461
479
|
}
|
|
462
480
|
if (ns.union) {
|
|
463
481
|
ns.union
|
|
464
482
|
?.filter(isIntrospectable)
|
|
465
|
-
.map((union) => IntrospectedRecord.fromXML(union,
|
|
483
|
+
.map((union) => IntrospectedRecord.fromXML(union, this, options))
|
|
466
484
|
.filter(importConflicts)
|
|
467
|
-
.forEach((c) =>
|
|
485
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
468
486
|
}
|
|
469
487
|
if (ns.interface) {
|
|
470
488
|
ns.interface
|
|
471
|
-
?.map((inter) => IntrospectedInterface.fromXML(inter,
|
|
489
|
+
?.map((inter) => IntrospectedInterface.fromXML(inter, this, options))
|
|
472
490
|
.filter(importConflicts)
|
|
473
|
-
.forEach((c) =>
|
|
491
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
474
492
|
}
|
|
475
493
|
if (ns.alias) {
|
|
476
494
|
ns.alias
|
|
@@ -481,7 +499,7 @@ export class GirModule {
|
|
|
481
499
|
?.filter((t) => !!(t && t.$.name))
|
|
482
500
|
.map((t) => {
|
|
483
501
|
if (t.$.name &&
|
|
484
|
-
!
|
|
502
|
+
!this.hasSymbol(t.$.name) &&
|
|
485
503
|
!isPrimitiveType(t.$.name) &&
|
|
486
504
|
!t.$.name.includes('.')) {
|
|
487
505
|
return { $: { name: 'unknown', 'c:type': 'unknown' } };
|
|
@@ -490,31 +508,9 @@ export class GirModule {
|
|
|
490
508
|
});
|
|
491
509
|
return b;
|
|
492
510
|
})
|
|
493
|
-
.map((alias) => IntrospectedAlias.fromXML(alias,
|
|
511
|
+
.map((alias) => IntrospectedAlias.fromXML(alias, this, options))
|
|
494
512
|
.filter((alias) => alias != null)
|
|
495
|
-
.forEach((c) =>
|
|
496
|
-
}
|
|
497
|
-
building.namespace = building.ns.name;
|
|
498
|
-
building.version = building.ns.version;
|
|
499
|
-
building.packageName = `${building.namespace}-${building.version}`;
|
|
500
|
-
building.libraryVersion = new LibraryVersion(ns.constant, building.version);
|
|
501
|
-
building.transformation = new Transformation(config);
|
|
502
|
-
building.log = new Logger(config.verbose, building.packageName || 'GirModule');
|
|
503
|
-
building.importNamespace = building.transformation.transformModuleNamespaceName(building.packageName);
|
|
504
|
-
building.importName = building.transformation.transformImportName(building.packageName);
|
|
505
|
-
building.symTable = new SymTable(building.config, building.packageName, building.namespace);
|
|
506
|
-
return building;
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Start processing the typescript data
|
|
510
|
-
*/
|
|
511
|
-
start(girModules) {
|
|
512
|
-
// GObject and Gio are following the version of GLib
|
|
513
|
-
if (this.namespace === 'GObject' || this.namespace === 'Gio') {
|
|
514
|
-
const glibModule = girModules.find((girModule) => girModule.namespace === 'GLib');
|
|
515
|
-
if (glibModule) {
|
|
516
|
-
this.libraryVersion = glibModule.libraryVersion;
|
|
517
|
-
}
|
|
513
|
+
.forEach((c) => this.members.set(c.name, c));
|
|
518
514
|
}
|
|
519
515
|
}
|
|
520
516
|
}
|