@girs/sdk-gnome-50 5.4.1 → 5.5.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.
@@ -38,7 +38,10 @@ export interface SignalDefinition {
38
38
  flags?: SignalFlags
39
39
  accumulator: number
40
40
  return_type?: GTypeInput
41
- param_types?: GTypeInput[]
41
+ // `readonly` matches `SignalDefinitionType` below, and for the same reason: GJS reads the array
42
+ // length and its elements to build the C `GType` array (`JS::GetArrayLength` / `JS_GetElement`)
43
+ // and never writes to it.
44
+ param_types?: readonly GTypeInput[]
42
45
  }
43
46
 
44
47
  export interface MetaInfo<Props, Interfaces, Sigs> {
@@ -49,9 +52,16 @@ export interface MetaInfo<Props, Interfaces, Sigs> {
49
52
  Implements?: Interfaces
50
53
  CssName?: string
51
54
  Template?: Uint8Array | GLib.Bytes | string
52
- Children?: string[]
53
- InternalChildren?: string[]
54
- Requires?: Object[]
55
+ // `Children`, `InternalChildren`, `Requires` and `Implements` are `readonly` because GJS only
56
+ // ever READS them: `registerClass` stores the array on the class and later iterates it --
57
+ // `for (let child of children)`, `internalChildren.forEach(...)`, `requires.filter(...)` and
58
+ // `[...gobjectInterfaces].reverse()`, a copy. Nothing pushes, splices or sorts in place.
59
+ // A mutable type made a consumer's own `const` data reject its own value: a typed export from a
60
+ // `.blp` template, or any `as const` list, is a `readonly` tuple and produced TS4104 against a
61
+ // field the caller may not write to anyway.
62
+ Children?: readonly string[]
63
+ InternalChildren?: readonly string[]
64
+ Requires?: readonly Object[]
55
65
  }
56
66
 
57
67
  export type Property<K extends ParamSpec> = K extends ParamSpec<infer T> ? T : any
@@ -72,7 +82,11 @@ type SnakeToUnderscore<T> = { [P in keyof T as P extends string ? SnakeToUndersc
72
82
  // Advanced utility types for class registration
73
83
  type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never
74
84
 
75
- type IFaces<Interfaces extends { $gtype: GType<any> }[]> = {
85
+ // `readonly` on every `Interfaces` constraint below, for the same reason as `MetaInfo.Implements`:
86
+ // a caller passing `Implements: [Gio.ListModel] as const` infers a `readonly` tuple, which a
87
+ // mutable-array constraint rejects (TS4104) even though GJS never writes to the array. The
88
+ // constraints stay satisfied by an ordinary mutable array, so existing consumers are unaffected.
89
+ type IFaces<Interfaces extends readonly { $gtype: GType<any> }[]> = {
76
90
  [key in keyof Interfaces]: Interfaces[key] extends { $gtype: GType<infer I> } ? I : never
77
91
  }
78
92
 
@@ -90,7 +104,7 @@ export type Properties<
90
104
  export type RegisteredPrototype<
91
105
  P extends {},
92
106
  Props extends { [key: string]: ParamSpec },
93
- Interfaces extends any[],
107
+ Interfaces extends readonly any[],
94
108
  > = Properties<P, SnakeToUnderscore<Props>> & UnionToIntersection<Interfaces[number]> & P
95
109
 
96
110
  type Ctor = new (...a: any[]) => object
@@ -99,7 +113,7 @@ type Init = { _init(...args: any[]): void }
99
113
  export type RegisteredClass<
100
114
  T extends Ctor,
101
115
  Props extends { [key: string]: ParamSpec },
102
- Interfaces extends { $gtype: GType<any> }[],
116
+ Interfaces extends readonly { $gtype: GType<any> }[],
103
117
  > = T extends { prototype: infer P extends {} }
104
118
  ? {
105
119
  $gtype: GType<RegisteredClass<T, Props, IFaces<Interfaces>>>
@@ -363,7 +377,7 @@ export function registerClass<P extends {}, T extends new (...args: any[]) => P>
363
377
  export function registerClass<
364
378
  T extends Ctor,
365
379
  Props extends { [key: string]: ParamSpec },
366
- Interfaces extends { $gtype: GType }[],
380
+ Interfaces extends readonly { $gtype: GType }[],
367
381
  Sigs extends {
368
382
  [key: string]: {
369
383
  param_types?: readonly GTypeInput[]
@@ -175,7 +175,7 @@ export namespace JavaScriptCore {
175
175
  * Like `jsc_get_micro_version()`, but from the headers used at
176
176
  * application compile time, rather than from the library linked
177
177
  * against at application run time.
178
- * @default 0
178
+ * @default 1
179
179
  */
180
180
  const MICRO_VERSION: number;
181
181
 
@@ -175,7 +175,7 @@ export namespace JavaScriptCore {
175
175
  * Like `jsc_get_micro_version()`, but from the headers used at
176
176
  * application compile time, rather than from the library linked
177
177
  * against at application run time.
178
- * @default 0
178
+ * @default 1
179
179
  */
180
180
  const MICRO_VERSION: number;
181
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/sdk-gnome-50",
3
- "version": "5.4.1",
3
+ "version": "5.5.1",
4
4
  "description": "GJS TypeScript type definitions for -1 namespaces, generated as one self-contained package",
5
5
  "type": "module",
6
6
  "exports": {
@@ -2310,8 +2310,8 @@
2310
2310
  "gtksource-5": "5.20.0",
2311
2311
  "harfbuzz-0.0": "11.4.5",
2312
2312
  "ibus-1.0": "1.5.32",
2313
- "javascriptcore-4.1": "2.54.0",
2314
- "javascriptcore-6.0": "2.54.0",
2313
+ "javascriptcore-4.1": "2.54.1",
2314
+ "javascriptcore-6.0": "2.54.1",
2315
2315
  "json-1.0": "1.10.8",
2316
2316
  "manette-0.2": "0.2.13",
2317
2317
  "notify-0.7": "0.8.8",
@@ -2321,8 +2321,8 @@
2321
2321
  "soup-3.0": "3.6.6",
2322
2322
  "tracker-3.0": "3.11.1",
2323
2323
  "tsparql-3.0": "3.11.1",
2324
- "webkit-6.0": "2.54.0",
2325
- "webkit2-4.1": "2.54.0",
2324
+ "webkit-6.0": "2.54.1",
2325
+ "webkit2-4.1": "2.54.1",
2326
2326
  "xmlb-2.0": "0.3.26"
2327
2327
  },
2328
2328
  "keywords": [
@@ -2341,9 +2341,9 @@
2341
2341
  "sdk": {
2342
2342
  "id": "org.gnome.Sdk",
2343
2343
  "branch": "50",
2344
- "commit": "4b50cb5758124e3990c3051fd568d522473ae4126f38ca601863a32f043f6daf"
2344
+ "commit": "cf8dd293db7c6e239947615814883e3aaa11e0870a1cd479bdaefa072034e7e0"
2345
2345
  },
2346
- "generator": "5.4.0",
2346
+ "generator": "5.5.0",
2347
2347
  "repository": {
2348
2348
  "type": "git",
2349
2349
  "url": "git+https://github.com/gjsify/types.git"
@@ -1676,7 +1676,7 @@ export namespace WebKit {
1676
1676
  * Like `webkit_get_micro_version()`, but from the headers used at
1677
1677
  * application compile time, rather than from the library linked
1678
1678
  * against at application run time.
1679
- * @default 0
1679
+ * @default 1
1680
1680
  */
1681
1681
  const MICRO_VERSION: number;
1682
1682
 
@@ -1671,7 +1671,7 @@ export namespace WebKit2 {
1671
1671
  * Like `webkit_get_micro_version()`, but from the headers used at
1672
1672
  * application compile time, rather than from the library linked
1673
1673
  * against at application run time.
1674
- * @default 0
1674
+ * @default 1
1675
1675
  */
1676
1676
  const MICRO_VERSION: number;
1677
1677