Documentation
¶
Index ¶
- func ConvertElemsToTransferElems(elems []RenderedElem) ([]VDomTransferElem, []VDomText)
- type ModalConfig
- type ModalResult
- type RenderedElem
- type VDomBackendOpts
- type VDomBackendUpdate
- type VDomFrontendUpdate
- type VDomMessage
- type VDomRefUpdate
- type VDomRenderContext
- type VDomRenderUpdate
- type VDomText
- type VDomTransferElem
- type VDomUrlRequestResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertElemsToTransferElems ¶
func ConvertElemsToTransferElems(elems []RenderedElem) ([]VDomTransferElem, []VDomText)
Types ¶
type ModalConfig ¶
type ModalConfig struct {
ModalId string `json:"modalid"` // Unique identifier for the modal
ModalType string `json:"modaltype"` // "alert" or "confirm"
Icon string `json:"icon,omitempty"` // Optional icon to display (emoji or icon name)
Title string `json:"title"` // Modal title
Text string `json:"text,omitempty"` // Optional body text
OkText string `json:"oktext,omitempty"` // Optional OK button text (defaults to "OK")
CancelText string `json:"canceltext,omitempty"` // Optional Cancel button text for confirm modals (defaults to "Cancel")
}
ModalConfig contains all configuration options for modals
type ModalResult ¶
type ModalResult struct {
ModalId string `json:"modalid"` // ID of the modal
Confirm bool `json:"confirm"` // true = confirmed/ok, false = cancelled
}
ModalResult contains the result of a modal interaction
type RenderedElem ¶
type RenderedElem struct {
WaveId string `json:"waveid,omitempty"` // required, except for #text nodes
Tag string `json:"tag"`
Props map[string]any `json:"props,omitempty"`
Children []RenderedElem `json:"children,omitempty"`
Text string `json:"text,omitempty"`
}
rendered element (output from rendering pipeline)
type VDomBackendOpts ¶
type VDomBackendUpdate ¶
type VDomBackendUpdate struct {
Type string `json:"type" tstype:"\"backendupdate\""`
Ts int64 `json:"ts"`
ServerId string `json:"serverid"`
Opts *VDomBackendOpts `json:"opts,omitempty"`
HasWork bool `json:"haswork,omitempty"`
FullUpdate bool `json:"fullupdate,omitempty"`
RenderUpdates []VDomRenderUpdate `json:"renderupdates,omitempty"`
TransferElems []VDomTransferElem `json:"transferelems,omitempty"`
TransferText []VDomText `json:"transfertext,omitempty"`
RefOperations []vdom.VDomRefOperation `json:"refoperations,omitempty"`
Messages []VDomMessage `json:"messages,omitempty"`
}
func (*VDomBackendUpdate) CreateTransferElems ¶
func (beUpdate *VDomBackendUpdate) CreateTransferElems()
type VDomFrontendUpdate ¶
type VDomFrontendUpdate struct {
Type string `json:"type" tstype:"\"frontendupdate\""`
Ts int64 `json:"ts"`
ClientId string `json:"clientid"`
ForceTakeover bool `json:"forcetakeover,omitempty"`
CorrelationId string `json:"correlationid,omitempty"`
Reason string `json:"reason,omitempty"`
Dispose bool `json:"dispose,omitempty"` // the vdom context was closed
Resync bool `json:"resync,omitempty"` // resync (send all backend data). useful when the FE reloads
RenderContext VDomRenderContext `json:"rendercontext,omitempty"`
Events []vdom.VDomEvent `json:"events,omitempty"`
RefUpdates []VDomRefUpdate `json:"refupdates,omitempty"`
Messages []VDomMessage `json:"messages,omitempty"`
}
type VDomMessage ¶
type VDomRefUpdate ¶
type VDomRefUpdate struct {
RefId string `json:"refid"`
HasCurrent bool `json:"hascurrent"`
Position *vdom.VDomRefPosition `json:"position,omitempty"`
}
type VDomRenderContext ¶
type VDomRenderUpdate ¶
type VDomRenderUpdate struct {
UpdateType string `json:"updatetype" tstype:"\"root\"|\"append\"|\"replace\"|\"remove\"|\"insert\""`
WaveId string `json:"waveid,omitempty"`
VDomWaveId string `json:"vdomwaveid,omitempty"`
VDom *RenderedElem `json:"vdom,omitempty"` // these get removed for transfer (encoded to transferelems)
Index *int `json:"index,omitempty"`
}
type VDomTransferElem ¶
type VDomTransferElem struct {
WaveId string `json:"waveid,omitempty"` // required, except for #text nodes
Tag string `json:"tag"`
Props map[string]any `json:"props,omitempty"`
Children []string `json:"children,omitempty"`
Text string `json:"text,omitempty"`
}
the over the wire format for a vdom element
func DedupTransferElems ¶
func DedupTransferElems(elems []VDomTransferElem) []VDomTransferElem
Click to show internal directories.
Click to hide internal directories.