events

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package events はGrowseのDOMイベント配信を管理する。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher() *Dispatcher

func (*Dispatcher) AddEventListener

func (dispatcher *Dispatcher) AddEventListener(nodeID dom.NodeID, eventType Type, listener Listener)

func (*Dispatcher) AddEventListenerWithCapture added in v0.14.0

func (dispatcher *Dispatcher) AddEventListenerWithCapture(nodeID dom.NodeID, eventType Type, capture bool, listener Listener) ListenerID

func (*Dispatcher) AddEventListenerWithOptions added in v0.15.0

func (dispatcher *Dispatcher) AddEventListenerWithOptions(nodeID dom.NodeID, eventType Type, capture, once, passive bool, listener Listener) ListenerID

AddEventListenerWithOptions registers propagation and lifecycle options.

func (*Dispatcher) Dispatch

func (dispatcher *Dispatcher) Dispatch(event Event) bool

func (*Dispatcher) DispatchTree added in v0.14.0

func (dispatcher *Dispatcher) DispatchTree(document *dom.Document, event Event) bool

func (*Dispatcher) RemoveEventListener added in v0.14.0

func (dispatcher *Dispatcher) RemoveEventListener(nodeID dom.NodeID, eventType Type, id ListenerID) bool

func (*Dispatcher) RemoveEventListeners

func (dispatcher *Dispatcher) RemoveEventListeners(nodeIDs ...dom.NodeID)

type Event

type Event struct {
	Type          Type
	Target        dom.NodeID
	X             float32
	Y             float32
	Value         string
	RuntimeID     uint64
	BubblesValue  bool
	BubblesSet    bool
	CancelableSet bool
	// contains filtered or unexported fields
}

func Cancelable added in v0.8.0

func Cancelable(eventType Type, target dom.NodeID) Event

func New added in v0.15.0

func New(eventType Type, target dom.NodeID, bubbles, cancelable bool) Event

New constructs an Event with explicit bubbles and cancelable flags.

func (Event) Bubbles added in v0.14.0

func (event Event) Bubbles() bool

func (Event) CurrentTarget added in v0.14.0

func (event Event) CurrentTarget() dom.NodeID

func (Event) DefaultPrevented added in v0.8.0

func (event Event) DefaultPrevented() bool

func (Event) EventPhase added in v0.14.0

func (event Event) EventPhase() Phase

func (Event) ImmediatePropagationStopped added in v0.15.0

func (event Event) ImmediatePropagationStopped() bool

ImmediatePropagationStopped reports whether the current dispatch was stopped immediately.

func (Event) IsCancelable added in v0.8.0

func (event Event) IsCancelable() bool

func (Event) PassiveListener added in v0.15.0

func (event Event) PassiveListener() bool

PassiveListener reports whether the currently invoked listener is passive.

func (Event) PreventDefault added in v0.8.0

func (event Event) PreventDefault()

func (Event) PropagationStopped added in v0.14.0

func (event Event) PropagationStopped() bool

func (Event) StopImmediatePropagation added in v0.15.0

func (event Event) StopImmediatePropagation()

StopImmediatePropagation stops remaining listeners on the current target and propagation.

func (Event) StopPropagation added in v0.14.0

func (event Event) StopPropagation()

type Listener

type Listener func(Event)

type ListenerID added in v0.14.0

type ListenerID uint64

type Phase added in v0.14.0

type Phase uint8
const (
	PhaseNone      Phase = 0
	PhaseCapturing Phase = 1
	PhaseAtTarget  Phase = 2
	PhaseBubbling  Phase = 3
)

type Type

type Type string
const (
	Click      Type = "click"
	Input      Type = "input"
	Change     Type = "change"
	Submit     Type = "submit"
	Reset      Type = "reset"
	Focus      Type = "focus"
	Blur       Type = "blur"
	MouseEnter Type = "mouseenter"
	MouseLeave Type = "mouseleave"
	Load       Type = "load"
	Error      Type = "error"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL