Skip to content

API Reference / @gtkx/runtime / SignalSpec

Type Alias: SignalSpec

SignalSpec = object

Defined in: packages/runtime/dist/register-class.d.ts:109

One signal RegisterClassOptions.signals creates on the new type, sitting under the signal's name. Every part is optional: {} declares a signal with no arguments and no return value that runs its handlers in the default RUN_FIRST stage.

Properties

accumulator?

optional accumulator?: "first-wins" | "true-handled"

Defined in: packages/runtime/dist/register-class.d.ts:125

How the emission combines what its handlers return, limited to the two accumulators GObject ships: "first-wins" stops the emission at the first handler and keeps its result, and "true-handled" runs handlers until one returns true, which requires a boolean returnType. Without one, every handler runs and the last result stands.


flags?

optional flags?: number

Defined in: packages/runtime/dist/register-class.d.ts:114

GObject.SignalFlags bit mask for the signal, defaulting to RUN_FIRST. DETAILED lets handlers connect to and emissions name a ::detail suffix.


paramTypes?

optional paramTypes?: SignalGType[]

Defined in: packages/runtime/dist/register-class.d.ts:116

GType of each argument an emission carries, defaulting to none.


returnType?

optional returnType?: SignalGType

Defined in: packages/runtime/dist/register-class.d.ts:118

GType of the value an emission returns, defaulting to none.

Released under the MPL-2.0 License.