@ts-for-gir/templates 4.0.0-beta.43 → 4.0.0-rc.1

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/templates",
3
- "version": "4.0.0-beta.43",
3
+ "version": "4.0.0-rc.1",
4
4
  "description": "Templates for ts-for-gir",
5
5
  "type": "module",
6
6
  "main": "package.json",
@@ -12,13 +12,17 @@ export type GType<T = unknown> = {
12
12
  name: string
13
13
  }
14
14
 
15
+ // Accepts either a raw GType or a class constructor with $gtype property.
16
+ // Used in input positions where GJS automatically extracts $gtype from class constructors.
17
+ export type GTypeInput<T = unknown> = GType<T> | { $gtype: GType<T> }
18
+
15
19
  // Extra interfaces used to help define GObject classes in js; these
16
20
  // aren't part of gi.
17
21
  export interface SignalDefinition {
18
22
  flags?: SignalFlags
19
23
  accumulator: number
20
- return_type?: GType
21
- param_types?: GType[]
24
+ return_type?: GTypeInput
25
+ param_types?: GTypeInput[]
22
26
  }
23
27
 
24
28
  export interface MetaInfo<Props, Interfaces, Sigs> {
@@ -104,7 +108,7 @@ export type RegisteredClass<
104
108
  : never
105
109
 
106
110
  export type SignalDefinitionType = {
107
- param_types?: readonly GType[]
111
+ param_types?: readonly GTypeInput[]
108
112
  [key: string]: any
109
113
  }
110
114
  <% } %>
@@ -326,7 +330,7 @@ export function registerClass<
326
330
  Interfaces extends { $gtype: GType }[],
327
331
  Sigs extends {
328
332
  [key: string]: {
329
- param_types?: readonly GType[]
333
+ param_types?: readonly GTypeInput[]
330
334
  [key: string]: any
331
335
  }
332
336
  },
@@ -345,7 +349,7 @@ export function registerClass<
345
349
  Interfaces extends { $gtype: GType }[],
346
350
  Sigs extends {
347
351
  [key: string]: {
348
- param_types?: readonly GType[]
352
+ param_types?: readonly GTypeInput[]
349
353
  [key: string]: any
350
354
  }
351
355
  },