@ts-for-gir/lib 4.0.0-beta.2 → 4.0.0-beta.21
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/constants.d.ts +6 -7
- package/lib/constants.js +74 -9
- package/lib/constants.js.map +1 -1
- package/lib/dependency-manager.d.ts +60 -14
- package/lib/dependency-manager.js +148 -46
- package/lib/dependency-manager.js.map +1 -1
- package/lib/generators/dts-inline.d.ts +4 -2
- package/lib/generators/dts-inline.js +10 -12
- package/lib/generators/dts-inline.js.map +1 -1
- package/lib/generators/dts-modules.d.ts +4 -2
- package/lib/generators/dts-modules.js +12 -14
- package/lib/generators/dts-modules.js.map +1 -1
- package/lib/generators/dts.d.ts +2 -2
- package/lib/generators/dts.js +10 -9
- 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 +6 -5
- package/lib/generators/json.js +18 -21
- package/lib/generators/json.js.map +1 -1
- package/lib/generics/clutter.d.ts +15 -0
- package/lib/generics/clutter.js +3 -0
- package/lib/generics/clutter.js.map +1 -1
- package/lib/generics/generify.js +11 -3
- package/lib/generics/generify.js.map +1 -1
- package/lib/generics/gtk.d.ts +7 -0
- package/lib/generics/gtk.js +56 -0
- package/lib/generics/gtk.js.map +1 -0
- package/lib/generics/meta.d.ts +15 -0
- package/lib/generics/meta.js +3 -0
- package/lib/generics/meta.js.map +1 -1
- package/lib/generics/st.d.ts +15 -0
- package/lib/generics/st.js +16 -10
- package/lib/generics/st.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 +2 -14
- package/lib/gir/base.js.map +1 -1
- package/lib/gir/class.d.ts +6 -7
- package/lib/gir/class.js +35 -108
- 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 +11 -10
- package/lib/gir/function.js +4 -4
- package/lib/gir/function.js.map +1 -1
- package/lib/gir/index.d.ts +14 -0
- package/lib/gir/index.js +15 -0
- package/lib/gir/index.js.map +1 -0
- 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/promisify.d.ts +5 -0
- package/lib/gir/promisify.js +158 -0
- package/lib/gir/promisify.js.map +1 -0
- 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 +6 -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 +27 -39
- package/lib/gir-module.js +161 -149
- package/lib/gir-module.js.map +1 -1
- package/lib/gir.d.ts +43 -40
- package/lib/gir.js +28 -27
- package/lib/gir.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/injections/gio.js +133 -1
- package/lib/injections/gio.js.map +1 -1
- package/lib/injections/glib.js +6 -0
- package/lib/injections/glib.js.map +1 -1
- package/lib/injections/gobject.js +84 -64
- package/lib/injections/gobject.js.map +1 -1
- package/lib/injections/gtk4.d.ts +7 -0
- package/lib/injections/gtk4.js +19 -0
- package/lib/injections/gtk4.js.map +1 -0
- package/lib/injections/inject.js +5 -0
- package/lib/injections/inject.js.map +1 -1
- package/lib/injections/shell.d.ts +20 -0
- package/lib/injections/shell.js +34 -0
- package/lib/injections/shell.js.map +1 -0
- 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/messages.d.ts +0 -3
- package/lib/messages.js +0 -3
- package/lib/messages.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 -15
- package/lib/transformation.js +9 -89
- 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-instance-parameter.d.ts +1 -2
- 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} +21 -11
- 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/types/user-config.d.ts +21 -6
- package/lib/utils/files.d.ts +21 -0
- package/lib/utils/files.js +62 -0
- package/lib/utils/files.js.map +1 -0
- package/lib/utils/girs.d.ts +45 -0
- package/lib/utils/girs.js +101 -0
- package/lib/utils/girs.js.map +1 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +7 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/numbers.d.ts +6 -0
- package/lib/utils/numbers.js +9 -0
- package/lib/utils/numbers.js.map +1 -0
- package/lib/utils/objects.d.ts +136 -0
- package/lib/utils/objects.js +121 -0
- package/lib/utils/objects.js.map +1 -0
- package/lib/utils/path.d.ts +1 -0
- package/lib/utils/path.js +7 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/utils/strings.d.ts +74 -0
- package/lib/utils/strings.js +121 -0
- package/lib/utils/strings.js.map +1 -0
- package/lib/utils.d.ts +21 -15
- package/lib/utils.js +58 -13
- package/lib/utils.js.map +1 -1
- package/lib/validators/enum-parameters.d.ts +16 -0
- package/lib/validators/enum-parameters.js +42 -0
- package/lib/validators/enum-parameters.js.map +1 -0
- package/lib/validators/function-parameters.d.ts +14 -0
- package/lib/validators/function-parameters.js +31 -0
- package/lib/validators/function-parameters.js.map +1 -0
- package/lib/validators/interface.js +1 -1
- package/lib/validators/interface.js.map +1 -1
- package/package.json +15 -14
- 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/base.js
CHANGED
|
@@ -57,13 +57,7 @@ export class IntrospectedBase {
|
|
|
57
57
|
this._isIntrospectable = from.isIntrospectable;
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
60
|
-
static fromXML(
|
|
61
|
-
// eslint-disable-next-line
|
|
62
|
-
element,
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
|
-
parent,
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
66
|
-
options) {
|
|
60
|
+
static fromXML(element, parent, options) {
|
|
67
61
|
throw new Error("GirBase cannot be instantiated");
|
|
68
62
|
}
|
|
69
63
|
}
|
|
@@ -74,13 +68,7 @@ export class IntrospectedNamespaceMember extends IntrospectedBase {
|
|
|
74
68
|
get namespace() {
|
|
75
69
|
return this.parent;
|
|
76
70
|
}
|
|
77
|
-
static fromXML(
|
|
78
|
-
// eslint-disable-next-line
|
|
79
|
-
element,
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
|
-
parent,
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
83
|
-
options) {
|
|
71
|
+
static fromXML(element, parent, options) {
|
|
84
72
|
throw new Error("GirBase cannot be instantiated");
|
|
85
73
|
}
|
|
86
74
|
}
|
package/lib/gir/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/gir/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/gir/base.ts"],"names":[],"mappings":"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"}
|
package/lib/gir/class.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { TypeIdentifier, Generic } from "../gir.js";
|
|
2
2
|
import { TypeExpression } from "../gir.js";
|
|
3
3
|
import { IntrospectedBase, IntrospectedClassMember, IntrospectedNamespaceMember, Options } from "./base.js";
|
|
4
|
-
import { GirInterfaceElement, GirClassElement, GirRecordElement, GirUnionElement
|
|
4
|
+
import { ClassStructTypeIdentifier, type GirInterfaceElement, type GirClassElement, type GirRecordElement, type GirUnionElement } from "../index.js";
|
|
5
5
|
import { IntrospectedClassFunction, IntrospectedVirtualClassFunction, IntrospectedStaticClassFunction, IntrospectedConstructor, IntrospectedDirectAllocationConstructor, IntrospectedClassCallback } from "./function.js";
|
|
6
6
|
import { IntrospectedProperty, IntrospectedField } from "./property.js";
|
|
7
7
|
import { IntrospectedNamespace } from "./namespace.js";
|
|
8
8
|
import { IntrospectedSignal } from "./signal.js";
|
|
9
9
|
import { FormatGenerator } from "../generators/generator.js";
|
|
10
|
-
import { LoadOptions } from "../types.js";
|
|
11
10
|
import { GirVisitor } from "../visitor.js";
|
|
11
|
+
import type { OptionsLoad } from "../types/index.js";
|
|
12
12
|
export declare enum FilterBehavior {
|
|
13
13
|
DELETE = 0,
|
|
14
14
|
PRESERVE = 1
|
|
15
15
|
}
|
|
16
16
|
export declare function filterConflicts<T extends IntrospectedClassMember | IntrospectedClassFunction | IntrospectedProperty>(ns: IntrospectedNamespace, c: IntrospectedBaseClass, elements: T[], behavior?: FilterBehavior): T[];
|
|
17
17
|
export declare function filterFunctionConflict<T extends IntrospectedStaticClassFunction | IntrospectedVirtualClassFunction | IntrospectedClassFunction | IntrospectedConstructor>(ns: IntrospectedNamespace, base: IntrospectedBaseClass, elements: T[], conflict_ids: string[]): T[];
|
|
18
|
-
export declare function promisifyFunctions(functions: IntrospectedClassFunction[]): IntrospectedClassFunction<IntrospectedBaseClass | import("./enum.js").IntrospectedEnum>[];
|
|
19
18
|
export declare const enum ClassInjectionMember {
|
|
20
19
|
MEMBER = "member",
|
|
21
20
|
CONSTRUCTOR = "_constructor",
|
|
@@ -90,7 +89,7 @@ export declare abstract class IntrospectedBaseClass extends IntrospectedNamespac
|
|
|
90
89
|
propagate?: boolean;
|
|
91
90
|
}): void;
|
|
92
91
|
getType(): TypeIdentifier;
|
|
93
|
-
static fromXML(element: GirClassElement | GirInterfaceElement | GirRecordElement, ns: IntrospectedNamespace, options:
|
|
92
|
+
static fromXML(element: GirClassElement | GirInterfaceElement | GirRecordElement, ns: IntrospectedNamespace, options: OptionsLoad): IntrospectedBaseClass;
|
|
94
93
|
abstract asString<T = string>(generator: FormatGenerator<T>): T;
|
|
95
94
|
}
|
|
96
95
|
type ClassMember = IntrospectedClassMember | IntrospectedClassFunction | IntrospectedProperty;
|
|
@@ -121,7 +120,7 @@ export declare class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
121
120
|
callbacks?: IntrospectedClassCallback[];
|
|
122
121
|
}): IntrospectedClass;
|
|
123
122
|
get staticDefinition(): string | null;
|
|
124
|
-
static fromXML(element: GirClassElement, ns: IntrospectedNamespace, options:
|
|
123
|
+
static fromXML(element: GirClassElement, ns: IntrospectedNamespace, options: OptionsLoad): IntrospectedClass;
|
|
125
124
|
registerStaticDefinition(typeStruct: string): void;
|
|
126
125
|
asString<T extends FormatGenerator<unknown>>(generator: T): ReturnType<T["generateClass"]>;
|
|
127
126
|
}
|
|
@@ -147,7 +146,7 @@ export declare class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
147
146
|
callbacks?: IntrospectedClassCallback[];
|
|
148
147
|
}): IntrospectedRecord;
|
|
149
148
|
static foreign(name: string, namespace: IntrospectedNamespace): IntrospectedRecord;
|
|
150
|
-
static fromXML(element: GirRecordElement | GirUnionElement, namespace: IntrospectedNamespace, options:
|
|
149
|
+
static fromXML(element: GirRecordElement | GirUnionElement, namespace: IntrospectedNamespace, options: OptionsLoad): IntrospectedRecord;
|
|
151
150
|
/**
|
|
152
151
|
* Calculate if a type expression is "simple" without pointers
|
|
153
152
|
*/
|
|
@@ -183,7 +182,7 @@ export declare class IntrospectedInterface extends IntrospectedBaseClass {
|
|
|
183
182
|
findParentMap<K>(predicate: (p: IntrospectedClass | IntrospectedInterface) => K | undefined): K | undefined;
|
|
184
183
|
resolveParents(): InterfaceResolution;
|
|
185
184
|
accept(visitor: GirVisitor): IntrospectedInterface;
|
|
186
|
-
static fromXML(element: GirInterfaceElement, namespace: IntrospectedNamespace, options:
|
|
185
|
+
static fromXML(element: GirInterfaceElement, namespace: IntrospectedNamespace, options: OptionsLoad): IntrospectedInterface;
|
|
187
186
|
asString<T extends FormatGenerator<unknown>>(generator: T): ReturnType<T["generateInterface"]>;
|
|
188
187
|
}
|
|
189
188
|
export {};
|
package/lib/gir/class.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Logger } from "../logger.js";
|
|
2
|
+
import { NativeType, TypeIdentifier, NeverType, ArrayType, Generic, GenericType, GenerifiedTypeIdentifier, AnyType, ConflictType, TypeConflict } from "../gir.js";
|
|
2
3
|
import { IntrospectedNamespaceMember } from "./base.js";
|
|
3
4
|
import { GirDirection, ClassStructTypeIdentifier } from "../index.js";
|
|
4
5
|
import { IntrospectedClassFunction, IntrospectedVirtualClassFunction, IntrospectedStaticClassFunction, IntrospectedConstructor, IntrospectedFunctionParameter, IntrospectedClassCallback } from "./function.js";
|
|
@@ -12,6 +13,7 @@ export var FilterBehavior;
|
|
|
12
13
|
FilterBehavior[FilterBehavior["DELETE"] = 0] = "DELETE";
|
|
13
14
|
FilterBehavior[FilterBehavior["PRESERVE"] = 1] = "PRESERVE";
|
|
14
15
|
})(FilterBehavior || (FilterBehavior = {}));
|
|
16
|
+
const log = new Logger(true, "gir/class");
|
|
15
17
|
export function filterConflicts(ns, c, elements, behavior = FilterBehavior.PRESERVE) {
|
|
16
18
|
const filtered = [...elements.filter(p => p && p.name)];
|
|
17
19
|
const prev = [];
|
|
@@ -47,7 +49,7 @@ export function filterConflicts(ns, c, elements, behavior = FilterBehavior.PRESE
|
|
|
47
49
|
}
|
|
48
50
|
if (next instanceof IntrospectedProperty &&
|
|
49
51
|
!isSubtypeOf(ns, thisType, resolved_parent.getType(), next.type, p.type)) {
|
|
50
|
-
|
|
52
|
+
log.warn(`>> Conflict in ${next.parent?.name}.${next.name} with ${p.parent?.name}.${p.name}.`);
|
|
51
53
|
return ConflictType.PROPERTY_NAME_CONFLICT;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -121,7 +123,7 @@ export function filterFunctionConflict(ns, base, elements, conflict_ids) {
|
|
|
121
123
|
if (p.name && p.name == next.name) {
|
|
122
124
|
const conflicting = isConflictingFunction(ns, nextType, next, parentType, p);
|
|
123
125
|
if (conflicting) {
|
|
124
|
-
msg = `// Conflicted with ${resolved_parent.namespace.
|
|
126
|
+
msg = `// Conflicted with ${resolved_parent.namespace.namespace}.${resolved_parent.name}.${p.name}`;
|
|
125
127
|
return true;
|
|
126
128
|
}
|
|
127
129
|
return conflicting;
|
|
@@ -133,7 +135,7 @@ export function filterFunctionConflict(ns, base, elements, conflict_ids) {
|
|
|
133
135
|
// the class or in the parent...
|
|
134
136
|
const field_conflicts = [...base.props, ...base.fields].some(p => p.name && p.name === next.name) ||
|
|
135
137
|
base.someParent(resolved_parent => [...resolved_parent.props, ...resolved_parent.fields].some(p => p.name && p.name === next.name));
|
|
136
|
-
const isGObject = base.someParent(p => p.namespace.
|
|
138
|
+
const isGObject = base.someParent(p => p.namespace.namespace === "GObject" && p.name === "Object");
|
|
137
139
|
if (isGObject) {
|
|
138
140
|
conflicts = conflicts || ["connect", "connect_after", "emit"].includes(next.name);
|
|
139
141
|
}
|
|
@@ -173,7 +175,7 @@ export function filterFunctionConflict(ns, base, elements, conflict_ids) {
|
|
|
173
175
|
prev.push(next, never);
|
|
174
176
|
}
|
|
175
177
|
else if (field_conflicts) {
|
|
176
|
-
|
|
178
|
+
log.warn(`Omitting ${next.name} due to field or property conflict.`);
|
|
177
179
|
}
|
|
178
180
|
else {
|
|
179
181
|
prev.push(next);
|
|
@@ -181,71 +183,6 @@ export function filterFunctionConflict(ns, base, elements, conflict_ids) {
|
|
|
181
183
|
return prev;
|
|
182
184
|
}, []);
|
|
183
185
|
}
|
|
184
|
-
export function promisifyFunctions(functions) {
|
|
185
|
-
return functions
|
|
186
|
-
.map(node => {
|
|
187
|
-
if (node.parameters.length > 0) {
|
|
188
|
-
const last_param = node.parameters[node.parameters.length - 1];
|
|
189
|
-
if (last_param) {
|
|
190
|
-
const last_param_unwrapped = last_param.type.unwrap();
|
|
191
|
-
if (last_param_unwrapped instanceof ClosureType) {
|
|
192
|
-
const internal = last_param_unwrapped.type;
|
|
193
|
-
if (internal instanceof TypeIdentifier && internal.is("Gio", "AsyncReadyCallback")) {
|
|
194
|
-
const parent = node.parent;
|
|
195
|
-
const interfaceParent = node.interfaceParent;
|
|
196
|
-
if (parent instanceof IntrospectedBaseClass) {
|
|
197
|
-
const async_res = (node instanceof IntrospectedStaticClassFunction
|
|
198
|
-
? [
|
|
199
|
-
...parent.constructors,
|
|
200
|
-
...parent.members.filter(m => m instanceof IntrospectedStaticClassFunction)
|
|
201
|
-
]
|
|
202
|
-
: [
|
|
203
|
-
...(interfaceParent instanceof IntrospectedInterface
|
|
204
|
-
? [...interfaceParent.members]
|
|
205
|
-
: []),
|
|
206
|
-
...parent.members.filter(m => !(m instanceof IntrospectedStaticClassFunction))
|
|
207
|
-
]).find(m => m.name === `${node.name.replace(/_async$/, "")}_finish` ||
|
|
208
|
-
m.name === `${node.name}_finish`);
|
|
209
|
-
if (async_res) {
|
|
210
|
-
const async_parameters = node.parameters
|
|
211
|
-
.slice(0, -1)
|
|
212
|
-
.map(p => p.copy({ parent: null }));
|
|
213
|
-
const sync_parameters = node.parameters.map(p => p.copy({ isOptional: false }));
|
|
214
|
-
const output_parameters = async_res instanceof IntrospectedConstructor ? [] : async_res.output_parameters;
|
|
215
|
-
let async_return = new PromiseType(async_res.return());
|
|
216
|
-
if (output_parameters.length > 0) {
|
|
217
|
-
const raw_return = async_res.return();
|
|
218
|
-
if (raw_return.equals(VoidType) || raw_return.equals(BooleanType)) {
|
|
219
|
-
const [output_type, ...output_types] = output_parameters.map(op => op.type);
|
|
220
|
-
async_return = new PromiseType(new TupleType(output_type, ...output_types));
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
const [...output_types] = output_parameters.map(op => op.type);
|
|
224
|
-
async_return = new PromiseType(new TupleType(raw_return, ...output_types));
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return [
|
|
228
|
-
node.copy({
|
|
229
|
-
parameters: async_parameters,
|
|
230
|
-
returnType: async_return
|
|
231
|
-
}),
|
|
232
|
-
node.copy({
|
|
233
|
-
parameters: sync_parameters
|
|
234
|
-
}),
|
|
235
|
-
node.copy({
|
|
236
|
-
returnType: new BinaryType(async_return, node.return())
|
|
237
|
-
})
|
|
238
|
-
];
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return node;
|
|
246
|
-
})
|
|
247
|
-
.flat(1);
|
|
248
|
-
}
|
|
249
186
|
export class IntrospectedBaseClass extends IntrospectedNamespaceMember {
|
|
250
187
|
/**
|
|
251
188
|
* Used to add a TypeScript index signature to a class
|
|
@@ -279,15 +216,9 @@ export class IntrospectedBaseClass extends IntrospectedNamespaceMember {
|
|
|
279
216
|
this.generics.push(param);
|
|
280
217
|
}
|
|
281
218
|
getType() {
|
|
282
|
-
return new TypeIdentifier(this.name, this.namespace.
|
|
219
|
+
return new TypeIdentifier(this.name, this.namespace.namespace);
|
|
283
220
|
}
|
|
284
|
-
static fromXML(
|
|
285
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
286
|
-
element,
|
|
287
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
288
|
-
ns,
|
|
289
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
290
|
-
options) {
|
|
221
|
+
static fromXML(element, ns, options) {
|
|
291
222
|
throw new Error("fromXML is not implemented on GirBaseClass");
|
|
292
223
|
}
|
|
293
224
|
}
|
|
@@ -560,9 +491,9 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
560
491
|
return this._staticDefinition;
|
|
561
492
|
}
|
|
562
493
|
static fromXML(element, ns, options) {
|
|
563
|
-
const name = sanitizeIdentifierName(ns.
|
|
494
|
+
const name = sanitizeIdentifierName(ns.namespace, element.$.name);
|
|
564
495
|
if (options.verbose) {
|
|
565
|
-
|
|
496
|
+
log.debug(` >> GirClass: Parsing definition ${element.$.name} (${name})...`);
|
|
566
497
|
}
|
|
567
498
|
const clazz = new IntrospectedClass(name, ns);
|
|
568
499
|
if (options.loadDocs) {
|
|
@@ -571,26 +502,26 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
571
502
|
}
|
|
572
503
|
if (element.$["glib:type-name"]) {
|
|
573
504
|
clazz.resolve_names.push(element.$["glib:type-name"]);
|
|
574
|
-
ns.registerResolveName(element.$["glib:type-name"], ns.
|
|
505
|
+
ns.registerResolveName(element.$["glib:type-name"], ns.namespace, name);
|
|
575
506
|
}
|
|
576
507
|
if (element.$["glib:type-struct"]) {
|
|
577
508
|
clazz.resolve_names.push();
|
|
578
|
-
ns.registerResolveName(element.$["glib:type-struct"], ns.
|
|
509
|
+
ns.registerResolveName(element.$["glib:type-struct"], ns.namespace, name);
|
|
579
510
|
}
|
|
580
511
|
if (element.$["c:type"]) {
|
|
581
512
|
clazz.resolve_names.push(element.$["c:type"]);
|
|
582
|
-
ns.registerResolveName(element.$["c:type"], ns.
|
|
513
|
+
ns.registerResolveName(element.$["c:type"], ns.namespace, name);
|
|
583
514
|
}
|
|
584
515
|
const typeStruct = element.$["glib:type-struct"];
|
|
585
516
|
if (typeStruct) {
|
|
586
517
|
clazz.registerStaticDefinition(typeStruct);
|
|
587
518
|
clazz.resolve_names.push(typeStruct);
|
|
588
|
-
ns.registerResolveName(typeStruct, ns.
|
|
519
|
+
ns.registerResolveName(typeStruct, ns.namespace, name);
|
|
589
520
|
}
|
|
590
521
|
try {
|
|
591
522
|
// Setup parent type if this is an interface or class.
|
|
592
523
|
if (element.$.parent) {
|
|
593
|
-
clazz.superType = parseTypeIdentifier(ns.
|
|
524
|
+
clazz.superType = parseTypeIdentifier(ns.namespace, element.$.parent);
|
|
594
525
|
}
|
|
595
526
|
if (element.$.abstract) {
|
|
596
527
|
clazz.isAbstract = true;
|
|
@@ -639,7 +570,7 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
639
570
|
if (element.implements) {
|
|
640
571
|
element.implements.forEach(implementee => {
|
|
641
572
|
const name = implementee.$.name;
|
|
642
|
-
const type = parseTypeIdentifier(ns.
|
|
573
|
+
const type = parseTypeIdentifier(ns.namespace, name);
|
|
643
574
|
if (type) {
|
|
644
575
|
clazz.interfaces.push(type);
|
|
645
576
|
}
|
|
@@ -649,7 +580,7 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
649
580
|
if (element.callback) {
|
|
650
581
|
clazz.callbacks.push(...element.callback.map(callback => {
|
|
651
582
|
if (options.verbose) {
|
|
652
|
-
|
|
583
|
+
log.debug(`Adding callback ${callback.$.name} for ${ns.namespace}`);
|
|
653
584
|
}
|
|
654
585
|
return IntrospectedClassCallback.fromXML(callback, clazz, options);
|
|
655
586
|
}));
|
|
@@ -664,8 +595,7 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
664
595
|
}
|
|
665
596
|
}
|
|
666
597
|
catch (e) {
|
|
667
|
-
|
|
668
|
-
console.error(e);
|
|
598
|
+
log.error(`Failed to parse class: ${clazz.name} in ${ns.namespace}.`, e);
|
|
669
599
|
}
|
|
670
600
|
return clazz;
|
|
671
601
|
}
|
|
@@ -691,7 +621,7 @@ export class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
691
621
|
if (this._structFor) {
|
|
692
622
|
return this._structFor;
|
|
693
623
|
}
|
|
694
|
-
return new TypeIdentifier(this.name, this.namespace.
|
|
624
|
+
return new TypeIdentifier(this.name, this.namespace.namespace);
|
|
695
625
|
}
|
|
696
626
|
someParent(predicate) {
|
|
697
627
|
const resolution = this.resolveParents();
|
|
@@ -756,7 +686,7 @@ export class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
756
686
|
const clazz = new IntrospectedRecord({ name, namespace });
|
|
757
687
|
clazz._copyBaseProperties(this);
|
|
758
688
|
if (superType) {
|
|
759
|
-
clazz.superType;
|
|
689
|
+
clazz.superType = superType;
|
|
760
690
|
}
|
|
761
691
|
clazz._structFor = _structFor;
|
|
762
692
|
clazz._isForeign = _isForeign;
|
|
@@ -778,27 +708,27 @@ export class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
778
708
|
if (!element.$.name) {
|
|
779
709
|
throw new Error("Invalid GIR File: No name provided for union.");
|
|
780
710
|
}
|
|
781
|
-
const name = sanitizeIdentifierName(namespace.
|
|
711
|
+
const name = sanitizeIdentifierName(namespace.namespace, element.$.name);
|
|
782
712
|
if (options.verbose) {
|
|
783
|
-
|
|
713
|
+
log.debug(` >> GirRecord: Parsing definition ${element.$.name} (${name})...`);
|
|
784
714
|
}
|
|
785
715
|
const clazz = new IntrospectedRecord({ name, namespace });
|
|
786
716
|
clazz.setPrivate(element.$.name.startsWith("_") ||
|
|
787
717
|
("disguised" in element.$ && element.$.disguised === "1") ||
|
|
788
718
|
("opaque" in element.$ && element.$.opaque === "1"));
|
|
789
719
|
if (typeof element.$["glib:is-gtype-struct-for"] === "string" && !!element.$["glib:is-gtype-struct-for"]) {
|
|
790
|
-
const structFor = parseTypeIdentifier(namespace.
|
|
720
|
+
const structFor = parseTypeIdentifier(namespace.namespace, element.$["glib:is-gtype-struct-for"]);
|
|
791
721
|
// This let's replace these references when generating.
|
|
792
722
|
clazz._structFor = new ClassStructTypeIdentifier(structFor.name, structFor.namespace);
|
|
793
723
|
}
|
|
794
724
|
else {
|
|
795
725
|
if (element.$["glib:type-name"]) {
|
|
796
726
|
clazz.resolve_names.push(element.$["glib:type-name"]);
|
|
797
|
-
namespace.registerResolveName(element.$["glib:type-name"], namespace.
|
|
727
|
+
namespace.registerResolveName(element.$["glib:type-name"], namespace.namespace, name);
|
|
798
728
|
}
|
|
799
729
|
if (element.$["c:type"]) {
|
|
800
730
|
clazz.resolve_names.push(element.$["c:type"]);
|
|
801
|
-
namespace.registerResolveName(element.$["c:type"], namespace.
|
|
731
|
+
namespace.registerResolveName(element.$["c:type"], namespace.namespace, name);
|
|
802
732
|
}
|
|
803
733
|
}
|
|
804
734
|
if (options.loadDocs) {
|
|
@@ -831,8 +761,7 @@ export class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
831
761
|
}
|
|
832
762
|
}
|
|
833
763
|
catch (e) {
|
|
834
|
-
|
|
835
|
-
console.error(e);
|
|
764
|
+
log.error(`Failed to parse record: ${clazz.name}.`, e);
|
|
836
765
|
}
|
|
837
766
|
return clazz;
|
|
838
767
|
}
|
|
@@ -928,7 +857,6 @@ export class IntrospectedRecord extends IntrospectedBaseClass {
|
|
|
928
857
|
// "simple" records.
|
|
929
858
|
if (!this.isSimple()) {
|
|
930
859
|
return null;
|
|
931
|
-
("not simple");
|
|
932
860
|
}
|
|
933
861
|
// Because we may have to recursively check
|
|
934
862
|
// if types are instantiable we cache whether
|
|
@@ -1035,9 +963,9 @@ export class IntrospectedInterface extends IntrospectedBaseClass {
|
|
|
1035
963
|
return visitor.visitInterface?.(node) ?? node;
|
|
1036
964
|
}
|
|
1037
965
|
static fromXML(element, namespace, options) {
|
|
1038
|
-
const name = sanitizeIdentifierName(namespace.
|
|
966
|
+
const name = sanitizeIdentifierName(namespace.namespace, element.$.name);
|
|
1039
967
|
if (options.verbose) {
|
|
1040
|
-
|
|
968
|
+
log.debug(` >> GirInterface: Parsing definition ${element.$.name} (${name})...`);
|
|
1041
969
|
}
|
|
1042
970
|
const clazz = new IntrospectedInterface({ name, namespace });
|
|
1043
971
|
if (options.loadDocs) {
|
|
@@ -1046,22 +974,22 @@ export class IntrospectedInterface extends IntrospectedBaseClass {
|
|
|
1046
974
|
}
|
|
1047
975
|
if (element.$["glib:type-name"]) {
|
|
1048
976
|
clazz.resolve_names.push(element.$["glib:type-name"]);
|
|
1049
|
-
namespace.registerResolveName(element.$["glib:type-name"], namespace.
|
|
977
|
+
namespace.registerResolveName(element.$["glib:type-name"], namespace.namespace, name);
|
|
1050
978
|
}
|
|
1051
979
|
if (element.$["glib:type-struct"]) {
|
|
1052
980
|
clazz.resolve_names.push();
|
|
1053
|
-
namespace.registerResolveName(element.$["glib:type-struct"], namespace.
|
|
981
|
+
namespace.registerResolveName(element.$["glib:type-struct"], namespace.namespace, name);
|
|
1054
982
|
}
|
|
1055
983
|
if (element.$["c:type"]) {
|
|
1056
984
|
clazz.resolve_names.push(element.$["c:type"]);
|
|
1057
|
-
namespace.registerResolveName(element.$["c:type"], namespace.
|
|
985
|
+
namespace.registerResolveName(element.$["c:type"], namespace.namespace, name);
|
|
1058
986
|
}
|
|
1059
987
|
try {
|
|
1060
988
|
// Setup the "parent" (prerequisite) for this interface.
|
|
1061
989
|
if (element.prerequisite && element.prerequisite[0]) {
|
|
1062
990
|
const [prerequisite] = element.prerequisite;
|
|
1063
991
|
if (prerequisite.$.name) {
|
|
1064
|
-
clazz.superType = parseTypeIdentifier(namespace.
|
|
992
|
+
clazz.superType = parseTypeIdentifier(namespace.namespace, prerequisite.$.name);
|
|
1065
993
|
}
|
|
1066
994
|
}
|
|
1067
995
|
if (Array.isArray(element.constructor)) {
|
|
@@ -1107,7 +1035,7 @@ export class IntrospectedInterface extends IntrospectedBaseClass {
|
|
|
1107
1035
|
if (element.callback) {
|
|
1108
1036
|
for (const callback of element.callback) {
|
|
1109
1037
|
if (options.verbose) {
|
|
1110
|
-
|
|
1038
|
+
log.debug(`Adding callback ${callback.$.name} for ${namespace.namespace}`);
|
|
1111
1039
|
}
|
|
1112
1040
|
clazz.callbacks.push(IntrospectedClassCallback.fromXML(callback, clazz, options));
|
|
1113
1041
|
}
|
|
@@ -1120,8 +1048,7 @@ export class IntrospectedInterface extends IntrospectedBaseClass {
|
|
|
1120
1048
|
}
|
|
1121
1049
|
}
|
|
1122
1050
|
catch (e) {
|
|
1123
|
-
|
|
1124
|
-
console.error(e);
|
|
1051
|
+
log.error(`Failed to parse interface: ${clazz.name}.`, e);
|
|
1125
1052
|
}
|
|
1126
1053
|
return clazz;
|
|
1127
1054
|
}
|