@ts-for-gir/lib 4.0.0-beta.42 → 4.0.0-beta.43
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-for-gir/lib",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.43",
|
|
4
4
|
"description": "Typescript .d.ts generator from GIR for gjs",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"type definitions"
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@ts-for-gir/tsconfig": "^4.0.0-beta.
|
|
44
|
+
"@ts-for-gir/tsconfig": "^4.0.0-beta.43",
|
|
45
45
|
"@types/ejs": "^3.1.5",
|
|
46
46
|
"@types/lodash": "^4.17.24",
|
|
47
47
|
"@types/node": "^24.12.0",
|
|
48
48
|
"rimraf": "^6.1.3",
|
|
49
|
-
"typescript": "^
|
|
49
|
+
"typescript": "^6.0.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@gi.ts/parser": "^4.0.0-beta.
|
|
53
|
-
"@ts-for-gir/reporter": "^4.0.0-beta.
|
|
54
|
-
"@ts-for-gir/templates": "^4.0.0-beta.
|
|
52
|
+
"@gi.ts/parser": "^4.0.0-beta.43",
|
|
53
|
+
"@ts-for-gir/reporter": "^4.0.0-beta.43",
|
|
54
|
+
"@ts-for-gir/templates": "^4.0.0-beta.43",
|
|
55
55
|
"colorette": "^2.0.20",
|
|
56
56
|
"ejs": "^5.0.1",
|
|
57
57
|
"glob": "^13.0.6",
|
|
@@ -55,6 +55,7 @@ export interface SignalDescriptor {
|
|
|
55
55
|
signal?: IntrospectedSignal;
|
|
56
56
|
isNotifySignal?: boolean;
|
|
57
57
|
isDetailSignal?: boolean;
|
|
58
|
+
isTemplateLiteral?: boolean;
|
|
58
59
|
parameterTypes?: string[];
|
|
59
60
|
returnType?: string;
|
|
60
61
|
}
|
|
@@ -663,6 +664,19 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
663
664
|
returnType: "void",
|
|
664
665
|
});
|
|
665
666
|
});
|
|
667
|
+
|
|
668
|
+
// Add template literal catch-all for arbitrary property names.
|
|
669
|
+
// Only on GObject.Object itself — children inherit it via SignalSignatures extends.
|
|
670
|
+
if (this.isGObjectObject()) {
|
|
671
|
+
allSignals.push({
|
|
672
|
+
name: `notify::\${string}`,
|
|
673
|
+
isNotifySignal: true,
|
|
674
|
+
isDetailSignal: false,
|
|
675
|
+
isTemplateLiteral: true,
|
|
676
|
+
parameterTypes: ["GObject.ParamSpec"],
|
|
677
|
+
returnType: "void",
|
|
678
|
+
});
|
|
679
|
+
}
|
|
666
680
|
}
|
|
667
681
|
|
|
668
682
|
private addDetailedSignals(allSignals: SignalDescriptor[]): void {
|
|
@@ -670,6 +684,9 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
670
684
|
|
|
671
685
|
this.signals.forEach((signal) => {
|
|
672
686
|
if (signal.detailed) {
|
|
687
|
+
// Skip "notify" signal — already handled by addNotifySignals
|
|
688
|
+
if (signal.name === "notify") return;
|
|
689
|
+
|
|
673
690
|
propertyNames.forEach((propertyName) => {
|
|
674
691
|
allSignals.push({
|
|
675
692
|
name: `${signal.name}::${propertyName}`,
|
|
@@ -680,6 +697,17 @@ export class IntrospectedClass extends IntrospectedBaseClass {
|
|
|
680
697
|
returnType: this.getPropertyTypeString(signal.return_type),
|
|
681
698
|
});
|
|
682
699
|
});
|
|
700
|
+
|
|
701
|
+
// Add template literal catch-all for arbitrary detail strings
|
|
702
|
+
allSignals.push({
|
|
703
|
+
name: `${signal.name}::\${string}`,
|
|
704
|
+
signal: signal,
|
|
705
|
+
isNotifySignal: false,
|
|
706
|
+
isDetailSignal: true,
|
|
707
|
+
isTemplateLiteral: true,
|
|
708
|
+
parameterTypes: signal.parameters.map((p) => this.getPropertyTypeString(p.type)),
|
|
709
|
+
returnType: this.getPropertyTypeString(signal.return_type),
|
|
710
|
+
});
|
|
683
711
|
}
|
|
684
712
|
});
|
|
685
713
|
}
|
|
@@ -292,7 +292,7 @@ See https://gjs.guide/guides/gobject/basics.html#properties for more details.`;
|
|
|
292
292
|
const override = new IntrospectedClassFunction({
|
|
293
293
|
parent: ParamSpec,
|
|
294
294
|
name: "override",
|
|
295
|
-
return_type:
|
|
295
|
+
return_type: ParamSpec.getType(),
|
|
296
296
|
parameters: [
|
|
297
297
|
new IntrospectedFunctionParameter({
|
|
298
298
|
direction: GirDirection.In,
|