@ts-for-gir/lib 4.0.0-beta.36 → 4.0.0-beta.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +5 -5
  2. package/src/generics/clutter.ts +9 -0
  3. package/src/generics/generify.ts +30 -3
  4. package/src/generics/meta.ts +9 -0
  5. package/src/generics/st.ts +9 -0
  6. package/src/injections/inject.ts +6 -1
  7. package/src/injections/shell.ts +6 -2
  8. package/src/types/answer-version.ts +2 -2
  9. package/src/types/any-introspected-type.ts +3 -1
  10. package/src/types/class-function-types.ts +41 -33
  11. package/src/types/class-parent.ts +11 -11
  12. package/src/types/class.ts +26 -28
  13. package/src/types/config-flags.ts +2 -2
  14. package/src/types/construct-name.ts +12 -12
  15. package/src/types/dependency-map.ts +2 -2
  16. package/src/types/dependency.ts +45 -45
  17. package/src/types/file-info.ts +12 -12
  18. package/src/types/format.ts +1 -1
  19. package/src/types/generator-constructor.ts +4 -4
  20. package/src/types/generics-config.ts +1 -1
  21. package/src/types/gir-any-element.ts +33 -33
  22. package/src/types/gir-module-interface.ts +5 -5
  23. package/src/types/gir-module-resolved.ts +1 -1
  24. package/src/types/gir-type-name.ts +17 -17
  25. package/src/types/index.ts +88 -90
  26. package/src/types/inheritance-table.ts +1 -1
  27. package/src/types/introspected.ts +8 -8
  28. package/src/types/local-name-check.ts +2 -2
  29. package/src/types/local-name-type.ts +1 -1
  30. package/src/types/local-name.ts +5 -5
  31. package/src/types/local-names.ts +2 -2
  32. package/src/types/metadata.ts +4 -4
  33. package/src/types/ns-loader.ts +2 -3
  34. package/src/types/options-base.ts +6 -6
  35. package/src/types/options-generation.ts +47 -47
  36. package/src/types/options-load.ts +3 -3
  37. package/src/types/options-transform.ts +2 -2
  38. package/src/types/output-format.ts +1 -1
  39. package/src/types/package-data-parsed.ts +26 -26
  40. package/src/types/package-data.ts +21 -21
  41. package/src/types/package-section-parsed.ts +6 -6
  42. package/src/types/parsed-gir.ts +2 -2
  43. package/src/types/parsed-package-data.ts +4 -4
  44. package/src/types/property-case.ts +1 -1
  45. package/src/types/resolve-type.ts +2 -2
  46. package/src/types/template-data.ts +5 -5
  47. package/src/types/template-options.ts +1 -1
  48. package/src/types/transformation-case.ts +8 -8
  49. package/src/types/transformations.ts +2 -2
  50. package/src/types/ts-doc-tag.ts +12 -12
  51. package/src/types/ts-doc.ts +9 -9
  52. package/src/types/type-gir-alias.ts +1 -1
  53. package/src/types/type-gir-class.ts +1 -1
  54. package/src/types/type-gir-element.ts +21 -21
  55. package/src/types/type-gir-enumeration-member.ts +1 -1
  56. package/src/types/type-gir-enumeration.ts +1 -1
  57. package/src/types/type-gir-function.ts +7 -7
  58. package/src/types/type-gir-interface.ts +1 -1
  59. package/src/types/type-gir-method.ts +1 -1
  60. package/src/types/type-gir-parameter.ts +1 -1
  61. package/src/types/type-gir-property.ts +1 -1
  62. package/src/types/type-gir-variable.ts +1 -1
  63. package/src/types/type-ts-element.ts +10 -10
  64. package/src/types/type-ts-enumeration-member.ts +1 -1
  65. package/src/types/type-ts-function.ts +1 -1
  66. package/src/types/type-ts-property.ts +1 -1
  67. package/src/types/user-config-load-result.ts +4 -4
  68. package/src/types/user-config.ts +53 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-for-gir/lib",
3
- "version": "4.0.0-beta.36",
3
+ "version": "4.0.0-beta.38",
4
4
  "description": "Typescript .d.ts generator from GIR for gjs",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -43,14 +43,14 @@
43
43
  "devDependencies": {
44
44
  "@types/ejs": "^3.1.5",
45
45
  "@types/lodash": "^4.17.20",
46
- "@types/node": "^24.2.1",
46
+ "@types/node": "^24.5.2",
47
47
  "rimraf": "^6.0.1",
48
48
  "typescript": "^5.9.2"
49
49
  },
50
50
  "dependencies": {
51
- "@gi.ts/parser": "^4.0.0-beta.36",
52
- "@ts-for-gir/reporter": "^4.0.0-beta.36",
53
- "@ts-for-gir/templates": "^4.0.0-beta.36",
51
+ "@gi.ts/parser": "^4.0.0-beta.38",
52
+ "@ts-for-gir/reporter": "^4.0.0-beta.38",
53
+ "@ts-for-gir/templates": "^4.0.0-beta.38",
54
54
  "colorette": "^2.0.20",
55
55
  "ejs": "^3.1.10",
56
56
  "glob": "^11.0.3",
@@ -66,6 +66,15 @@ export const clutter10 = createClutterTemplate("10");
66
66
  export const clutter11 = createClutterTemplate("11");
67
67
  export const clutter12 = createClutterTemplate("12");
68
68
  export const clutter13 = createClutterTemplate("13");
69
+ /** Clutter-14 was introduced with GNOME 45 */
69
70
  export const clutter14 = createClutterTemplate("14");
71
+ /** Clutter-15 was introduced with GNOME 47 */
70
72
  export const clutter15 = createClutterTemplate("15");
73
+ /** Clutter-16 was introduced with GNOME 48 */
71
74
  export const clutter16 = createClutterTemplate("16");
75
+ /** Clutter-17 was introduced with GNOME 49 */
76
+ export const clutter17 = createClutterTemplate("17");
77
+ // Possibly future versions, adjust if necessary
78
+ export const clutter18 = createClutterTemplate("18");
79
+ export const clutter19 = createClutterTemplate("19");
80
+ export const clutter20 = createClutterTemplate("20");
@@ -1,11 +1,23 @@
1
1
  import type { NSRegistry } from "../gir/registry.ts";
2
2
  import type { NamespaceDefinition } from "../types/generics-config.ts";
3
- import { clutter10, clutter11, clutter12, clutter13, clutter14, clutter15 } from "./clutter.ts";
3
+ import {
4
+ clutter10,
5
+ clutter11,
6
+ clutter12,
7
+ clutter13,
8
+ clutter14,
9
+ clutter15,
10
+ clutter16,
11
+ clutter17,
12
+ clutter18,
13
+ clutter19,
14
+ clutter20,
15
+ } from "./clutter.ts";
4
16
  import gio from "./gio.ts";
5
17
  import glib from "./glib.ts";
6
18
  import gtk from "./gtk.ts";
7
- import { meta10, meta11, meta12, meta13, meta14, meta15 } from "./meta.ts";
8
- import { st1, st12, st13, st14, st15 } from "./st.ts";
19
+ import { meta10, meta11, meta12, meta13, meta14, meta15, meta16, meta17, meta18, meta19, meta20 } from "./meta.ts";
20
+ import { st1, st12, st13, st14, st15, st16, st17, st18, st19, st20 } from "./st.ts";
9
21
  import { GenericVisitor } from "./visitor.ts";
10
22
 
11
23
  // Core namespace definitions that are required
@@ -20,17 +32,32 @@ const OPTIONAL_DEFINITIONS: NamespaceDefinition[] = [
20
32
  clutter13,
21
33
  clutter14,
22
34
  clutter15,
35
+ clutter16,
36
+ clutter17,
37
+ clutter18,
38
+ clutter19,
39
+ clutter20,
23
40
  st1,
24
41
  st12,
25
42
  st13,
26
43
  st14,
27
44
  st15,
45
+ st16,
46
+ st17,
47
+ st18,
48
+ st19,
49
+ st20,
28
50
  meta10,
29
51
  meta11,
30
52
  meta12,
31
53
  meta13,
32
54
  meta14,
33
55
  meta15,
56
+ meta16,
57
+ meta17,
58
+ meta18,
59
+ meta19,
60
+ meta20,
34
61
  ];
35
62
 
36
63
  function createDefinitionProcessor(registry: NSRegistry, inferGenerics: boolean, required: boolean = true) {
@@ -36,6 +36,15 @@ export const meta10 = createMetaTemplate("10");
36
36
  export const meta11 = createMetaTemplate("11");
37
37
  export const meta12 = createMetaTemplate("12");
38
38
  export const meta13 = createMetaTemplate("13");
39
+ /** Meta-14 was introduced with GNOME 45 */
39
40
  export const meta14 = createMetaTemplate("14");
41
+ /** Meta-15 was introduced with GNOME 47 */
40
42
  export const meta15 = createMetaTemplate("15");
43
+ /** Meta-16 was introduced with GNOME 48 */
41
44
  export const meta16 = createMetaTemplate("16");
45
+ /** Meta-17 was introduced with GNOME 49 */
46
+ export const meta17 = createMetaTemplate("17");
47
+ // Possibly future versions, adjust if necessary
48
+ export const meta18 = createMetaTemplate("18");
49
+ export const meta19 = createMetaTemplate("19");
50
+ export const meta20 = createMetaTemplate("20");
@@ -192,6 +192,15 @@ function updatePropertyType(
192
192
  export const st1 = createStTemplate("1.0");
193
193
  export const st12 = createStTemplate("12");
194
194
  export const st13 = createStTemplate("13");
195
+ /** St-14 was introduced with GNOME 45 */
195
196
  export const st14 = createStTemplate("14");
197
+ /** St-15 was introduced with GNOME 47 */
196
198
  export const st15 = createStTemplate("15");
199
+ /** St-16 was introduced with GNOME 48 */
197
200
  export const st16 = createStTemplate("16");
201
+ /** St-17 was introduced with GNOME 49 */
202
+ export const st17 = createStTemplate("17");
203
+ // Possibly future versions, adjust if necessary
204
+ export const st18 = createStTemplate("18");
205
+ export const st19 = createStTemplate("19");
206
+ export const st20 = createStTemplate("20");
@@ -6,7 +6,7 @@ import gio from "./gio.ts";
6
6
  import glib from "./glib.ts";
7
7
  import gobject from "./gobject.ts";
8
8
  import gtk4 from "./gtk4.ts";
9
- import { shell14, shell15 } from "./shell.ts";
9
+ import { shell14, shell15, shell16, shell17, shell18, shell19, shell20 } from "./shell.ts";
10
10
  import tracker1 from "./tracker1.ts";
11
11
 
12
12
  export type NamespaceInjection = (namespace: IntrospectedNamespace, registry: NSRegistry) => void;
@@ -41,4 +41,9 @@ export function inject(registry: NSRegistry) {
41
41
  $_(gtk4);
42
42
  $_(shell14);
43
43
  $_(shell15);
44
+ $_(shell16);
45
+ $_(shell17);
46
+ $_(shell18);
47
+ $_(shell19);
48
+ $_(shell20);
44
49
  }
@@ -37,9 +37,13 @@ const shellTemplate = (version: string) => ({
37
37
 
38
38
  /** Shell 14 was introduced with GNOME 45 */
39
39
  export const shell14 = shellTemplate("14");
40
-
41
40
  /** Shell 15 was introduced with GNOME 47 */
42
41
  export const shell15 = shellTemplate("15");
43
-
44
42
  /** Shell 16 was introduced with GNOME 48 */
45
43
  export const shell16 = shellTemplate("16");
44
+ /** Shell 17 was introduced with GNOME 49 */
45
+ export const shell17 = shellTemplate("17");
46
+ // Possibly future versions, adjust if necessary
47
+ export const shell18 = shellTemplate("18");
48
+ export const shell19 = shellTemplate("19");
49
+ export const shell20 = shellTemplate("20");
@@ -1,4 +1,4 @@
1
1
  export interface AnswerVersion {
2
- selected: string[]
3
- unselected: string[]
2
+ selected: string[];
3
+ unselected: string[];
4
4
  }
@@ -1,3 +1,5 @@
1
1
  import type { IntrospectedBase } from "../gir/introspected-base.ts";
2
+ import type { IntrospectedNamespace } from "../gir/namespace.ts";
2
3
 
3
- export type AnyIntrospectedType = IntrospectedBase<any>;
4
+ // Recursive type representing any IntrospectedBase with a valid parent constraint
5
+ export type AnyIntrospectedType = IntrospectedBase<IntrospectedNamespace | AnyIntrospectedType | null>;
@@ -1,49 +1,57 @@
1
- import type { TypeExpression, Generic } from "../gir.ts";
1
+ import type { IntrospectedEnum } from "../gir/enum.ts";
2
+ import type { IntrospectedBaseClass, IntrospectedClassFunction } from "../gir/introspected-classes.ts";
2
3
  import type { IntrospectedFunctionParameter } from "../gir/parameter.ts";
4
+ import type { Generic, TypeExpression } from "../gir.ts";
3
5
  import type { GirVisitor } from "../visitor.ts";
4
6
 
5
7
  export interface ClassFunctionCopyOptions<Parent> {
6
- parent?: Parent;
7
- name?: string;
8
- interfaceParent?: any; // Using any to avoid circular deps
9
- parameters?: IntrospectedFunctionParameter[];
10
- outputParameters?: IntrospectedFunctionParameter[];
11
- returnType?: TypeExpression;
8
+ parent?: Parent;
9
+ name?: string;
10
+ interfaceParent?: IntrospectedBaseClass | IntrospectedEnum; // avoid circular deps by importing types only
11
+ parameters?: IntrospectedFunctionParameter[];
12
+ outputParameters?: IntrospectedFunctionParameter[];
13
+ returnType?: TypeExpression;
12
14
  }
13
15
 
14
16
  export interface ClassFunctionOptions<Parent> {
15
- name: string;
16
- parameters?: IntrospectedFunctionParameter[];
17
- output_parameters?: IntrospectedFunctionParameter[];
18
- return_type?: TypeExpression;
19
- parent: Parent;
20
- originalParent?: Parent | null;
21
- doc?: string | null;
17
+ name: string;
18
+ parameters?: IntrospectedFunctionParameter[];
19
+ output_parameters?: IntrospectedFunctionParameter[];
20
+ return_type?: TypeExpression;
21
+ parent: Parent;
22
+ originalParent?: Parent | null;
23
+ doc?: string | null;
22
24
  }
23
25
 
24
26
  // Type discriminators for function types
25
27
  export const FunctionTypeKind = {
26
- CLASS_FUNCTION: 'CLASS_FUNCTION',
27
- VIRTUAL_CLASS_FUNCTION: 'VIRTUAL_CLASS_FUNCTION',
28
- STATIC_CLASS_FUNCTION: 'STATIC_CLASS_FUNCTION',
29
- CONSTRUCTOR: 'CONSTRUCTOR'
28
+ CLASS_FUNCTION: "CLASS_FUNCTION",
29
+ VIRTUAL_CLASS_FUNCTION: "VIRTUAL_CLASS_FUNCTION",
30
+ STATIC_CLASS_FUNCTION: "STATIC_CLASS_FUNCTION",
31
+ CONSTRUCTOR: "CONSTRUCTOR",
30
32
  } as const;
31
33
 
32
- export type FunctionTypeKind = typeof FunctionTypeKind[keyof typeof FunctionTypeKind];
34
+ export type FunctionTypeKind = (typeof FunctionTypeKind)[keyof typeof FunctionTypeKind];
33
35
 
34
36
  // Base interface for all class functions to enable type checking
35
37
  export interface ClassFunctionLike {
36
- readonly __functionTypeKind: FunctionTypeKind;
37
- readonly parameters: IntrospectedFunctionParameter[];
38
- readonly output_parameters: IntrospectedFunctionParameter[];
39
- readonly generics: Generic[];
40
- returnTypeDoc?: string | null;
41
- interfaceParent?: any;
42
-
43
- anyify(): any;
44
- shouldAnyify(): boolean;
45
- return(): TypeExpression;
46
- getCallbackParameters(): any;
47
- copy(options?: any): any;
48
- accept(visitor: GirVisitor): any;
49
- }
38
+ readonly __functionTypeKind: FunctionTypeKind;
39
+ readonly parameters: IntrospectedFunctionParameter[];
40
+ readonly output_parameters: IntrospectedFunctionParameter[];
41
+ readonly generics: Generic[];
42
+ returnTypeDoc?: string | null;
43
+ interfaceParent?: IntrospectedBaseClass | IntrospectedEnum | null;
44
+
45
+ anyify(): IntrospectedClassFunction;
46
+ shouldAnyify(): boolean;
47
+ return(): TypeExpression;
48
+ getCallbackParameters(): {
49
+ name: string;
50
+ parent: IntrospectedBaseClass | IntrospectedEnum;
51
+ output_parameters: IntrospectedFunctionParameter[];
52
+ parameters: IntrospectedFunctionParameter[];
53
+ return_type: TypeExpression;
54
+ };
55
+ copy(options?: ClassFunctionCopyOptions<IntrospectedBaseClass | IntrospectedEnum>): IntrospectedClassFunction;
56
+ accept(visitor: GirVisitor): IntrospectedClassFunction;
57
+ }
@@ -1,14 +1,14 @@
1
- import type { GirClassElement, GirUnionElement, GirInterfaceElement, GirRecordElement, TypeGirClass } from './index.ts'
1
+ import type { GirClassElement, GirInterfaceElement, GirRecordElement, GirUnionElement, TypeGirClass } from "./index.ts";
2
2
 
3
3
  export interface ClassParent {
4
- parentName: string
5
- qualifiedParentName: string
6
- /** qualified if its module != qualifiedName's module */
7
- localParentName: string
8
- type: 'parent' | 'prerequisite' | 'implements'
9
- /** Parent class / interface */
10
- cls?: GirClassElement | GirUnionElement | GirInterfaceElement | GirRecordElement
11
- girTypeName: TypeGirClass
12
- /** True if the parent dependency exists */
13
- dependencyExists: boolean
4
+ parentName: string;
5
+ qualifiedParentName: string;
6
+ /** qualified if its module != qualifiedName's module */
7
+ localParentName: string;
8
+ type: "parent" | "prerequisite" | "implements";
9
+ /** Parent class / interface */
10
+ cls?: GirClassElement | GirUnionElement | GirInterfaceElement | GirRecordElement;
11
+ girTypeName: TypeGirClass;
12
+ /** True if the parent dependency exists */
13
+ dependencyExists: boolean;
14
14
  }
@@ -1,45 +1,43 @@
1
+ import type { IntrospectedConstructor } from "../gir/constructor.ts";
1
2
  import type {
2
- TypeIdentifier,
3
- } from "../gir.ts";
4
- import type {
5
- IntrospectedClassFunction,
3
+ IntrospectedBaseClass,
4
+ IntrospectedClass,
5
+ IntrospectedClassCallback,
6
+ IntrospectedClassFunction,
7
+ IntrospectedInterface,
6
8
  } from "../gir/introspected-classes.ts";
7
- import type { IntrospectedConstructor } from "../gir/constructor.ts";
8
- import type { IntrospectedClassCallback } from "../gir/introspected-classes.ts";
9
- import type { IntrospectedProperty, IntrospectedField } from "../gir/property.ts";
10
- import type { IntrospectedBaseClass } from "../gir/introspected-classes.ts";
11
- import type { IntrospectedInterface } from "../gir/introspected-classes.ts";
12
- import type { IntrospectedClass } from "../gir/introspected-classes.ts";
9
+ import type { IntrospectedField, IntrospectedProperty } from "../gir/property.ts";
13
10
  import type { IntrospectedRecord } from "../gir/record.ts";
11
+ import type { TypeIdentifier } from "../gir.ts";
14
12
 
15
13
  export interface ClassDefinition {
16
- superType: TypeIdentifier;
17
- interfaces: TypeIdentifier[];
18
- mainConstructor: IntrospectedConstructor;
19
- constructors: IntrospectedConstructor[];
20
- members: IntrospectedClassFunction[];
21
- props: IntrospectedProperty[];
22
- fields: IntrospectedField[];
23
- callbacks: IntrospectedClassCallback[];
14
+ superType: TypeIdentifier;
15
+ interfaces: TypeIdentifier[];
16
+ mainConstructor: IntrospectedConstructor;
17
+ constructors: IntrospectedConstructor[];
18
+ members: IntrospectedClassFunction[];
19
+ props: IntrospectedProperty[];
20
+ fields: IntrospectedField[];
21
+ callbacks: IntrospectedClassCallback[];
24
22
  }
25
23
 
26
24
  export interface ResolutionNode {
27
- identifier: TypeIdentifier;
28
- node: IntrospectedBaseClass;
25
+ identifier: TypeIdentifier;
26
+ node: IntrospectedBaseClass;
29
27
  }
30
28
 
31
29
  export interface InterfaceResolution extends ResolutionNode, Iterable<InterfaceResolution | ClassResolution> {
32
- extends(): InterfaceResolution | ClassResolution | undefined;
33
- node: IntrospectedInterface;
30
+ extends(): InterfaceResolution | ClassResolution | undefined;
31
+ node: IntrospectedInterface;
34
32
  }
35
33
 
36
34
  export interface ClassResolution extends ResolutionNode, Iterable<ClassResolution> {
37
- extends(): ClassResolution | undefined;
38
- implements(): InterfaceResolution[];
39
- node: IntrospectedClass;
35
+ extends(): ClassResolution | undefined;
36
+ implements(): InterfaceResolution[];
37
+ node: IntrospectedClass;
40
38
  }
41
39
 
42
40
  export interface RecordResolution extends ResolutionNode, Iterable<RecordResolution> {
43
- extends(): RecordResolution | undefined;
44
- node: IntrospectedRecord;
45
- }
41
+ extends(): RecordResolution | undefined;
42
+ node: IntrospectedRecord;
43
+ }
@@ -1,5 +1,5 @@
1
- import type { UserConfig } from './user-config.ts'
1
+ import type { UserConfig } from "./user-config.ts";
2
2
 
3
3
  export interface ConfigFlags extends UserConfig {
4
- configName: string
4
+ configName: string;
5
5
  }
@@ -1,13 +1,13 @@
1
1
  export type ConstructName =
2
- | 'functionName'
3
- | 'enumMember'
4
- | 'signalName'
5
- | 'fieldName'
6
- | 'constantName'
7
- | 'constructorPropertyName'
8
- | 'propertyName'
9
- | 'parameterName'
10
- | 'enumName'
11
- | 'importNamespaceName'
12
- | 'signalInterfaceName'
13
- | 'importName'
2
+ | "functionName"
3
+ | "enumMember"
4
+ | "signalName"
5
+ | "fieldName"
6
+ | "constantName"
7
+ | "constructorPropertyName"
8
+ | "propertyName"
9
+ | "parameterName"
10
+ | "enumName"
11
+ | "importNamespaceName"
12
+ | "signalInterfaceName"
13
+ | "importName";
@@ -1,4 +1,4 @@
1
- import type { Dependency } from './dependency.ts'
1
+ import type { Dependency } from "./dependency.ts";
2
2
  export interface DependencyMap {
3
- [packageName: string]: Dependency[]
3
+ [packageName: string]: Dependency[];
4
4
  }
@@ -1,49 +1,49 @@
1
- import type { FileInfo } from './index.ts'
2
- import type { LibraryVersion } from '../library-version.ts'
3
- import type { GirXML } from '@gi.ts/parser'
1
+ import type { GirXML } from "@gi.ts/parser";
2
+ import type { LibraryVersion } from "../library-version.ts";
3
+ import type { FileInfo } from "./index.ts";
4
4
 
5
5
  export interface Dependency extends FileInfo {
6
- /**
7
- * E.g. 'Gtk'
8
- */
9
- namespace: string
10
- /**
11
- * E.g. 'Gtk40'
12
- * Is used in the generated index.d.ts, for example: `import * as Gtk40 from "./Gtk-4.0.ts";`
13
- */
14
- importNamespace: string
15
- /**
16
- * E.g. '4.0'
17
- */
18
- version: string
19
- /**
20
- * E.g. '4.14.0'
21
- */
22
- libraryVersion: LibraryVersion
23
- /**
24
- * E.g. 'Gtk-4.0'
25
- */
26
- packageName: string
27
- /**
28
- * The NPM package name
29
- * E.g. 'gtk-4.0'
30
- */
31
- importName: string
32
- /**
33
- * Import path for the package
34
- * E.g. './Gtk-4.0.ts' or '@girs/Gtk-4.0'
35
- */
36
- importPath: string
37
- /**
38
- * Import definition for the package
39
- * E.g. `import type Gtk from '@girs/Gtk-3.0'`
40
- */
41
- importDef: string
42
- /**
43
- * Complete dependency string for package.json
44
- * E.g. `"@girs/gtk-4.0": "workspace:^"`
45
- */
46
- packageJsonImport: string
6
+ /**
7
+ * E.g. 'Gtk'
8
+ */
9
+ namespace: string;
10
+ /**
11
+ * E.g. 'Gtk40'
12
+ * Is used in the generated index.d.ts, for example: `import * as Gtk40 from "./Gtk-4.0.ts";`
13
+ */
14
+ importNamespace: string;
15
+ /**
16
+ * E.g. '4.0'
17
+ */
18
+ version: string;
19
+ /**
20
+ * E.g. '4.14.0'
21
+ */
22
+ libraryVersion: LibraryVersion;
23
+ /**
24
+ * E.g. 'Gtk-4.0'
25
+ */
26
+ packageName: string;
27
+ /**
28
+ * The NPM package name
29
+ * E.g. 'gtk-4.0'
30
+ */
31
+ importName: string;
32
+ /**
33
+ * Import path for the package
34
+ * E.g. './Gtk-4.0.ts' or '@girs/Gtk-4.0'
35
+ */
36
+ importPath: string;
37
+ /**
38
+ * Import definition for the package
39
+ * E.g. `import type Gtk from '@girs/Gtk-3.0'`
40
+ */
41
+ importDef: string;
42
+ /**
43
+ * Complete dependency string for package.json
44
+ * E.g. `"@girs/gtk-4.0": "workspace:^"`
45
+ */
46
+ packageJsonImport: string;
47
47
 
48
- girXML: GirXML | null
48
+ girXML: GirXML | null;
49
49
  }
@@ -1,14 +1,14 @@
1
1
  export interface FileInfo {
2
- /**
3
- * The path to the gir file or null if the file does not exist
4
- */
5
- path: string | null
6
- /**
7
- * The filename of the gir file
8
- */
9
- filename: string
10
- /**
11
- * Whether the file exists or not
12
- */
13
- exists: boolean
2
+ /**
3
+ * The path to the gir file or null if the file does not exist
4
+ */
5
+ path: string | null;
6
+ /**
7
+ * The filename of the gir file
8
+ */
9
+ filename: string;
10
+ /**
11
+ * Whether the file exists or not
12
+ */
13
+ exists: boolean;
14
14
  }
@@ -1 +1 @@
1
- export type Format = 'dts' | 'json'
1
+ export type Format = "dts" | "json";
@@ -1,7 +1,7 @@
1
+ import type { FormatGenerator } from "../generators/generator.ts";
1
2
  import type { IntrospectedNamespace } from "../gir/namespace.ts";
2
3
  import type { OptionsGeneration } from "./options-generation.ts";
3
- import type { FormatGenerator } from "../generators/generator.ts";
4
4
 
5
- export type GeneratorConstructor<T> = {
6
- new (namespace: IntrospectedNamespace, options: OptionsGeneration, ...args: any[]): FormatGenerator<T>;
7
- };
5
+ export type GeneratorConstructor<T> = {
6
+ new (namespace: IntrospectedNamespace, options: OptionsGeneration, ...args: unknown[]): FormatGenerator<T>;
7
+ };
@@ -87,4 +87,4 @@ export interface GlibConfig {
87
87
  version: string;
88
88
  /** The modifier function to apply GLib-specific generics */
89
89
  modifier: (namespace: IntrospectedNamespace) => void;
90
- }
90
+ }
@@ -1,35 +1,35 @@
1
1
  import type {
2
- GirBitfieldElement,
3
- GirCallbackElement,
4
- GirClassElement,
5
- GirConstantElement,
6
- GirEnumElement,
7
- GirFunctionElement,
8
- GirInterfaceElement,
9
- GirRecordElement,
10
- GirUnionElement,
11
- GirAliasElement,
12
- GirMethodElement,
13
- GirVirtualMethodElement,
14
- GirSignalElement,
15
- GirConstructorElement,
16
- GirFieldElement,
17
- GirPropertyElement,
18
- } from './index.ts'
2
+ GirAliasElement,
3
+ GirBitfieldElement,
4
+ GirCallbackElement,
5
+ GirClassElement,
6
+ GirConstantElement,
7
+ GirConstructorElement,
8
+ GirEnumElement,
9
+ GirFieldElement,
10
+ GirFunctionElement,
11
+ GirInterfaceElement,
12
+ GirMethodElement,
13
+ GirPropertyElement,
14
+ GirRecordElement,
15
+ GirSignalElement,
16
+ GirUnionElement,
17
+ GirVirtualMethodElement,
18
+ } from "./index.ts";
19
19
  export type GirAnyElement =
20
- | GirBitfieldElement
21
- | GirCallbackElement
22
- | GirClassElement
23
- | GirConstantElement
24
- | GirEnumElement
25
- | GirFunctionElement
26
- | GirInterfaceElement
27
- | GirRecordElement
28
- | GirUnionElement
29
- | GirAliasElement
30
- | GirMethodElement
31
- | GirVirtualMethodElement
32
- | GirSignalElement
33
- | GirConstructorElement
34
- | GirFieldElement
35
- | GirPropertyElement
20
+ | GirBitfieldElement
21
+ | GirCallbackElement
22
+ | GirClassElement
23
+ | GirConstantElement
24
+ | GirEnumElement
25
+ | GirFunctionElement
26
+ | GirInterfaceElement
27
+ | GirRecordElement
28
+ | GirUnionElement
29
+ | GirAliasElement
30
+ | GirMethodElement
31
+ | GirVirtualMethodElement
32
+ | GirSignalElement
33
+ | GirConstructorElement
34
+ | GirFieldElement
35
+ | GirPropertyElement;