class Godot::TypedSignal(*T)

Overview

Strongly-typed signal binding offering compile-time type safety for signal connections and await.

Defined in:

libgodot/object.cr

Constructors

Instance Method Summary

Instance methods inherited from class Godot::BoundSignal

<<(&block : Array(Variant) -> Void) : SignalSubscription
<<(proc : Proc(Array(Variant), R)) : SignalSubscription forall R
<<(proc : Proc(R)) : SignalSubscription forall R
<<
, alive? : Bool alive?, await(timeout_sec : Float64 | Nil = nil) : Array(Variant)
await(timeout_sec : Number) : Array(Variant)
await
, connect(flags : ConnectFlags = ConnectFlags::None, callback : Proc(Array(Variant), Void) | Nil = nil) : SignalSubscription
connect(flags : ConnectFlags = ConnectFlags::None, &block : Array(Variant) -> Void) : SignalSubscription
connect(listener_target : Godot::Object, method_name : Symbol, flags : ConnectFlags = ConnectFlags::None) : SignalSubscription
connect
, connect_one_shot(&block : Array(Variant) -> Void) : SignalSubscription connect_one_shot, connected? : Bool connected?, connection_count : Int32 connection_count, disconnect : Void disconnect, emit(*args) : Void emit, has_connections? : Bool has_connections?, name : String name, once(&block : Array(Variant) -> Void) : SignalSubscription once, target : Godot::Object target, target_id : UInt64 target_id, to_s(io : IO) : Void to_s

Constructor methods inherited from class Godot::BoundSignal

new(target : Godot::Object, name : String) new

Constructor Detail

def self.new(target : Godot::Object, name : String) #

Instance Method Detail

def <<(&block : *T -> Void) : SignalSubscription #

Operator << syntactic sugar for type-safe connect with a block


def <<(proc : Proc(*T, R)) : SignalSubscription forall R #

Operator << syntactic sugar for type-safe connect with a Proc


def <<(proc : Proc(R)) : SignalSubscription forall R #

Operator << syntactic sugar for 0-argument Proc


def await(timeout_sec : Float64 | Nil = nil) #

Cooperatively awaits this typed signal returning unboxed values or tuple


def await(timeout_sec : Number) #
Description copied from class Godot::BoundSignal

Cooperatively awaits this signal with timeout in seconds


def connect(flags : ConnectFlags = ConnectFlags::None, &block : *T -> Void) : SignalSubscription #

Type-safe connect with automatic unboxing into block parameters


def connect_one_shot(&block : *T -> Void) : SignalSubscription #

Backwards-compatibility helper redirecting to ConnectFlags::OneShot


def emit(*args : *T) : Void #

Emits this typed signal with compile-time type safety matching the signal declaration


def once(&block : *T -> Void) : SignalSubscription #

Idiomatic shorthand alias for #connect_one_shot