Expose the relay in the client connection event

This commit is contained in:
Wilson Silva
2024-04-05 15:31:49 +01:00
parent 61eb0459d4
commit a0cf41bfb4
7 changed files with 30 additions and 21 deletions

View File

@@ -16,5 +16,6 @@ module Nostr
def execute_within_an_em_thread: { -> void } -> Thread
def initialize_channels: -> void
def build_websocket_client: (String relay_name) -> Faye::WebSocket::Client
end
end

View File

@@ -1,16 +1,14 @@
# Added only to satisfy the Steep requirements. Not 100% reliable.
module EventEmitter
interface _Event
def data: -> String
def message: -> String
def code: -> Integer
def reason: -> String
end
def self.included: (Module) -> void
def self.apply: (untyped) -> void
def add_listener: (Symbol event_name) { (_Event event) -> void } -> void
def __events: () -> Array[untyped]
def add_listener: (Symbol | String type, ?Hash[untyped, untyped] params) { (*untyped) -> void } -> Integer
alias on add_listener
alias once add_listener
def remove_listener: (untyped id_or_type) -> Array[untyped]?
def emit: (Symbol `type`, *untyped data) -> Array[untyped]
def once: (Symbol `type`) -> Integer
def remove_listener: (Integer | Symbol | String id_or_type) -> void
def emit: (Symbol | String type, *untyped data) -> void
end