@gtkx/runtime 1.6.0 → 2.0.0-beta.2

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 (120) hide show
  1. package/README.md +5 -5
  2. package/dist/application-class.d.ts +1 -1
  3. package/dist/application-class.d.ts.map +1 -1
  4. package/dist/application-class.js +1 -2
  5. package/dist/application-class.js.map +1 -1
  6. package/dist/arg.d.ts +4 -1
  7. package/dist/arg.d.ts.map +1 -1
  8. package/dist/arg.js.map +1 -1
  9. package/dist/bind.d.ts.map +1 -1
  10. package/dist/bind.js +1 -9
  11. package/dist/bind.js.map +1 -1
  12. package/dist/callback.d.ts +6 -1
  13. package/dist/callback.d.ts.map +1 -1
  14. package/dist/callback.js +33 -21
  15. package/dist/callback.js.map +1 -1
  16. package/dist/closure.d.ts +3 -1
  17. package/dist/closure.d.ts.map +1 -1
  18. package/dist/closure.js +17 -6
  19. package/dist/closure.js.map +1 -1
  20. package/dist/descriptors.d.ts +22 -51
  21. package/dist/descriptors.d.ts.map +1 -1
  22. package/dist/descriptors.js +53 -27
  23. package/dist/descriptors.js.map +1 -1
  24. package/dist/fn.d.ts.map +1 -1
  25. package/dist/fn.js +23 -9
  26. package/dist/fn.js.map +1 -1
  27. package/dist/folded-lengths.d.ts +2 -1
  28. package/dist/folded-lengths.d.ts.map +1 -1
  29. package/dist/folded-lengths.js +17 -7
  30. package/dist/folded-lengths.js.map +1 -1
  31. package/dist/index.d.ts +2 -24
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +2 -24
  34. package/dist/index.js.map +1 -1
  35. package/dist/internal.d.ts +18 -2
  36. package/dist/internal.d.ts.map +1 -1
  37. package/dist/internal.js +14 -2
  38. package/dist/internal.js.map +1 -1
  39. package/dist/listeners.d.ts +3 -13
  40. package/dist/listeners.d.ts.map +1 -1
  41. package/dist/listeners.js +12 -12
  42. package/dist/listeners.js.map +1 -1
  43. package/dist/mixin.d.ts +5 -3
  44. package/dist/mixin.d.ts.map +1 -1
  45. package/dist/mixin.js +36 -9
  46. package/dist/mixin.js.map +1 -1
  47. package/dist/native-value.d.ts +9 -1
  48. package/dist/native-value.d.ts.map +1 -1
  49. package/dist/native-value.js +20 -3
  50. package/dist/native-value.js.map +1 -1
  51. package/dist/object.d.ts +11 -0
  52. package/dist/object.d.ts.map +1 -1
  53. package/dist/object.js +18 -25
  54. package/dist/object.js.map +1 -1
  55. package/dist/properties.d.ts +5 -3
  56. package/dist/properties.d.ts.map +1 -1
  57. package/dist/properties.js +67 -23
  58. package/dist/properties.js.map +1 -1
  59. package/dist/property-brand.d.ts +5 -0
  60. package/dist/property-brand.d.ts.map +1 -0
  61. package/dist/property-brand.js +5 -0
  62. package/dist/property-brand.js.map +1 -0
  63. package/dist/register-class.d.ts +142 -264
  64. package/dist/register-class.d.ts.map +1 -1
  65. package/dist/register-class.js +19 -37
  66. package/dist/register-class.js.map +1 -1
  67. package/dist/registry.d.ts +1 -1
  68. package/dist/registry.d.ts.map +1 -1
  69. package/dist/registry.js +4 -4
  70. package/dist/registry.js.map +1 -1
  71. package/dist/signal-brand.d.ts +12 -0
  72. package/dist/signal-brand.d.ts.map +1 -0
  73. package/dist/signal-brand.js +6 -0
  74. package/dist/signal-brand.js.map +1 -0
  75. package/dist/signal.d.ts +39 -2
  76. package/dist/signal.d.ts.map +1 -1
  77. package/dist/signal.js +84 -27
  78. package/dist/signal.js.map +1 -1
  79. package/dist/t.d.ts +5 -21
  80. package/dist/t.d.ts.map +1 -1
  81. package/dist/t.js +1 -5
  82. package/dist/t.js.map +1 -1
  83. package/dist/type.d.ts.map +1 -1
  84. package/dist/type.js +8 -2
  85. package/dist/type.js.map +1 -1
  86. package/dist/value.d.ts.map +1 -1
  87. package/dist/value.js +7 -1
  88. package/dist/value.js.map +1 -1
  89. package/dist/variant.d.ts +2 -6
  90. package/dist/variant.d.ts.map +1 -1
  91. package/dist/variant.js.map +1 -1
  92. package/dist/vfunc-call.d.ts.map +1 -1
  93. package/dist/vfunc-call.js +2 -11
  94. package/dist/vfunc-call.js.map +1 -1
  95. package/package.json +9 -5
  96. package/src/application-class.ts +2 -2
  97. package/src/arg.ts +4 -1
  98. package/src/bind.ts +1 -12
  99. package/src/callback.ts +53 -29
  100. package/src/closure.ts +31 -6
  101. package/src/descriptors.ts +95 -59
  102. package/src/fn.ts +31 -10
  103. package/src/folded-lengths.ts +23 -10
  104. package/src/index.ts +2 -24
  105. package/src/internal.ts +43 -2
  106. package/src/listeners.ts +21 -26
  107. package/src/mixin.ts +55 -9
  108. package/src/native-value.ts +24 -3
  109. package/src/object.ts +55 -5
  110. package/src/properties.ts +90 -26
  111. package/src/property-brand.ts +5 -0
  112. package/src/register-class.ts +338 -341
  113. package/src/registry.ts +4 -4
  114. package/src/signal-brand.ts +29 -0
  115. package/src/signal.ts +185 -39
  116. package/src/t.ts +5 -21
  117. package/src/type.ts +10 -2
  118. package/src/value.ts +9 -1
  119. package/src/variant.ts +2 -6
  120. package/src/vfunc-call.ts +3 -16
@@ -1,310 +1,188 @@
1
1
  import { type AnyClass } from "@gtkx/utils";
2
2
  import { type PropertySpec } from "./properties.js";
3
+ import { descriptorFreePropertySpec, propertyMapOverride, writablePropertyMapOverride } from "./property-brand.js";
4
+ import { classSignalMember, naturalSignalMember, signalEmitMapOverride, signalMapOverride } from "./signal-brand.js";
3
5
  import { type TypedClass } from "./type.js";
4
- /**
5
- * A generated interface value, such as `Gio.ListModel`, in the form {@link registerClass} takes it.
6
- * `__impl__` exists only in the type system: it carries the interface's `Impl` type, of which a class
7
- * has to match every member it declares itself, which rejects a class value and a member whose
8
- * signature does not fit the slot it fills. Leaving a slot to the interface is not rejected,
9
- * because `registerClass` does not reject it either: every member of an `Impl` type is optional,
10
- * and the `Partial` holds that open whatever the type declares. The `object` beside it keeps
11
- * TypeScript from also demanding one member in common. An interface that introspection describes
12
- * no vtable for carries `unknown`, since it has no slot a class could fill.
13
- */
14
- type Interface<TImpl> = AnyClass & {
6
+ /** A generated interface value, such as `Gio.ListModel`, accepted by {@link registerClass}. */
7
+ type Interface<TImpl, TInstance = object> = AnyClass & {
15
8
  /** Type-level slot holding the interface's `Impl` type; no value ever carries it. */
16
- __impl__: (impl: Partial<TImpl> & object) => void;
9
+ __impl__: (impl: Partial<TImpl> & object) => TInstance;
17
10
  };
18
- /**
19
- * One key of `RegisterClassOptions.properties` with every underscore turned into the dash a canonical
20
- * GObject property name separates its words with.
21
- */
11
+ /** Converts underscores in a property name to canonical dashes. */
22
12
  type Dashed<TName extends string> = TName extends `${infer THead}_${infer TTail}` ? Dashed<`${THead}-${TTail}`> : TName;
23
- /**
24
- * One dashed key in the camelCase spelling the accessors {@link registerClass} installs carry, which is
25
- * the spelling the hooks that address a property by name take.
26
- */
13
+ /** Converts a dashed property name to its JavaScript spelling. */
27
14
  type Camelized<TName extends string> = TName extends `${infer THead}-${infer TTail}` ? `${THead}${Capitalize<Camelized<TTail>>}` : TName;
28
- /**
29
- * The names a registered class carries in its property map: every key of
30
- * `RegisterClassOptions.properties` in camelCase, whichever spelling it was written in.
31
- * A `properties` object given a type of its own rather than left to inference has `string` for its key
32
- * type and names nothing, because a name only known as `string` addresses no member in particular.
33
- */
15
+ /** Property-map keys in the camelCase spelling hooks use. */
34
16
  type InstalledNames<TProperties> = string extends keyof TProperties ? never : Camelized<Dashed<keyof TProperties & string>>;
35
- /**
36
- * The base names the signal surface takes for the signals `RegisterClassOptions.signals` declares:
37
- * each name as written, plus its canonical spelling with underscores turned into dashes, which
38
- * GObject knows the signal by too.
39
- */
17
+ /** Declared signal names in their original and canonical spellings. */
40
18
  type DeclaredSignalBase<TSignals> = (keyof TSignals & string) | Dashed<keyof TSignals & string>;
41
- /**
42
- * The names `connect` and `emit` take for one of the signals `RegisterClassOptions.signals`
43
- * declares: each spelling of each name, plus its detailed form for a signal emitted with a
44
- * `::detail` suffix.
45
- */
19
+ /** Declared signal names, including detailed forms. */
46
20
  type DeclaredSignalName<TSignals> = DeclaredSignalBase<TSignals> | `${DeclaredSignalBase<TSignals>}::${string}`;
47
- /**
48
- * The `connect` and `emit` signatures instances gain for the signals
49
- * `RegisterClassOptions.signals` declares, widening the inherited ones, which take only the names
50
- * introspection knows. A class declaring no signals gains nothing, since no name reaches the
51
- * added signatures.
52
- */
53
- type DeclaredSignalMethods<TSignals> = {
54
- /**
55
- * Type-level map from declared signal name to handler signature, feeding the hooks that
56
- * address a signal by name, such as `useSignal` from `@gtkx/react`; no value ever carries it.
57
- */
58
- __signals__?: Record<DeclaredSignalBase<TSignals>, (...args: never[]) => unknown>;
59
- /** Connects a handler to a signal `RegisterClassOptions.signals` declared. */
21
+ /** Signal methods added for declared names. */
22
+ type DeclaredSignalMethods<TSignals, TBlockedMembers extends PropertyKey> = {
23
+ /** Type-level map used by signal hooks. */
24
+ __signals__?: Record<DeclaredSignalName<TSignals>, (...args: never[]) => unknown>;
25
+ } & Pick<{
60
26
  connect(signal: DeclaredSignalName<TSignals>, handler: (...args: never[]) => unknown, isAfter?: boolean): number;
61
- /** Emits a signal `RegisterClassOptions.signals` declared. */
62
27
  emit(sigName: DeclaredSignalName<TSignals>, ...args: unknown[]): unknown;
63
- /** Connects a handler to a signal `RegisterClassOptions.signals` declared, for `off` to take off. */
64
- on(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
65
- /** Connects a handler to a signal `RegisterClassOptions.signals` declared for one emission. */
66
- once(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;
67
- /** Disconnects a handler `on` or `once` connected to a signal `RegisterClassOptions.signals` declared. */
68
- off(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown): unknown;
28
+ on(sigName: DeclaredSignalName<TSignals>, callback: (...args: never[]) => unknown, isAfter?: boolean): unknown;
29
+ once(sigName: DeclaredSignalName<TSignals>, callback: (...args: never[]) => unknown, isAfter?: boolean): unknown;
30
+ off(sigName: DeclaredSignalName<TSignals>, callback: (...args: never[]) => unknown): unknown;
31
+ }, Exclude<"connect" | "emit" | "off" | "on" | "once", TBlockedMembers>>;
32
+ /** A registered instance with declared signal methods and property metadata. */
33
+ type RegisteredInstance<TInstance, TProperties, TSignals, TInterfaces extends readonly Interface<TInstance>[], TRemainingInterfaces extends readonly Interface<TInstance>[] = TInterfaces, TMemberSurface = object, TSignalSurface = TInstance extends {
34
+ [signalMapOverride]?: infer TResolver;
35
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInstance extends {
36
+ __signals__?: infer TMap;
37
+ } ? NonNullable<TMap> : object : TInstance extends {
38
+ __signals__?: infer TMap;
39
+ } ? NonNullable<TMap> : object, TSignalEmitSurface = TInstance extends {
40
+ [signalEmitMapOverride]?: infer TResolver;
41
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInstance extends {
42
+ __signalEmit__?: infer TMap;
43
+ } ? NonNullable<TMap> : object : TInstance extends {
44
+ __signalEmit__?: infer TMap;
45
+ } ? NonNullable<TMap> : object, TPropertySurface = TInstance extends {
46
+ [propertyMapOverride]?: infer TResolver;
47
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInstance extends {
48
+ __properties__?: infer TMap;
49
+ } ? NonNullable<TMap> : object : TInstance extends {
50
+ __properties__?: infer TMap;
51
+ } ? NonNullable<TMap> : object, TWritablePropertySurface = TInstance extends {
52
+ [writablePropertyMapOverride]?: infer TResolver;
53
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInstance extends {
54
+ __writableProperties__?: infer TMap;
55
+ } ? NonNullable<TMap> : object : TInstance extends {
56
+ __writableProperties__?: infer TMap;
57
+ } ? NonNullable<TMap> : object, TNaturalInstanceMembers extends PropertyKey = TInstance extends {
58
+ [naturalSignalMember]?: infer TMembers;
59
+ } ? keyof NonNullable<TMembers> : never, TClassInstanceSignals extends PropertyKey = TInstance extends {
60
+ [classSignalMember]?: infer TMembers;
61
+ } ? keyof NonNullable<TMembers> : never, TLegacySignalMembers extends PropertyKey = "connect" | "disconnect" | "emit" | "off" | "on" | "once", TInstalledPropertyCandidate = TInstance & TMemberSurface, TRegisteredPropertySurface = Omit<TPropertySurface, InstalledNames<TProperties>> & Pick<TInstalledPropertyCandidate, (string extends keyof TProperties ? never : {
62
+ [K in keyof TProperties & string]: TProperties[K] extends {
63
+ readonly [descriptorFreePropertySpec]: true;
64
+ } ? Camelized<Dashed<K>> : never;
65
+ }[keyof TProperties & string]) & {
66
+ [K in keyof TInstalledPropertyCandidate]-?: Extract<TInstalledPropertyCandidate[K], (...args: never[]) => unknown> extends never ? K : never;
67
+ }[keyof TInstalledPropertyCandidate]>, TRegisteredWritablePropertySurface = Omit<TWritablePropertySurface, InstalledNames<TProperties>> & Pick<TInstalledPropertyCandidate, (string extends keyof TProperties ? never : {
68
+ [K in keyof TProperties & string]: TProperties[K] extends {
69
+ readonly [descriptorFreePropertySpec]: true;
70
+ } ? Camelized<Dashed<K>> : never;
71
+ }[keyof TProperties & string]) & {
72
+ [K in keyof TInstalledPropertyCandidate]-?: Extract<TInstalledPropertyCandidate[K], (...args: never[]) => unknown> extends never ? (<U>(probe: U) => U extends {
73
+ [P in K]: TInstalledPropertyCandidate[P];
74
+ } ? 1 : 2) extends (<U>(probe: U) => U extends {
75
+ -readonly [P in K]: TInstalledPropertyCandidate[P];
76
+ } ? 1 : 2) ? K : never : never;
77
+ }[keyof TInstalledPropertyCandidate]>> = TRemainingInterfaces extends readonly [
78
+ infer TInterface extends Interface<TInstance>,
79
+ ...infer TRest extends readonly Interface<TInstance>[]
80
+ ] ? (ReturnType<TInterface["__impl__"]> extends infer TInterfaceInstance extends object ? RegisteredInstance<TInstance, TProperties, TSignals, TInterfaces, TRest, TMemberSurface & Omit<TInterfaceInstance, keyof TInstance | keyof TMemberSurface | "__properties__" | "__writableProperties__" | "__signalEmit__" | "__signals__" | TLegacySignalMembers> & {
81
+ [K in Extract<TInterfaceInstance extends {
82
+ [naturalSignalMember]?: infer TMembers;
83
+ } ? keyof NonNullable<TMembers> : never, TLegacySignalMembers> as K extends TNaturalInstanceMembers | keyof TMemberSurface ? never : K]: K extends keyof TInterfaceInstance ? TInterfaceInstance[K] : never;
84
+ }, TInterfaceInstance extends {
85
+ __signals__?: infer TNextSignalMap;
86
+ } ? Omit<TSignalSurface, keyof {
87
+ [K in keyof NonNullable<TNextSignalMap> as K extends string ? Dashed<K extends `${infer TBase}::${string}` ? TBase : K> extends TClassInstanceSignals | Dashed<keyof TSignals & string> ? never : K : K]: NonNullable<TNextSignalMap>[K];
88
+ }> & {
89
+ [K in keyof NonNullable<TNextSignalMap> as K extends string ? Dashed<K extends `${infer TBase}::${string}` ? TBase : K> extends TClassInstanceSignals | Dashed<keyof TSignals & string> ? never : K : K]: NonNullable<TNextSignalMap>[K];
90
+ } : TSignalSurface, TInterfaceInstance extends {
91
+ __signalEmit__?: infer TNextSignalEmitMap;
92
+ } ? Omit<TSignalEmitSurface, keyof {
93
+ [K in keyof NonNullable<TNextSignalEmitMap> as K extends string ? Dashed<K extends `${infer TBase}::${string}` ? TBase : K> extends TClassInstanceSignals | Dashed<keyof TSignals & string> ? never : K : K]: NonNullable<TNextSignalEmitMap>[K];
94
+ }> & {
95
+ [K in keyof NonNullable<TNextSignalEmitMap> as K extends string ? Dashed<K extends `${infer TBase}::${string}` ? TBase : K> extends TClassInstanceSignals | Dashed<keyof TSignals & string> ? never : K : K]: NonNullable<TNextSignalEmitMap>[K];
96
+ } : TSignalEmitSurface, TPropertySurface & Omit<TInterfaceInstance extends {
97
+ [propertyMapOverride]?: infer TResolver;
98
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInterfaceInstance extends {
99
+ __properties__?: infer TMap;
100
+ } ? NonNullable<TMap> : object : TInterfaceInstance extends {
101
+ __properties__?: infer TMap;
102
+ } ? NonNullable<TMap> : object, keyof TPropertySurface>, TWritablePropertySurface & Omit<TInterfaceInstance extends {
103
+ [writablePropertyMapOverride]?: infer TResolver;
104
+ } ? TResolver extends () => infer TMap ? NonNullable<TMap> : TInterfaceInstance extends {
105
+ __writableProperties__?: infer TMap;
106
+ } ? NonNullable<TMap> : object : TInterfaceInstance extends {
107
+ __writableProperties__?: infer TMap;
108
+ } ? NonNullable<TMap> : object, keyof TWritablePropertySurface>, TNaturalInstanceMembers, TClassInstanceSignals, TLegacySignalMembers> : never) : TInstance & TMemberSurface & DeclaredSignalMethods<TSignals, TNaturalInstanceMembers | Extract<keyof TMemberSurface, TLegacySignalMembers>> & {
109
+ [naturalSignalMember]?: Record<TNaturalInstanceMembers | Extract<keyof TMemberSurface, TLegacySignalMembers>, true>;
110
+ [classSignalMember]?: Record<TClassInstanceSignals | Dashed<keyof TSignals & string>, true>;
111
+ [signalMapOverride]?: () => Omit<TSignalSurface, DeclaredSignalName<TSignals>> & Record<DeclaredSignalName<TSignals>, (...args: never[]) => unknown>;
112
+ [signalEmitMapOverride]?: () => Omit<TSignalEmitSurface, DeclaredSignalName<TSignals>> & Record<DeclaredSignalName<TSignals>, {
113
+ args: unknown[];
114
+ result: unknown;
115
+ }>;
116
+ [propertyMapOverride]?: () => TRegisteredPropertySurface;
117
+ [writablePropertyMapOverride]?: () => TRegisteredWritablePropertySurface;
118
+ __properties__: TRegisteredPropertySurface;
119
+ __writableProperties__: TRegisteredWritablePropertySurface;
69
120
  };
70
- /**
71
- * An instance of a registered class: everything the class itself declares, plus the property map the
72
- * hooks that address a property by name, such as `useProperty` from `@gtkx/react`, read the installed
73
- * names off. Each name is typed with the value type the class declares for the member of that name,
74
- * so a property the class does not `declare` contributes nothing.
75
- */
76
- type RegisteredInstance<TInstance, TProperties, TSignals> = TInstance & DeclaredSignalMethods<TSignals> & {
77
- /** Type-level map from installed property name to value type; no value ever carries it. */
78
- __properties__: Pick<TInstance, InstalledNames<TProperties> & keyof TInstance>;
79
- };
80
- /**
81
- * The construct signature and prototype a registered class carries, both giving
82
- * {@link RegisteredInstance}. The signature stays abstract for as long as the class itself is, so
83
- * registering an abstract base leaves it as impossible to construct as it was.
84
- */
121
+ /** A registered class's construct signature and prototype. */
85
122
  type RegisteredConstructor<TClass, TArgs extends unknown[], TInstance> = {
86
123
  /** Object the class's instances inherit from. */
87
124
  prototype: TInstance;
88
125
  } & (TClass extends new (...args: never) => unknown ? new (...args: TArgs) => TInstance : abstract new (...args: TArgs) => TInstance);
89
126
  /** The statics a registered class keeps from the class it was, joined with {@link RegisteredConstructor}. */
90
127
  type RegisteredParts<TClass, TArgs extends unknown[], TInstance> = Omit<TClass, "prototype"> & RegisteredConstructor<TClass, TArgs, TInstance>;
91
- /**
92
- * The class {@link registerClass} hands back: the same class, with the same statics, whose instances
93
- * carry the properties `RegisterClassOptions.properties` installed and take the signals
94
- * `RegisterClassOptions.signals` declares by name. Binding the call to a name, rather than
95
- * discarding it, is what carries those names into the type system.
96
- */
97
- type RegisteredClass<TClass extends AnyClass, TProperties, TSignals> = TClass extends abstract new (...args: infer TArgs) => infer TInstance ? RegisteredParts<TClass, TArgs, RegisteredInstance<TInstance, TProperties, TSignals>> : never;
98
- /**
99
- * A GType in the form `RegisterClassOptions.signals` takes one: the numeric GType itself, such as
100
- * `TYPE_STRING` from `@gtkx/gi/gobject`, or a class carrying one, which is any generated wrapper
101
- * class and any class an earlier {@link registerClass} call registered.
102
- */
128
+ /** The registered class with its declared properties and signals. */
129
+ type RegisteredClass<TClass extends AnyClass, TProperties, TSignals, TInterfaces extends readonly Interface<TClass["prototype"]>[]> = TClass extends abstract new (...args: infer TArgs) => infer TInstance ? RegisteredParts<TClass, TArgs, RegisteredInstance<TInstance, TProperties, TSignals, TInterfaces>> : never;
130
+ /** A numeric GType or a generated or registered wrapper class. */
103
131
  type SignalGType = bigint | AnyClass<TypedClass>;
104
- /**
105
- * One signal `RegisterClassOptions.signals` creates on the new type, sitting under the signal's
106
- * name. Every part is optional: `{}` declares a signal with no arguments and no return value that
107
- * runs its handlers in the default `RUN_FIRST` stage.
108
- */
132
+ /** A signal installed by {@link registerClass}. */
109
133
  type SignalSpec = {
110
- /**
111
- * `GObject.SignalFlags` bit mask for the signal, defaulting to `RUN_FIRST`. `DETAILED` lets
112
- * handlers connect to and emissions name a `::detail` suffix.
113
- */
134
+ /** `GObject.SignalFlags` bit mask, defaulting to `RUN_FIRST`. */
114
135
  flags?: number;
115
- /** GType of each argument an emission carries, defaulting to none. */
136
+ /** Argument GTypes, defaulting to none. */
116
137
  paramTypes?: SignalGType[];
117
- /** GType of the value an emission returns, defaulting to none. */
138
+ /** Return GType, defaulting to none. */
118
139
  returnType?: SignalGType;
119
- /**
120
- * How the emission combines what its handlers return, limited to the accumulators GObject
121
- * ships: `"first-wins"` stops the emission at the first handler and keeps its result, and
122
- * `"true-handled"` runs handlers until one returns `true`, which requires a boolean
123
- * `returnType`. Without one, every handler runs and the last result stands.
124
- */
140
+ /** Combines handler results; omitted means the last result wins. */
125
141
  accumulator?: "first-wins" | "true-handled";
126
142
  };
127
143
  /** What {@link registerClass} adds to the new GType beyond the vtable slots it discovers on the class. */
128
- type RegisterClassOptions<TInstance extends object, TProperties extends Record<string, PropertySpec>, TSignals extends Record<string, SignalSpec>> = {
129
- /**
130
- * Name to register the new GType under, defaulting to the class's own name. Either way the
131
- * name has to be a valid GType name: at least three characters, starting with a letter or
132
- * underscore, the rest letters, digits, `-`, `_` or `+`. Any other name throws a `TypeError`.
133
- */
144
+ type RegisterClassOptions<TInstance extends object, TProperties extends Record<string, PropertySpec>, TSignals extends Record<string, SignalSpec>, TInterfaces extends readonly Interface<TInstance>[]> = {
145
+ /** Registered GType name, defaulting to the class name. */
134
146
  typeName?: string;
135
- /**
136
- * Registers the new GType abstract, the way `G_TYPE_FLAG_ABSTRACT` marks a C type: the class
137
- * still serves as a parent for further registered subclasses, which instantiate as usual, but
138
- * constructing it directly throws, whether from JavaScript or from a native caller.
139
- */
147
+ /** Prevents direct construction while allowing registered subclasses. */
140
148
  abstract?: boolean;
141
- /**
142
- * Name instances of the new type carry in CSS, applied through `gtk_widget_class_set_css_name`
143
- * from inside the type's `class_init`, so every instance is born with it, wherever it is
144
- * created from. Requires the class to extend `Gtk.Widget`; registering a non-widget with a
145
- * `cssName` throws.
146
- */
149
+ /** CSS node name for a `Gtk.Widget` subclass. */
147
150
  cssName?: string;
148
151
  /**
149
- * Hook run once, synchronously, while `registerClass` registers the type, after its
150
- * `class_init` has installed the vfuncs, properties and signals declared here. It receives the
151
- * new type's class struct wrapped in its generated GTypeStruct wrapper, so class-level setup
152
- * calls such as `Gtk.WidgetClass.installAction`, `Gtk.WidgetClass.addShortcut` and
153
- * `Gtk.WidgetClass.setLayoutManagerType` have somewhere to land. The wrapper serves the
154
- * members of every struct in the parent chain on one object: a widget subclass sees
155
- * `Gtk.WidgetClass` and `GObject.ObjectClass` members alike, so the parameter can be declared
156
- * as whichever of those types the hook needs. The class struct belongs to the type system for
157
- * the life of the process, so keeping the wrapper around past the hook is safe, if rarely
158
- * useful. An exception the hook throws propagates out of `registerClass`, with the type
159
- * already registered: GObject offers no way to unregister a static type.
152
+ * Runs once after registration with the wrapped class struct. An exception propagates after
153
+ * the static GType has already been registered and cannot be undone.
160
154
  */
161
155
  classInit?(typeStruct: object): void;
156
+ /** Interfaces implemented through matching `vfunc` methods. */
157
+ implements?: TInterfaces;
162
158
  /**
163
- * Interfaces the new type implements on top of the ones it inherits, given as the interface values
164
- * themselves, such as `Gio.ListModel`. Their vtable slots are filled from the `vfunc`-prefixed methods on
165
- * the class's prototype chain, each of which has to match the interface's `Impl` type, such as
166
- * `Gio.ListModelImpl`.
167
- */
168
- implements?: Interface<TInstance>[];
169
- /**
170
- * Properties to install on the new type, keyed by the name JavaScript addresses each one by and
171
- * valued with the `GObject.ParamSpec` describing it. A key is read in camelCase however it is
172
- * written, so `dewPoint`, `dew_point` and `dew-point` all name the same member, and the ParamSpec
173
- * has to carry a name that reads back as that same member, such as `dew-point`, or registration
174
- * throws: the ParamSpec's name is the one GObject emits `notify` with, and a name the key does
175
- * not spell reaches nothing that listens for it. A word starting with a digit is a word of its
176
- * own on either side of that reading, so `level2Depth` takes a ParamSpec named `level-2-depth`
177
- * as readily as one named `level2-depth`, the way `WebKit.Settings` names
178
- * `enable-2d-canvas-acceleration` for its `enable2dCanvasAcceleration` member. An uppercase
179
- * letter in the ParamSpec's own name is refused, since GObject notifies under that spelling
180
- * and nothing else reads it back. Every property gains prototype accessors, one for the key as
181
- * written, one for it with dashes turned into underscores and one for it in camelCase, each
182
- * unless the class already defines that name. They serve the value from storage of their own on
183
- * the instance, which is also what the type's `get_property` and `set_property` slots read and
184
- * write, so a value set from JavaScript, from `g_object_set_property` and at construction all
185
- * land in the same place.
186
- *
187
- * A write the ParamSpec would refuse throws rather than reaching GObject, which reports such a
188
- * write as a GLib critical and drops it: a `TypeError` for a read-only or construct-only
189
- * property and for a value of a type the property cannot hold, and a `RangeError` for a value
190
- * the ParamSpec rejects. The same checks run over a value handed to the constructor, where
191
- * a construct-only property is the one that is writable. An accepted write emits one `notify`,
192
- * which a `freeze_notify` batch collects; a write of the value the property already holds is
193
- * dropped and emits none.
194
- *
195
- * `null` and `undefined` both mean NULL, and mean it only where the ParamSpec's own type holds
196
- * NULL, which is a string, string-array, boxed, object, interface, param, variant or pointer
197
- * property. Such a property holds the `null` either spelling wrote, so the member, the type's
198
- * `get_property` slot and `g_object_get_property` serve the same thing, and writing the other
199
- * spelling over it emits no `notify`. Every other property, so every integer, floating-point,
200
- * boolean, enum, flags and GType one, refuses both with the same `TypeError` it refuses a
201
- * string with, and keeps the value it already holds. It refuses them for what it holds rather
202
- * than for its range, whatever that range is: the type is checked before the range, so a
203
- * `gint` whose range excludes 0 answers a nullish with that same `TypeError` and never with
204
- * the `RangeError` that names the value GObject would put in its place. The one place
205
- * `undefined` means something else is the constructor, which reads it as the property not
206
- * being given at all and leaves it at the ParamSpec's default, so a property is never handed a
207
- * value it cannot serve back.
208
- *
209
- * A floating-point property takes every JavaScript number, `NaN` and both infinities
210
- * included, and its ParamSpec alone rules on which of them the range admits: a `gdouble`
211
- * bounded by `-Infinity` and `Infinity` holds either infinity, and a magnitude a bounded
212
- * one excludes, like any `NaN`, comes back as the `RangeError` that names what GObject
213
- * would put in its place rather than as the `TypeError` a type the property cannot hold
214
- * earns. A `gfloat` property holds what GObject narrows the double to, so it serves `0.1`
215
- * back as `0.10000000149011612` and a finite magnitude no `gfloat` reaches as an infinity,
216
- * which the range then rules on in turn. That narrowing belongs to the property alone: the
217
- * same magnitude written to a `gfloat` through a generated binding, a signal argument or a
218
- * closure return is refused outright rather than narrowed.
219
- *
220
- * A generated property of a wrapped type answers a nullish differently, and the two halves of
221
- * the API disagree here: that property marshals what it is written through its descriptor
222
- * rather than through the checks above, so `new Gtk.Label({ widthRequest: null })` and a later
223
- * write of `null` to that member both land 0, where a `gint` installed here refuses both.
224
- *
225
- * A class that defines the camelCase member itself owns the property: its own accessor decides
226
- * what a write means, the other spellings forward to it, and the type's property slots read
227
- * and write it rather than the generated storage.
159
+ * ParamSpecs keyed by their JavaScript property names. Keys and ParamSpec names must canonicalize
160
+ * to the same member. Writes validate flags, types, and ranges and notify only on changes.
161
+ * Nullish values require a nullable GType; constructor `undefined` means omitted. An existing
162
+ * camelCase accessor remains authoritative.
228
163
  */
229
164
  properties?: TProperties;
230
165
  /**
231
- * Signals to create on the new type, keyed by signal name and valued with the
232
- * {@link SignalSpec} describing each one. A name has to start with a lowercase letter, continue
233
- * in lowercase letters, digits, `-` and `_`, and be new to the type: one an ancestor type or a
234
- * listed interface already carries throws, and so does one carrying an uppercase letter, which
235
- * GObject would carry under that exact spelling, out of reach of both its dashed spelling and
236
- * its `on<SignalName>` default handler. Either word separator spells the same signal, so a
237
- * signal declared as `data_changed` is connected to and emitted as `data-changed` too.
238
- *
239
- * Instances connect and emit by name through the same `connect`, `on`, `once`, `off` and
240
- * `emit` surface inherited signals use: `registerClass` wraps `connect` and `emit` on the
241
- * class's prototype to serve the declared names, unless the class defines the member itself,
242
- * and hands every other name to the inherited implementation. A handler receives the
243
- * emission's arguments without the leading emitter, matching a generated signal, and what it
244
- * returns becomes the emission's return value when the signal declares one.
245
- *
246
- * The declared parameter GTypes rule the emission: `emit` takes exactly one argument per
247
- * declared parameter, throwing a `TypeError` for any other count, and converts each argument
248
- * into a `GValue` of the declared type, throwing for a value that type cannot hold. The signals
249
- * are created with no class closure of their own, but a method named `on<SignalName>`
250
- * becomes the signal's default handler, the way every `on`-prefixed method that names a
251
- * signal the type carries does; see {@link registerClass}.
166
+ * New canonical signal names and specs. Declared GTypes validate emissions, and a matching
167
+ * `on<SignalName>` method becomes the default handler.
252
168
  */
253
169
  signals?: TSignals;
254
170
  };
255
171
  /**
256
- * Registers a subclass of a wrapper class as a new GType, wiring up any class and interface
257
- * virtual functions it overrides, both for the interfaces it inherits and for the ones
258
- * `RegisterClassOptions.implements` names.
259
- *
260
- * Throws when the class does not extend a registered wrapper class, when it has no derivable type
261
- * name or the name is not a valid GType name, when an entry in
262
- * `RegisterClassOptions.implements` is not a registered interface, when a
263
- * listed interface has a prerequisite that neither the parent type nor another listed interface meets,
264
- * when the list names `Gio.AsyncInitable` as an interface the parent type does not already
265
- * implement and no method on the chain fills `vfuncInitAsync`, since the default `init_async`
266
- * would run `vfuncInit` on a worker thread, when an entry in
267
- * `RegisterClassOptions.properties` names its `GObject.ParamSpec` something the key it sits under
268
- * does not spell, when an entry in `RegisterClassOptions.signals` carries an invalid name, a name
269
- * spelled with an uppercase letter rather than dashed, a name the type already knows, a GType
270
- * that cannot hold a value, or an accumulator the spec does not admit, and when
271
- * `RegisterClassOptions.cssName` is
272
- * given for a class that does not extend `Gtk.Widget`. An exception thrown by
273
- * `RegisterClassOptions.classInit` also propagates, after the type has already been registered.
274
- *
275
- * A slot is filled from the `vfunc`-prefixed methods on the class's prototype chain, up to but not
276
- * including the registered ancestor the class extends, so a method an intermediate base class
277
- * declares fills a slot the same way one the class itself declares does. A slot nothing on that
278
- * chain fills is left untouched.
279
- *
280
- * Declare every slot as a method: a class field holding a function, such as `vfuncGetNItems = () => 1`,
281
- * is assigned to each instance after registration and never reaches the vtable.
282
- *
283
- * A method named `on<SignalName>` — the signal's name in camelCase after the `on`, so `onClicked`
284
- * for `clicked` and `onItemsChanged` for `items-changed` — becomes that signal's default handler
285
- * when the type carries the signal, whether an ancestor type or an implemented interface brings it
286
- * or `RegisterClassOptions.signals` declares it. The method is installed as a class-closure
287
- * override, so it runs on every emission, on the instances a native caller creates included, in
288
- * the stage the signal's flags name rather than alongside connected handlers. It receives the
289
- * emission's arguments without the leading emitter, with `this` bound to the emitter, and what it
290
- * returns becomes the emission's result when the signal declares one. The same discovery walks the
291
- * prototype chain vfunc discovery walks, and a subclass registering its own `on<SignalName>`
292
- * replaces the handler for its instances, where `super.on<SignalName>()` reaches the replaced one.
293
- * An `on`-prefixed method naming no signal the type carries is left alone as the ordinary method
294
- * it is.
172
+ * Registers a wrapper subclass as a GType with discovered vfuncs, properties, signals, and interfaces.
173
+ * Vfuncs must be prototype methods; function-valued fields never reach the vtable. A matching
174
+ * `on<SignalName>` method becomes the signal's default handler.
295
175
  *
296
- * An override of `vfuncConstructed` runs from inside the base constructor, before JavaScript
297
- * installs the subclass's field initializers and runs its constructor body, so a field still
298
- * reads `undefined` there and reading a `#private` field throws. Declare state the override
299
- * touches without an initializer, and assign private state from the constructor body after
300
- * `super()`. An instance a native caller creates, through `GObject.newv` or `Gtk.Builder`,
301
- * never runs the subclass constructor at all, so its declared fields stay uninitialized for
302
- * the object's whole life.
176
+ * `vfuncConstructed` runs before field initializers and the constructor body. Native-created
177
+ * instances never run the JavaScript constructor, so native-required state belongs in properties
178
+ * or `vfuncConstructed`. A new `Gio.AsyncInitable` must implement `vfuncInitAsync`.
303
179
  *
304
- * @param klass The subclass to register.
305
- * @param options What the new GType gains beyond the vtable slots the class overrides.
306
- * @returns The same class, now registered, with every name in `options.properties` in its property map.
180
+ * @param klass The wrapper subclass to register.
181
+ * @param options Additional GType configuration.
182
+ * @returns The registered class with declared properties and signals in its type.
183
+ * @throws For invalid parents, names, interfaces, vfuncs, properties, signals, or widget options.
184
+ * A `classInit` exception propagates after the static type has been registered and cannot be undone.
307
185
  */
308
- declare function registerClass<T extends AnyClass, TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>, TSignals extends Record<string, SignalSpec> = Record<never, SignalSpec>>(klass: T, options?: RegisterClassOptions<T["prototype"], TProperties, TSignals>): RegisteredClass<T, TProperties, TSignals>;
186
+ declare function registerClass<T extends AnyClass, TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>, TSignals extends Record<string, SignalSpec> = Record<never, SignalSpec>, const TInterfaces extends readonly Interface<T["prototype"]>[] = readonly Interface<T["prototype"]>[]>(klass: T, options?: RegisterClassOptions<T["prototype"], TProperties, TSignals, TInterfaces>): RegisteredClass<T, TProperties, TSignals, TInterfaces>;
309
187
  export { type Interface, registerClass, type SignalGType, type SignalSpec };
310
188
  //# sourceMappingURL=register-class.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-class.d.ts","sourceRoot":"","sources":["../src/register-class.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAA6C,MAAM,aAAa,CAAC;AAGvF,OAAO,EAMH,KAAK,YAAY,EAGpB,MAAM,iBAAiB,CAAC;AAqBzB,OAAO,EAIH,KAAK,UAAU,EAMlB,MAAM,WAAW,CAAC;AAGnB;;;;;;;;;GASG;AACH,KAAK,SAAS,CAAC,KAAK,IAAI,QAAQ,GAAG;IAC/B,qFAAqF;IACrF,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;GAGG;AACH,KAAK,MAAM,CAAC,KAAK,SAAS,MAAM,IAAI,KAAK,SAAS,GAAG,MAAM,KAAK,IAAI,MAAM,KAAK,EAAE,GAC3E,MAAM,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,CAAC,GAC3B,KAAK,CAAC;AAEZ;;;GAGG;AACH,KAAK,SAAS,CAAC,KAAK,SAAS,MAAM,IAAI,KAAK,SAAS,GAAG,MAAM,KA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,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,EAErG,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,GACnF,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AA0kB1D,OAAO,EAAE,KAAK,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,CAAC"}
@@ -3,8 +3,10 @@ import { getParentClass, kebabCase, walkClassChain } from "@gtkx/utils";
3
3
  import { wrapCallback } from "./callback.js";
4
4
  import { insertMixinLayer } from "./mixin.js";
5
5
  import { buildPropertyDispatch, GET_PROPERTY_VFUNC, makeGetProperty, makeSetProperty, SET_PROPERTY_VFUNC, toNativeProperties, } from "./properties.js";
6
+ import { descriptorFreePropertySpec, propertyMapOverride, writablePropertyMapOverride, } from "./property-brand.js";
6
7
  import { getClassStructClass, getClassType, getInterfaceMixin, getTypeClassHandle, markDerivedClass, registerClassType, wrapHandle, } from "./registry.js";
7
- import { connectClosureSignal, emitDeclaredSignal, getSignalBaseName, overrideSignalClassClosure, signalForHandlerName, signalIdFor, } from "./signal.js";
8
+ import { classSignalMember, naturalSignalMember, signalEmitMapOverride, signalMapOverride, } from "./signal-brand.js";
9
+ import { canonicalSignalName, connectClosureSignal, emitDeclaredSignal, installSignalDispatch, overrideSignalClassClosure, signalForHandlerName, signalIdFor, } from "./signal.js";
8
10
  import { TYPE_INTERFACE, TYPE_INVALID, TYPE_NONE, typeFundamental, typeInterfacePrerequisites, typeInterfaces, typeIsA, typeName, } from "./type.js";
9
11
  import { findClassVfuncDescriptor, findInterfaceVfuncDescriptor } from "./vfunc.js";
10
12
  const INSTANCE_ARG_INDEX = 0;
@@ -49,7 +51,7 @@ function registerClass(klass, options = {}) {
49
51
  markDerivedClass(klass);
50
52
  installSignalOverrides(newType, methods);
51
53
  applyInterfaceMixins(klass, adoptedTypes, inheritedNames);
52
- installDeclaredSignalMethods(klass, signals.table, members.names);
54
+ installDeclaredSignalMethods(klass, signals.table);
53
55
  invokeClassInit(options, newType);
54
56
  return klass;
55
57
  }
@@ -261,7 +263,6 @@ function buildPropertyVfunc(klass, methodName, fn, isValueOut) {
261
263
  fn: wrapVfunc(fn, argDescriptors, descriptor),
262
264
  };
263
265
  }
264
- const canonicalSignalName = (name) => name.replaceAll("_", "-");
265
266
  function assertLowerCaseSignalName(klass, name) {
266
267
  if (!UPPER_CASE_PATTERN.test(name)) {
267
268
  return;
@@ -333,43 +334,24 @@ function resolveDeclaredSignals(klass, signals) {
333
334
  }
334
335
  return { native, table };
335
336
  }
336
- function inheritedSignalMethod(inherited, signal) {
337
- if (inherited === undefined) {
338
- throw new Error(`Unknown signal '${signal}'`);
339
- }
340
- return inherited;
341
- }
342
- function installDeclaredConnect(proto, findDeclared) {
343
- const inheritedConnect = proto.connect;
344
- proto.connect = function connect(signal, handler, isAfter) {
345
- if (findDeclared(signal) === undefined) {
346
- return inheritedSignalMethod(inheritedConnect, signal).call(this, signal, handler, isAfter);
347
- }
348
- return connectClosureSignal(this, signal, handler, isAfter ?? false);
349
- };
350
- }
351
- function installDeclaredEmit(proto, findDeclared) {
352
- const inheritedEmit = proto.emit;
353
- proto.emit = function emit(sigName, ...args) {
354
- const declared = findDeclared(sigName);
355
- if (declared === undefined) {
356
- return inheritedSignalMethod(inheritedEmit, sigName).call(this, sigName, ...args);
357
- }
358
- return emitDeclaredSignal(this, sigName, declared, args);
359
- };
360
- }
361
- function installDeclaredSignalMethods(klass, table, definedNames) {
337
+ function installDeclaredSignalMethods(klass, table) {
362
338
  if (table.size === 0) {
363
339
  return;
364
340
  }
365
- const proto = klass.prototype;
366
- const findDeclared = (signal) => table.get(canonicalSignalName(getSignalBaseName(signal)));
367
- if (!definedNames.has("connect")) {
368
- installDeclaredConnect(proto, findDeclared);
369
- }
370
- if (!definedNames.has("emit")) {
371
- installDeclaredEmit(proto, findDeclared);
372
- }
341
+ const findDeclared = (signal) => table.get(canonicalSignalName(signal));
342
+ installSignalDispatch(klass, table.keys().toArray(), {
343
+ connect(instance, signal, handler, isAfter) {
344
+ findDeclared(signal);
345
+ return connectClosureSignal(instance, signal, handler, isAfter ?? false);
346
+ },
347
+ emit(instance, signal, args) {
348
+ const declared = findDeclared(signal);
349
+ if (declared === undefined) {
350
+ throw new Error(`Unknown signal '${signal}'`);
351
+ }
352
+ return emitDeclaredSignal(instance, signal, declared, args);
353
+ },
354
+ });
373
355
  }
374
356
  function toNativeInterface(binding) {
375
357
  const nativeInterface = {