Documentation
¶
Overview ¶
Package interop provides typed browser and JavaScript module helpers for routine client-side work without forcing applications to depend on raw syscall/js values for every storage, durable persistence, timer, clipboard, media-query, global bridge, custom event, or dynamic import interaction.
Index ¶
- Constants
- func ClientCanExchange(parseLocal ClientCapabilities, parsePeer ClientCapabilities, parseTopic string, ...) bool
- func ClientProtocolCompatible(parseLocal ClientCapabilities, parsePeer ClientCapabilities) bool
- func ClientSupportsEncoding(parseCapabilities ClientCapabilities, parseEncoding ClientPayloadEncoding) bool
- func ClientSupportsTopic(parseCapabilities ClientCapabilities, parseTopic string) bool
- func Decode(parseValue any, parseTarget any) error
- func Decrypt(parseCtx context.Context, parseKey CryptoKey, parseCiphertext []byte, ...) ([]byte, error)
- func Encrypt(parseCtx context.Context, parseKey CryptoKey, parsePlaintext []byte) ([]byte, []byte, error)
- func ExpireCookie(parseName string, parseOptions ...CookieOptions) error
- func GetCookie(parseName string) (string, bool, error)
- func IntlAvailable() bool
- func IntlFormatDate(parseLocale string, parseUnixMillis int64, parseOptions ...IntlDateOptions) (string, error)
- func IntlFormatNumber(parseLocale string, parseValue float64, parseOptions ...IntlNumberOptions) (string, error)
- func IsCode(parseErr error, parseCode ErrorCode) bool
- func IsStoragePersisted(parseCtx context.Context) (bool, error)
- func KeepAlive()
- func LoadPersistentJSON[T any](parseCtx context.Context, store PersistentStore, parseKey string) (T, bool, error)
- func PostNotification(parseTitle string, parseBody string) error
- func PublishClientBinaryCrossTab(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientBinaryWindow(parseChannel WindowChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientEvent(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientGoodbye(parseChannel CrossTabChannel, parseSelf ClientIdentity) error
- func PublishClientGoodbyeWindow(parseChannel WindowChannel, parseSelf ClientIdentity) error
- func PublishClientHello(parseChannel CrossTabChannel, parseSelf ClientIdentity) error
- func PublishClientHelloWindow(parseChannel WindowChannel, parseSelf ClientIdentity) error
- func PublishClientHelloWindowWithCapabilities(parseChannel WindowChannel, parseSelf ClientIdentity, ...) error
- func PublishClientHelloWithCapabilities(parseChannel CrossTabChannel, parseSelf ClientIdentity, ...) error
- func PublishClientIntent(parseChannel WindowChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientInvalidation(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientMessage(parseChannel CrossTabChannel, parseMessage ClientMessage) error
- func PublishClientQuery(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity) error
- func PublishClientResult(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, ...) error
- func PublishClientWindowMessage(parseChannel WindowChannel, parseMessage ClientMessage) error
- func PublishIntent(parseChannel WindowChannel, parseAction SurfaceIntentAction, ...) error
- func PublishLogout(parseChannel WindowChannel, parseReason string) error
- func PublishRouteFocus(parseChannel WindowChannel, parsePath string, parseQuery string, ...) error
- func PublishSelection(parseChannel WindowChannel, parseScope string, parseId string, ...) error
- func PublishSessionExpired(parseChannel WindowChannel, parseReason string, parseReturnTo string, ...) error
- func PublishSurfaceSignal(parseChannel WindowChannel, parseSignal SurfaceSignal) error
- func RecoverContainedPanic(parseSubject string)
- func RequestAnimationFrame(parseCallback func(parseTimestampMillis float64)) (parseCancel func())
- func RequestPersistentStorage(parseCtx context.Context) (bool, error)
- func RequestWorkerDecoded[Req any, Progress any, Result any](parseCtx context.Context, parseWorker WorkerRequester, parseName string, ...) (Result, error)
- func SetContainedPanicHandler(parseHandler func(parseSubject string, parseRecovered any))
- func SetCookie(parseName string, parseValue string, parseOptions ...CookieOptions) error
- type BrowserEvent
- type ClientBinaryPayload
- type ClientCapabilities
- type ClientIdentity
- type ClientMessage
- type ClientMessageKind
- type ClientPayloadEncoding
- type Clipboard
- type CookieOptions
- type CrossTabChannel
- func (parseC CrossTabChannel) Close() error
- func (parseC CrossTabChannel) Name() string
- func (parseC CrossTabChannel) Publish(parsePayload any) error
- func (parseC CrossTabChannel) Subscribe(parseHandler func(CrossTabEnvelope, error)) (Subscription, error)
- func (parseC CrossTabChannel) Transport() string
- type CrossTabChannelOptions
- type CrossTabEnvelope
- type CryptoKey
- type CustomEvent
- type DecodedCrossTabEnvelope
- type DecodedCustomEvent
- type DecodedMessagePortMessage
- type DecodedWindowEnvelope
- type DecodedWorkerMessage
- type Document
- func (parseD Document) ElementByID(parseId string) (Element, bool, error)
- func (parseD Document) ElementsByID(parseIds ...string) (map[string]Element, error)
- func (parseD Document) QuerySelector(parseSelector string) (Element, bool, error)
- func (parseD Document) SetTitle(parseTitle string) error
- func (parseD Document) Title() (string, error)
- type Element
- func (parseE Element) Blur() error
- func (parseE Element) BoundingClientRect() (Rect, error)
- func (parseE Element) ClassName() string
- func (parseE Element) Click() error
- func (parseE Element) Dispatch(parseName string, parseDetail any) error
- func (parseE Element) Events() (EventTarget, error)
- func (parseE Element) Focus() error
- func (parseE Element) ID() string
- func (parseE Element) Listen(parseName string, parseHandler func(BrowserEvent)) (Subscription, error)
- func (parseE Element) ObserveIntersection(parseHandler func(IntersectionEntry), ...) (Subscription, error)
- func (parseE Element) ObserveResize(parseHandler func(ResizeEntry)) (Subscription, error)
- func (parseE Element) ScrollIntoView(parseOptions ...ScrollIntoViewOptions) error
- func (parseE Element) ScrollMetrics() (parseScrollTop, parseScrollHeight, parseClientHeight float64, parseErr error)
- func (parseE Element) SetScrollTop(parseScrollTop float64) error
- func (parseE Element) Subscribe(parseName string, parseHandler func(CustomEvent)) (Subscription, error)
- func (parseE Element) TagName() string
- type EncryptedStore
- type Error
- type ErrorCode
- type EventTarget
- type GoWASMWorkerOptions
- type History
- func (parseH History) Back() error
- func (parseH History) Forward() error
- func (parseH History) Go(parseDelta int) error
- func (parseH History) Len() (int, error)
- func (parseH History) PushState(parseState any, parseTitle string, parseRawURL string) error
- func (parseH History) ReplaceState(parseState any, parseTitle string, parseRawURL string) error
- func (parseH History) State() (any, error)
- type IntersectionEntry
- type IntersectionObserverOptions
- type IntlDateOptions
- type IntlNumberOptions
- type Location
- func (parseL Location) Assign(parseRawURL string) error
- func (parseL Location) Hash() string
- func (parseL Location) Href() string
- func (parseL Location) Origin() string
- func (parseL Location) Pathname() string
- func (parseL Location) Reload() error
- func (parseL Location) Replace(parseRawURL string) error
- func (parseL Location) Search() string
- type MediaQueryEvent
- type MediaQueryList
- type MessageChannel
- type MessagePort
- func (parseP MessagePort) Close() error
- func (parseP MessagePort) GetMessagePortRaw() any
- func (parseP MessagePort) Post(parsePayload any) error
- func (parseP MessagePort) PostPorts(parsePayload any, parsePorts ...MessagePort) error
- func (parseP MessagePort) Subscribe(parseHandler func(MessagePortMessage, error)) (Subscription, error)
- type MessagePortMessage
- type Module
- func (parseM Module) Call(parseCtx context.Context, parseExport string, parseArgs ...any) (any, error)
- func (parseM Module) CallDefault(parseCtx context.Context, parseArgs ...any) (any, error)
- func (parseM Module) Dispose() error
- func (parseM Module) Value(parseCtx context.Context, parseExport string) (any, error)
- type NotificationPermission
- type PersistentStore
- func (parseS PersistentStore) Backend() string
- func (parseS PersistentStore) Clear(parseCtx context.Context) error
- func (parseS PersistentStore) Close() error
- func (parseS PersistentStore) DecodeJSON(parseCtx context.Context, parseKey string, parseTarget any) (bool, error)
- func (parseS PersistentStore) GetItem(parseCtx context.Context, parseKey string) (string, bool, error)
- func (parseS PersistentStore) GetMany(parseCtx context.Context, parseKeys ...string) (map[string]string, error)
- func (parseS PersistentStore) Keys(parseCtx context.Context) ([]string, error)
- func (parseS PersistentStore) Len(parseCtx context.Context) (int, error)
- func (parseS PersistentStore) RemoveItem(parseCtx context.Context, parseKey string) error
- func (parseS PersistentStore) SetItem(parseCtx context.Context, parseKey string, parseValue string) error
- func (parseS PersistentStore) SetJSON(parseCtx context.Context, parseKey string, parseValue any) error
- type PersistentStoreBlockedEvent
- type PersistentStoreOptions
- type Rect
- type ResizeEntry
- type SameSite
- type ScrollIntoViewOptions
- type SharedBuffer
- func (parseB SharedBuffer) AddInt32(parseIndex int, parseDelta int32) (int32, error)
- func (parseB SharedBuffer) AndInt32(parseIndex int, parseMask int32) (int32, error)
- func (parseB SharedBuffer) CompareExchangeInt32(parseIndex int, parseOldValue int32, parseNewValue int32) (int32, error)
- func (parseB SharedBuffer) ExchangeInt32(parseIndex int, parseValue int32) (int32, error)
- func (parseB SharedBuffer) GetByteLength() int
- func (parseB SharedBuffer) GetInt32Length() int
- func (parseB SharedBuffer) GetSharedBufferRaw() any
- func (parseB SharedBuffer) LoadInt32(parseIndex int) (int32, error)
- func (parseB SharedBuffer) NotifyInt32(parseIndex int, parseCount int) (int, error)
- func (parseB SharedBuffer) OrInt32(parseIndex int, parseMask int32) (int32, error)
- func (parseB SharedBuffer) ReadBytes(parseOffset int, parseDest []byte) (int, error)
- func (parseB SharedBuffer) StoreInt32(parseIndex int, parseValue int32) error
- func (parseB SharedBuffer) SubInt32(parseIndex int, parseDelta int32) (int32, error)
- func (parseB SharedBuffer) WaitInt32(parseIndex int, parseExpected int32, parseTimeout time.Duration) (WaitResult, error)
- func (parseB SharedBuffer) WriteBytes(parseOffset int, parseSource []byte) (int, error)
- func (parseB SharedBuffer) XorInt32(parseIndex int, parseMask int32) (int32, error)
- type SharedMemorySupport
- type Storage
- func (parseS Storage) Clear() error
- func (parseS Storage) GetItem(parseKey string) (string, bool, error)
- func (parseS Storage) GetMany(parseKeys ...string) (map[string]string, error)
- func (parseS Storage) Key(parseIndex int) (string, bool, error)
- func (parseS Storage) Len() (int, error)
- func (parseS Storage) RemoveItem(parseKey string) error
- func (parseS Storage) SetItem(parseKey string, parseValue string) error
- type Subscription
- func SubscribeClientMessages(parseChannel CrossTabChannel, parseHandler func(ClientMessage, error)) (Subscription, error)
- func SubscribeClientWindowMessages(parseChannel WindowChannel, parseHandler func(ClientMessage, error)) (Subscription, error)
- func SubscribeDecoded[T any](parseTarget EventTarget, parseName string, ...) (Subscription, error)
- func SubscribeDecodedCrossTab[T any](parseChannel CrossTabChannel, ...) (Subscription, error)
- func SubscribeDecodedMessagePort[T any](parsePort MessagePort, parseHandler func(DecodedMessagePortMessage[T], error)) (Subscription, error)
- func SubscribeDecodedWindow[T any](parseChannel WindowChannel, parseHandler func(DecodedWindowEnvelope[T], error)) (Subscription, error)
- func SubscribeDecodedWorker[T any](parseWorker Worker, parseHandler func(DecodedWorkerMessage[T], error)) (Subscription, error)
- func SubscribeSurfaceSignals(parseChannel WindowChannel, ...) (Subscription, error)
- type SurfaceIntentAction
- type SurfaceIntentSignal
- type SurfaceRouteSignal
- type SurfaceSelectionSignal
- type SurfaceSessionSignal
- type SurfaceSignal
- type SurfaceSignalKind
- type Timer
- func ScheduleInterval(parseTimerInterval time.Duration, parseTimerFn func()) (Timer, error)
- func ScheduleTimeout(parseTimerDelay time.Duration, parseTimerFn func()) (Timer, error)
- func SetInterval(parseTimerInterval time.Duration, parseTimerFn func()) (Timer, error)
- func SetTimeout(parseTimerDelay time.Duration, parseTimerFn func()) (Timer, error)
- type Value
- func (parseV Value) Await(parseCtx context.Context) (Value, error)
- func (parseV Value) AwaitCall(parseCtx context.Context, parseMethod string, parseArgs ...any) (Value, error)
- func (parseValue Value) Bool() bool
- func (parseValue Value) Call(parseMethodName string, parseMethodArgs ...any) (Value, error)
- func (parseValue Value) Delete(parseValueName string) error
- func (parseValue Value) Float() float64
- func (parseValue Value) Get(parseValueName string) Value
- func (parseValue Value) Int() int
- func (parseValue Value) Invoke(parseCallArgs ...any) (Value, error)
- func (parseValue Value) IsNull() bool
- func (parseValue Value) IsUndefined() bool
- func (parseValue Value) Present() bool
- func (parseValue Value) Set(parseValueName string, parseValueData any) error
- func (parseValue Value) SetFunction(parseFunctionName string, parseFunctionHandler func(args ...Value) any) (Subscription, error)
- func (parseValue Value) String() string
- func (parseValue Value) ToGo() (any, error)
- func (parseValue Value) Truthy() bool
- type WaitResult
- type WindowChannel
- func (parseC WindowChannel) Close() error
- func (parseC WindowChannel) Closed() bool
- func (parseC WindowChannel) Focus() error
- func (parseC WindowChannel) Name() string
- func (parseC WindowChannel) Publish(parsePayload any) error
- func (parseC WindowChannel) Subscribe(parseHandler func(WindowEnvelope, error)) (Subscription, error)
- func (parseC WindowChannel) TargetOrigin() string
- type WindowChannelOptions
- type WindowEnv
- type WindowEnvelope
- type Worker
- func NewGoWASMWorker(parseWorkerCtx context.Context, parseWorkerOptions GoWASMWorkerOptions) (Worker, error)
- func OpenGoWASMWorker(parseWorkerCtx context.Context, parseWorkerOptions GoWASMWorkerOptions) (Worker, error)
- func OpenWorker(parseWorkerCtx context.Context, parseWorkerOptions WorkerOptions) (Worker, error)
- func (parseW Worker) Post(parseMessage any) error
- func (parseW Worker) PostPorts(parseMessage any, parsePorts ...MessagePort) error
- func (parseW Worker) Request(parseCtx context.Context, parseName string, parsePayload any, ...) (WorkerMessage, error)
- func (parseW Worker) Restart(parseCtx context.Context) error
- func (parseW Worker) Subscribe(parseHandler func(WorkerMessage, error)) (Subscription, error)
- func (parseW Worker) Terminate() error
- type WorkerMessage
- type WorkerOptions
- type WorkerPool
- func (parseP WorkerPool) Close() error
- func (parseP WorkerPool) Drain(parseCtx context.Context) error
- func (parseP WorkerPool) GetQueueLimit() intdeprecated
- func (parseP WorkerPool) GetSize() intdeprecated
- func (parseP WorkerPool) QueueLimit() int
- func (parseP WorkerPool) Request(parseCtx context.Context, parseName string, parsePayload any, ...) (WorkerMessage, error)
- func (parseP WorkerPool) Size() int
- type WorkerPoolOptions
- type WorkerRequester
- type WorkerScope
- func (parseW WorkerScope) Error(parseId string, parseName string, parseErrText string, parsePayload any) error
- func (parseW WorkerScope) Message(parseName string, parsePayload any) error
- func (parseW WorkerScope) Post(parseMessage WorkerMessage) error
- func (parseW WorkerScope) PostPorts(parseMessage WorkerMessage, parsePorts ...MessagePort) error
- func (parseW WorkerScope) Progress(parseId string, parseName string, parsePayload any) error
- func (parseW WorkerScope) Ready(parseName string) error
- func (parseW WorkerScope) Result(parseId string, parseName string, parsePayload any) error
- func (parseW WorkerScope) Subscribe(parseHandler func(WorkerMessage, error)) (Subscription, error)
Constants ¶
const ClientPresenceTopic = "clients"
Variables ¶
This section is empty.
Functions ¶
func ClientCanExchange ¶
func ClientCanExchange(parseLocal ClientCapabilities, parsePeer ClientCapabilities, parseTopic string, parseEncoding ClientPayloadEncoding) bool
ClientCanExchange reports whether two clients can communicate on a topic with a shared encoding.
func ClientProtocolCompatible ¶
func ClientProtocolCompatible(parseLocal ClientCapabilities, parsePeer ClientCapabilities) bool
ClientProtocolCompatible reports whether two capability sets share a compatible protocol major version.
func ClientSupportsEncoding ¶
func ClientSupportsEncoding(parseCapabilities ClientCapabilities, parseEncoding ClientPayloadEncoding) bool
ClientSupportsEncoding reports whether the capabilities include the given payload encoding.
func ClientSupportsTopic ¶
func ClientSupportsTopic(parseCapabilities ClientCapabilities, parseTopic string) bool
ClientSupportsTopic reports whether the capabilities include the given topic (empty topic list means all).
func Decrypt ¶
func Decrypt(parseCtx context.Context, parseKey CryptoKey, parseCiphertext []byte, parseIV []byte) ([]byte, error)
Decrypt is a non-browser stub that always returns an unavailable error.
func Encrypt ¶
func Encrypt(parseCtx context.Context, parseKey CryptoKey, parsePlaintext []byte) ([]byte, []byte, error)
Encrypt is a non-browser stub that always returns an unavailable error.
func ExpireCookie ¶
func ExpireCookie(parseName string, parseOptions ...CookieOptions) error
ExpireCookie deletes a cookie by setting Max-Age to -1. Any options passed should match the path and domain used when the cookie was set.
func GetCookie ¶
GetCookie reads a cookie by name from document.cookie, returning the URL-decoded value and a found bool. An error is returned when the underlying platform read fails.
func IntlAvailable ¶
func IntlAvailable() bool
IntlAvailable reports whether the browser Intl API is available. On native and SSR builds this always returns false; callers should fall back to the Go i18n formatters (e.g. i18n.FormatNumber / i18n.FormatDate). This bridge is browser-only by design.
func IntlFormatDate ¶
func IntlFormatDate(parseLocale string, parseUnixMillis int64, parseOptions ...IntlDateOptions) (string, error)
IntlFormatDate is a non-browser stub that always returns an unavailable error. On native builds callers should fall back to the Go i18n formatters.
func IntlFormatNumber ¶
func IntlFormatNumber(parseLocale string, parseValue float64, parseOptions ...IntlNumberOptions) (string, error)
IntlFormatNumber is a non-browser stub that always returns an unavailable error. On native builds callers should fall back to the Go i18n formatters.
func IsStoragePersisted ¶
IsStoragePersisted is a non-browser stub that always returns an unavailable error.
func KeepAlive ¶
func KeepAlive()
KeepAlive blocks the calling goroutine forever.
In js/wasm programs it keeps main alive after the UI mounts: if main returned, the Go runtime would exit and invalidate every registered event callback, so the app would die on the first interaction. It is the single keep-alive primitive shared by utils.WaitForever and ui.Run, kept in this leaf package so both can reuse it without an import cycle.
func LoadPersistentJSON ¶
func PostNotification ¶
PostNotification is unavailable on non-browser builds.
func PublishClientBinaryCrossTab ¶
func PublishClientBinaryCrossTab(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, parsePayload ClientBinaryPayload) error
PublishClientBinaryCrossTab sends a binary ClientEvent on a CrossTabChannel.
func PublishClientBinaryWindow ¶
func PublishClientBinaryWindow(parseChannel WindowChannel, parseTopic string, parseSelf ClientIdentity, parseTarget string, parsePayload ClientBinaryPayload) error
PublishClientBinaryWindow sends a binary ClientEvent on a WindowChannel to a specific target.
func PublishClientEvent ¶
func PublishClientEvent(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, parsePayload any) error
PublishClientEvent sends a ClientEvent message on a CrossTabChannel to a named topic.
func PublishClientGoodbye ¶
func PublishClientGoodbye(parseChannel CrossTabChannel, parseSelf ClientIdentity) error
PublishClientGoodbye sends a ClientGoodbye presence message on a CrossTabChannel.
func PublishClientGoodbyeWindow ¶
func PublishClientGoodbyeWindow(parseChannel WindowChannel, parseSelf ClientIdentity) error
PublishClientGoodbyeWindow sends a ClientGoodbye presence message on a WindowChannel.
func PublishClientHello ¶
func PublishClientHello(parseChannel CrossTabChannel, parseSelf ClientIdentity) error
PublishClientHello sends a ClientHello presence message on a CrossTabChannel with default capabilities.
func PublishClientHelloWindow ¶
func PublishClientHelloWindow(parseChannel WindowChannel, parseSelf ClientIdentity) error
PublishClientHelloWindow sends a ClientHello presence message on a WindowChannel with default capabilities.
func PublishClientHelloWindowWithCapabilities ¶
func PublishClientHelloWindowWithCapabilities(parseChannel WindowChannel, parseSelf ClientIdentity, parseCapabilities ClientCapabilities) error
PublishClientHelloWindowWithCapabilities sends a ClientHello presence message on a WindowChannel with explicit capabilities.
func PublishClientHelloWithCapabilities ¶
func PublishClientHelloWithCapabilities(parseChannel CrossTabChannel, parseSelf ClientIdentity, parseCapabilities ClientCapabilities) error
PublishClientHelloWithCapabilities sends a ClientHello presence message on a CrossTabChannel with explicit capabilities.
func PublishClientIntent ¶
func PublishClientIntent(parseChannel WindowChannel, parseTopic string, parseSelf ClientIdentity, parseTarget string, parsePayload any) error
PublishClientIntent sends a directed ClientIntent message on a WindowChannel.
func PublishClientInvalidation ¶
func PublishClientInvalidation(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, parseRevision string) error
PublishClientInvalidation sends a ClientInvalidate message on a CrossTabChannel for a given topic and revision.
func PublishClientMessage ¶
func PublishClientMessage(parseChannel CrossTabChannel, parseMessage ClientMessage) error
PublishClientMessage encodes and sends a ClientMessage over a CrossTabChannel.
func PublishClientQuery ¶
func PublishClientQuery(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity) error
PublishClientQuery sends a ClientQuery message on a CrossTabChannel for a given topic.
func PublishClientResult ¶
func PublishClientResult(parseChannel CrossTabChannel, parseTopic string, parseSelf ClientIdentity, parseTarget string, parsePayload any) error
PublishClientResult sends a directed ClientResult message on a CrossTabChannel.
func PublishClientWindowMessage ¶
func PublishClientWindowMessage(parseChannel WindowChannel, parseMessage ClientMessage) error
PublishClientWindowMessage encodes and sends a ClientMessage over a WindowChannel.
func PublishIntent ¶
func PublishIntent(parseChannel WindowChannel, parseAction SurfaceIntentAction, parseTarget string, parseParams map[string]string) error
PublishIntent sends an intent surface signal on a WindowChannel.
func PublishLogout ¶
func PublishLogout(parseChannel WindowChannel, parseReason string) error
PublishLogout sends a signed-out session signal on a WindowChannel.
func PublishRouteFocus ¶
func PublishRouteFocus(parseChannel WindowChannel, parsePath string, parseQuery string, parseFocusID string) error
PublishRouteFocus sends a route-focus surface signal on a WindowChannel.
func PublishSelection ¶
func PublishSelection(parseChannel WindowChannel, parseScope string, parseId string, parseRevision string) error
PublishSelection sends a selection surface signal on a WindowChannel.
func PublishSessionExpired ¶
func PublishSessionExpired(parseChannel WindowChannel, parseReason string, parseReturnTo string, parseExpiresAt time.Time) error
PublishSessionExpired sends a session-expired signal on a WindowChannel.
func PublishSurfaceSignal ¶
func PublishSurfaceSignal(parseChannel WindowChannel, parseSignal SurfaceSignal) error
PublishSurfaceSignal validates and sends a SurfaceSignal over a WindowChannel.
func RecoverContainedPanic ¶
func RecoverContainedPanic(parseSubject string)
RecoverContainedPanic contains a panic raised inside a host callback (js.FuncOf body, worker message handler, IndexedDB event). Deferred at the top of the callback it stops the panic from unwinding into the JS bridge, which would kill the whole wasm program and leave the page dead.
func RequestAnimationFrame ¶
func RequestAnimationFrame(parseCallback func(parseTimestampMillis float64)) (parseCancel func())
RequestAnimationFrame is a non-browser stub. On native builds there is no display rendering pipeline, so the callback is never invoked. The returned cancel func is a no-op but is always non-nil so callers can call it unconditionally without a nil check.
Browser (GOOS=js GOARCH=wasm) builds use the real requestAnimationFrame API instead; see raf_wasm.go.
func RequestPersistentStorage ¶
RequestPersistentStorage is a non-browser stub that always returns an unavailable error.
func RequestWorkerDecoded ¶
func RequestWorkerDecoded[Req any, Progress any, Result any](parseCtx context.Context, parseWorker WorkerRequester, parseName string, parsePayload Req, parseOnProgress func(DecodedWorkerMessage[Progress], error)) (Result, error)
RequestWorkerDecoded issues a typed request against any worker-compatible requester surface and decodes both progress and final result payloads.
func SetContainedPanicHandler ¶
SetContainedPanicHandler installs the crash-report sink used by RecoverContainedPanic. Passing nil restores the plain-print fallback.
func SetCookie ¶
func SetCookie(parseName string, parseValue string, parseOptions ...CookieOptions) error
SetCookie writes a cookie with the given name, value, and options. Passing no options produces a session cookie with no path, domain, or security attributes. When SameSite is SameSiteNone the Secure flag is forced on.
Types ¶
type BrowserEvent ¶
type ClientBinaryPayload ¶
type ClientCapabilities ¶
type ClientCapabilities struct {
ProtocolVersion string `json:"protocolVersion,omitempty"`
Transports []string `json:"transports,omitempty"`
Encodings []string `json:"encodings,omitempty"`
Topics []string `json:"topics,omitempty"`
MaxJSONBytes int `json:"maxJsonBytes,omitempty"`
MaxBinaryBytes int `json:"maxBinaryBytes,omitempty"`
}
type ClientIdentity ¶
type ClientMessage ¶
type ClientMessage struct {
ID string `json:"id,omitempty"`
Kind ClientMessageKind `json:"kind"`
Topic string `json:"topic"`
Source ClientIdentity `json:"source"`
Capabilities *ClientCapabilities `json:"capabilities,omitempty"`
Target string `json:"target,omitempty"`
Encoding ClientPayloadEncoding `json:"encoding,omitempty"`
ContentType string `json:"contentType,omitempty"`
Payload any `json:"payload,omitempty"`
Revision string `json:"revision,omitempty"`
Error string `json:"error,omitempty"`
SentAt time.Time `json:"sentAt"`
}
func DecodeClientMessage ¶
func DecodeClientMessage(parseValue any) (ClientMessage, error)
type ClientMessageKind ¶
type ClientMessageKind string
const ( ClientHello ClientMessageKind = "hello" ClientGoodbye ClientMessageKind = "goodbye" ClientEvent ClientMessageKind = "event" ClientIntent ClientMessageKind = "intent" ClientQuery ClientMessageKind = "query" ClientResult ClientMessageKind = "result" ClientInvalidate ClientMessageKind = "invalidate" ClientError ClientMessageKind = "error" )
type ClientPayloadEncoding ¶
type ClientPayloadEncoding string
const ( ClientPayloadJSON ClientPayloadEncoding = "json" ClientPayloadBinary ClientPayloadEncoding = "binary" )
type Clipboard ¶
type Clipboard struct {
// contains filtered or unexported fields
}
func GetClipboard ¶
GetClipboard is a non-browser stub that always returns an unavailable error.
func NavigatorClipboard ¶
NavigatorClipboard preserves the legacy clipboard accessor name.
type CookieOptions ¶
type CookieOptions struct {
Path string
Domain string
MaxAge int // seconds; 0 = session cookie; negative = expire now
Secure bool
SameSite SameSite
}
CookieOptions configures optional cookie attributes.
type CrossTabChannel ¶
type CrossTabChannel struct {
// contains filtered or unexported fields
}
func OpenCrossTabChannel ¶
func OpenCrossTabChannel(parseChannelOptions CrossTabChannelOptions) (CrossTabChannel, error)
OpenCrossTabChannel is a non-browser stub that always returns an unavailable error.
func (CrossTabChannel) Close ¶
func (parseC CrossTabChannel) Close() error
func (CrossTabChannel) Name ¶
func (parseC CrossTabChannel) Name() string
func (CrossTabChannel) Publish ¶
func (parseC CrossTabChannel) Publish(parsePayload any) error
func (CrossTabChannel) Subscribe ¶
func (parseC CrossTabChannel) Subscribe(parseHandler func(CrossTabEnvelope, error)) (Subscription, error)
func (CrossTabChannel) Transport ¶
func (parseC CrossTabChannel) Transport() string
type CrossTabChannelOptions ¶
type CrossTabEnvelope ¶
type CryptoKey ¶
type CryptoKey struct {
// contains filtered or unexported fields
}
CryptoKey is an opaque handle wrapping a non-extractable AES-GCM key generated by the browser's WebCrypto API. On native builds the underlying field is always nil; on WASM builds it holds the live js.Value.
type CustomEvent ¶
type DecodedCrossTabEnvelope ¶
type DecodedCrossTabEnvelope[T any] struct { Name string Payload T Source string Sequence int64 SentAt time.Time }
func DecodeCrossTabEnvelope ¶
func DecodeCrossTabEnvelope[T any](parseMessage CrossTabEnvelope) (DecodedCrossTabEnvelope[T], error)
type DecodedCustomEvent ¶
func DecodeCustomEvent ¶
func DecodeCustomEvent[T any](parseEvent CustomEvent) (DecodedCustomEvent[T], error)
DecodeCustomEvent projects a custom-event detail payload into a typed value.
type DecodedMessagePortMessage ¶
type DecodedMessagePortMessage[T any] struct { Payload T Ports []MessagePort }
DecodedMessagePortMessage carries a typed payload received on a MessagePort together with any transferred ports attached to the same event.
func DecodeMessagePortMessage ¶
func DecodeMessagePortMessage[T any](parseMessage MessagePortMessage) (DecodedMessagePortMessage[T], error)
DecodeMessagePortMessage projects a message-port payload into a typed value.
type DecodedWindowEnvelope ¶
func DecodeSurfaceSignal ¶
func DecodeSurfaceSignal(parseMessage WindowEnvelope) (DecodedWindowEnvelope[SurfaceSignal], error)
DecodeSurfaceSignal decodes a WindowEnvelope payload as a SurfaceSignal.
func DecodeWindowEnvelope ¶
func DecodeWindowEnvelope[T any](parseMessage WindowEnvelope) (DecodedWindowEnvelope[T], error)
type DecodedWorkerMessage ¶
type DecodedWorkerMessage[T any] struct { ID string Phase string Name string Payload T Error string Ports []MessagePort }
func DecodeWorkerMessage ¶
func DecodeWorkerMessage[T any](parseMessage WorkerMessage) (DecodedWorkerMessage[T], error)
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func CurrentDocument ¶
CurrentDocument preserves the legacy document accessor name.
func GetDocument ¶
GetDocument is a non-browser stub that always returns an unavailable error.
func (Document) ElementByID ¶
func (Document) ElementsByID ¶
func (Document) QuerySelector ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
func (Element) BoundingClientRect ¶
func (Element) Events ¶
func (parseE Element) Events() (EventTarget, error)
func (Element) Listen ¶
func (parseE Element) Listen(parseName string, parseHandler func(BrowserEvent)) (Subscription, error)
func (Element) ObserveIntersection ¶
func (parseE Element) ObserveIntersection(parseHandler func(IntersectionEntry), parseOptions ...IntersectionObserverOptions) (Subscription, error)
func (Element) ObserveResize ¶
func (parseE Element) ObserveResize(parseHandler func(ResizeEntry)) (Subscription, error)
func (Element) ScrollIntoView ¶
func (parseE Element) ScrollIntoView(parseOptions ...ScrollIntoViewOptions) error
func (Element) ScrollMetrics ¶
func (parseE Element) ScrollMetrics() (parseScrollTop, parseScrollHeight, parseClientHeight float64, parseErr error)
ScrollMetrics returns the scrollTop, scrollHeight, and clientHeight of the element — the three values needed to determine scroll position within a scrollable container.
func (Element) SetScrollTop ¶
func (Element) Subscribe ¶
func (parseE Element) Subscribe(parseName string, parseHandler func(CustomEvent)) (Subscription, error)
type EncryptedStore ¶
type EncryptedStore struct {
// contains filtered or unexported fields
}
EncryptedStore combines a CryptoKey with a Storage backend to provide transparent JSON-marshal-then-encrypt persistence. Values are stored as a base64-encoded envelope: "<base64(iv)>:<base64(ciphertext)>".
func NewEncryptedStore ¶
func NewEncryptedStore(parseKey CryptoKey) (EncryptedStore, error)
NewEncryptedStore returns a zero EncryptedStore; all methods on it return unavailable errors.
type Error ¶
Error reports a structured interop failure.
type ErrorCode ¶
type ErrorCode string
const ( CodePromiseRejected ErrorCode = "promise_rejected" CodeDisposed ErrorCode = "disposed" CodeEncode ErrorCode = "encode" CodeDecode ErrorCode = "decode" CodeMissingExport ErrorCode = "missing_export" CodeNotFunction ErrorCode = "not_function" CodeInvalid ErrorCode = "invalid" CodeBlocked ErrorCode = "blocked" CodeQuotaExceeded ErrorCode = "quota_exceeded" CodeCancelled ErrorCode = "cancelled" CodeTimeout ErrorCode = "timeout" CodeRemote ErrorCode = "remote_error" )
type EventTarget ¶
type EventTarget struct {
// contains filtered or unexported fields
}
func GetDocumentEvents ¶
func GetDocumentEvents() (EventTarget, error)
GetDocumentEvents is a non-browser stub that always returns an unavailable error.
func GetWindowEvents ¶
func GetWindowEvents() (EventTarget, error)
GetWindowEvents is a non-browser stub that always returns an unavailable error.
func (EventTarget) Dispatch ¶
func (parseT EventTarget) Dispatch(parseName string, parseDetail any) error
func (EventTarget) Listen ¶
func (parseT EventTarget) Listen(parseName string, parseHandler func(BrowserEvent)) (Subscription, error)
func (EventTarget) Subscribe ¶
func (parseT EventTarget) Subscribe(parseName string, parseHandler func(CustomEvent)) (Subscription, error)
type GoWASMWorkerOptions ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
func GetWindowHistory ¶
GetWindowHistory is a non-browser stub that always returns an unavailable error.
func (History) ReplaceState ¶
type IntersectionEntry ¶
type IntlDateOptions ¶
type IntlDateOptions struct {
// DateStyle is the date display style: "full", "long", "medium", or
// "short". Empty omits the option.
DateStyle string
// TimeStyle is the time display style: "full", "long", "medium", or
// "short". Empty omits the option.
TimeStyle string
// TimeZone is the IANA time-zone name (e.g. "America/New_York"). Empty
// omits the option, letting the browser use its local zone.
TimeZone string
}
IntlDateOptions configures a browser Intl.DateTimeFormat instance. Fields map directly to the JS options bag passed to the Intl.DateTimeFormat constructor. Leaving DateStyle and TimeStyle empty lets the browser apply its defaults.
type IntlNumberOptions ¶
type IntlNumberOptions struct {
// Style is the formatting style: "decimal" (default), "currency", or
// "percent".
Style string
// Currency is the ISO 4217 currency code (e.g. "USD"). Required when Style
// is "currency".
Currency string
// MinimumFractionDigits sets the minimum number of fraction digits.
MinimumFractionDigits int
// MaximumFractionDigits sets the maximum number of fraction digits. A zero
// value leaves the option unset (JS default applies).
MaximumFractionDigits int
// UseGrouping controls digit grouping separators (e.g. thousands commas).
// Matches the JS useGrouping option. nil leaves the option unset so the
// browser default applies (grouping on); a non-nil pointer forces the value.
// A plain bool could not distinguish "unset" from "explicitly false", which
// would wrongly suppress grouping on every call that did not set it.
UseGrouping *bool
}
IntlNumberOptions configures a browser Intl.NumberFormat instance. Fields map directly to the JS options bag passed to the Intl.NumberFormat constructor. The zero value produces decimal formatting with grouping enabled.
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
func GetWindowLocation ¶
GetWindowLocation is a non-browser stub that always returns an unavailable error.
type MediaQueryEvent ¶
type MediaQueryList ¶
type MediaQueryList struct {
// contains filtered or unexported fields
}
func GetMediaQuery ¶
func GetMediaQuery(parseMediaQuery string) (MediaQueryList, error)
GetMediaQuery is a non-browser stub that always returns an unavailable error.
func (MediaQueryList) Matches ¶
func (parseM MediaQueryList) Matches() bool
func (MediaQueryList) Media ¶
func (parseM MediaQueryList) Media() string
func (MediaQueryList) Subscribe ¶
func (parseM MediaQueryList) Subscribe(parseHandler func(MediaQueryEvent)) (Subscription, error)
type MessageChannel ¶
type MessageChannel struct {
// contains filtered or unexported fields
}
MessageChannel wraps the two linked endpoints produced by the browser MessageChannel constructor.
func OpenMessageChannel ¶
func OpenMessageChannel() (MessageChannel, error)
OpenMessageChannel is a non-browser stub that always returns an unavailable error.
func (MessageChannel) Port1 ¶
func (parseC MessageChannel) Port1() MessagePort
Port1 returns the first endpoint of the message channel.
func (MessageChannel) Port2 ¶
func (parseC MessageChannel) Port2() MessagePort
Port2 returns the second endpoint of the message channel.
type MessagePort ¶
type MessagePort struct {
// contains filtered or unexported fields
}
MessagePort wraps a browser MessagePort with post, subscribe, and close helpers suitable for worker-owned subchannels.
func (MessagePort) GetMessagePortRaw ¶
func (parseP MessagePort) GetMessagePortRaw() any
GetMessagePortRaw returns the platform-specific message-port handle.
func (MessagePort) Post ¶
func (parseP MessagePort) Post(parsePayload any) error
Post sends a payload over the message port.
func (MessagePort) PostPorts ¶
func (parseP MessagePort) PostPorts(parsePayload any, parsePorts ...MessagePort) error
PostPorts sends a payload over the message port together with transferred MessagePorts.
func (MessagePort) Subscribe ¶
func (parseP MessagePort) Subscribe(parseHandler func(MessagePortMessage, error)) (Subscription, error)
Subscribe receives payloads from the message port.
type MessagePortMessage ¶
type MessagePortMessage struct {
Payload any
Ports []MessagePort
}
MessagePortMessage carries one payload received on a MessagePort together with any transferred ports attached to the same event.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func ImportModule ¶
ImportModule is a non-browser stub that always returns an unavailable error.
func (Module) CallDefault ¶
type NotificationPermission ¶
type NotificationPermission string
NotificationPermission is the browser Notification permission state.
const ( // NotificationDefault means the user has not yet granted or denied permission. NotificationDefault NotificationPermission = "default" // NotificationGranted means notifications are allowed. NotificationGranted NotificationPermission = "granted" // NotificationDenied means notifications are blocked. NotificationDenied NotificationPermission = "denied" )
func NotificationPermissionState ¶
func NotificationPermissionState() (NotificationPermission, error)
NotificationPermissionState is unavailable on non-browser builds.
func RequestNotificationPermission ¶
func RequestNotificationPermission(parseCtx context.Context) (NotificationPermission, error)
RequestNotificationPermission is unavailable on non-browser builds.
type PersistentStore ¶
type PersistentStore struct {
// contains filtered or unexported fields
}
func OpenPersistentStore ¶
func OpenPersistentStore(parseStoreCtx context.Context, parseStoreOptions PersistentStoreOptions) (PersistentStore, error)
OpenPersistentStore is a non-browser stub that always returns an unavailable error.
func (PersistentStore) Backend ¶
func (parseS PersistentStore) Backend() string
func (PersistentStore) Close ¶
func (parseS PersistentStore) Close() error
func (PersistentStore) DecodeJSON ¶
func (PersistentStore) Keys ¶
func (parseS PersistentStore) Keys(parseCtx context.Context) ([]string, error)
func (PersistentStore) Len ¶
func (parseS PersistentStore) Len(parseCtx context.Context) (int, error)
func (PersistentStore) RemoveItem ¶
func (parseS PersistentStore) RemoveItem(parseCtx context.Context, parseKey string) error
type PersistentStoreOptions ¶
type ResizeEntry ¶
type ScrollIntoViewOptions ¶
type SharedBuffer ¶
type SharedBuffer struct {
// contains filtered or unexported fields
}
SharedBuffer wraps a browser SharedArrayBuffer with byte access and int32 atomic helpers for worker coordination.
func OpenSharedBuffer ¶
func OpenSharedBuffer(parseByteLength int) (SharedBuffer, error)
OpenSharedBuffer is a non-browser stub that always returns an unavailable error.
func (SharedBuffer) AddInt32 ¶
func (parseB SharedBuffer) AddInt32(parseIndex int, parseDelta int32) (int32, error)
AddInt32 atomically adds delta to the int32 slot at index and returns the previous value.
func (SharedBuffer) AndInt32 ¶
func (parseB SharedBuffer) AndInt32(parseIndex int, parseMask int32) (int32, error)
AndInt32 atomically ANDs mask with the int32 slot at index and returns the previous value.
func (SharedBuffer) CompareExchangeInt32 ¶
func (parseB SharedBuffer) CompareExchangeInt32(parseIndex int, parseOldValue int32, parseNewValue int32) (int32, error)
CompareExchangeInt32 atomically swaps newValue into the int32 slot at index when the current value equals oldValue, and returns the previous value.
func (SharedBuffer) ExchangeInt32 ¶
func (parseB SharedBuffer) ExchangeInt32(parseIndex int, parseValue int32) (int32, error)
ExchangeInt32 atomically swaps value into the int32 slot at index and returns the previous value.
func (SharedBuffer) GetByteLength ¶
func (parseB SharedBuffer) GetByteLength() int
GetByteLength returns the SharedArrayBuffer length in bytes.
func (SharedBuffer) GetInt32Length ¶
func (parseB SharedBuffer) GetInt32Length() int
GetInt32Length returns the number of addressable int32 slots in the shared buffer.
func (SharedBuffer) GetSharedBufferRaw ¶
func (parseB SharedBuffer) GetSharedBufferRaw() any
func (SharedBuffer) LoadInt32 ¶
func (parseB SharedBuffer) LoadInt32(parseIndex int) (int32, error)
LoadInt32 atomically reads the int32 value at index.
func (SharedBuffer) NotifyInt32 ¶
func (parseB SharedBuffer) NotifyInt32(parseIndex int, parseCount int) (int, error)
NotifyInt32 wakes blocked waiters for the int32 slot at index and returns the number of workers notified.
func (SharedBuffer) OrInt32 ¶
func (parseB SharedBuffer) OrInt32(parseIndex int, parseMask int32) (int32, error)
OrInt32 atomically ORs mask with the int32 slot at index and returns the previous value.
func (SharedBuffer) ReadBytes ¶
func (parseB SharedBuffer) ReadBytes(parseOffset int, parseDest []byte) (int, error)
ReadBytes copies shared-memory bytes starting at offset into dest.
func (SharedBuffer) StoreInt32 ¶
func (parseB SharedBuffer) StoreInt32(parseIndex int, parseValue int32) error
StoreInt32 atomically writes value to the int32 slot at index.
func (SharedBuffer) SubInt32 ¶
func (parseB SharedBuffer) SubInt32(parseIndex int, parseDelta int32) (int32, error)
SubInt32 atomically subtracts delta from the int32 slot at index and returns the previous value.
func (SharedBuffer) WaitInt32 ¶
func (parseB SharedBuffer) WaitInt32(parseIndex int, parseExpected int32, parseTimeout time.Duration) (WaitResult, error)
WaitInt32 blocks in a worker context until the int32 slot at index changes from expected or the optional timeout expires. The WaitResult names the outcome.
func (SharedBuffer) WriteBytes ¶
func (parseB SharedBuffer) WriteBytes(parseOffset int, parseSource []byte) (int, error)
WriteBytes copies source bytes into shared memory starting at offset.
type SharedMemorySupport ¶
type SharedMemorySupport struct {
}
SharedMemorySupport reports whether the current browser context can use the shared-memory worker path.
func GetSharedMemorySupport ¶
func GetSharedMemorySupport() (SharedMemorySupport, error)
GetSharedMemorySupport is a non-browser stub that always returns an unavailable error.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func GetLocalStorage ¶
GetLocalStorage returns an unavailable stub on non-browser builds.
func GetSessionStorage ¶
GetSessionStorage returns an unavailable stub on non-browser builds.
func LocalStorage ¶
LocalStorage preserves the legacy storage accessor name.
func SessionStorage ¶
SessionStorage preserves the legacy storage accessor name.
func (Storage) RemoveItem ¶
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func SubscribeClientMessages ¶
func SubscribeClientMessages(parseChannel CrossTabChannel, parseHandler func(ClientMessage, error)) (Subscription, error)
SubscribeClientMessages decodes incoming CrossTabChannel envelopes as ClientMessages and invokes handler.
func SubscribeClientWindowMessages ¶
func SubscribeClientWindowMessages(parseChannel WindowChannel, parseHandler func(ClientMessage, error)) (Subscription, error)
SubscribeClientWindowMessages decodes incoming WindowChannel envelopes as ClientMessages and invokes handler.
func SubscribeDecoded ¶
func SubscribeDecoded[T any](parseTarget EventTarget, parseName string, parseHandler func(DecodedCustomEvent[T], error)) (Subscription, error)
SubscribeDecoded decodes custom-event detail payloads before invoking the handler.
func SubscribeDecodedCrossTab ¶
func SubscribeDecodedCrossTab[T any](parseChannel CrossTabChannel, parseHandler func(DecodedCrossTabEnvelope[T], error)) (Subscription, error)
func SubscribeDecodedMessagePort ¶
func SubscribeDecodedMessagePort[T any](parsePort MessagePort, parseHandler func(DecodedMessagePortMessage[T], error)) (Subscription, error)
SubscribeDecodedMessagePort receives typed payloads from a MessagePort.
func SubscribeDecodedWindow ¶
func SubscribeDecodedWindow[T any](parseChannel WindowChannel, parseHandler func(DecodedWindowEnvelope[T], error)) (Subscription, error)
func SubscribeDecodedWorker ¶
func SubscribeDecodedWorker[T any](parseWorker Worker, parseHandler func(DecodedWorkerMessage[T], error)) (Subscription, error)
func SubscribeSurfaceSignals ¶
func SubscribeSurfaceSignals(parseChannel WindowChannel, parseHandler func(DecodedWindowEnvelope[SurfaceSignal], error)) (Subscription, error)
SubscribeSurfaceSignals receives decoded SurfaceSignal messages on a WindowChannel.
func (Subscription) Cancel ¶
func (parseS Subscription) Cancel()
type SurfaceIntentAction ¶
type SurfaceIntentAction string
const ( SurfaceIntentFocusWindow SurfaceIntentAction = "focus-window" SurfaceIntentFocusPanel SurfaceIntentAction = "focus-panel" SurfaceIntentOpenPanel SurfaceIntentAction = "open-panel" SurfaceIntentCloseWindow SurfaceIntentAction = "close-window" )
type SurfaceIntentSignal ¶
type SurfaceIntentSignal struct {
Action SurfaceIntentAction `json:"action"`
Target string `json:"target,omitempty"`
Params map[string]string `json:"params,omitempty"`
}
type SurfaceRouteSignal ¶
type SurfaceSelectionSignal ¶
type SurfaceSessionSignal ¶
type SurfaceSignal ¶
type SurfaceSignal struct {
Kind SurfaceSignalKind `json:"kind"`
Session *SurfaceSessionSignal `json:"session,omitempty"`
Route *SurfaceRouteSignal `json:"route,omitempty"`
Selection *SurfaceSelectionSignal `json:"selection,omitempty"`
Intent *SurfaceIntentSignal `json:"intent,omitempty"`
}
type SurfaceSignalKind ¶
type SurfaceSignalKind string
const ( SurfaceSignalSession SurfaceSignalKind = "session" SurfaceSignalRoute SurfaceSignalKind = "route" SurfaceSignalSelection SurfaceSignalKind = "selection" SurfaceSignalIntent SurfaceSignalKind = "intent" )
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
func ScheduleInterval ¶
ScheduleInterval is a non-browser stub that always returns an unavailable error.
func ScheduleTimeout ¶
ScheduleTimeout is a non-browser stub that always returns an unavailable error.
func SetInterval ¶
SetInterval preserves the legacy interval helper name.
func SetTimeout ¶
SetTimeout preserves the legacy timer helper name.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value wraps a browser JavaScript value behind a typed interop surface. Platform-specific methods are attached in build-tagged files.
func GetGlobalThis ¶
GetGlobalThis returns an unavailable stub on non-browser builds.
func GlobalThis ¶
GlobalThis preserves the legacy interop global accessor name.
func (Value) Await ¶
Await is unavailable on non-browser builds. It returns a structured CodeUnavailable error so native unit tests of code paths that call Await fail loudly rather than silently.
func (Value) AwaitCall ¶
func (parseV Value) AwaitCall(parseCtx context.Context, parseMethod string, parseArgs ...any) (Value, error)
AwaitCall is unavailable on non-browser builds.
func (Value) IsUndefined ¶
IsUndefined reports whether the value is undefined.
func (Value) SetFunction ¶
func (parseValue Value) SetFunction(parseFunctionName string, parseFunctionHandler func(args ...Value) any) (Subscription, error)
SetFunction binds a Go handler to a property on the wrapped value.
type WaitResult ¶
type WaitResult string
WaitResult is the outcome of a SharedBuffer.WaitInt32 call — the typed form of JS Atomics.wait's three return states, so callers branch on named constants instead of magic string literals.
const ( // WaitOK means the slot's value changed away from the expected value (the waiter was woken). WaitOK WaitResult = "ok" // WaitNotEqual means the slot did not hold the expected value, so the wait returned immediately. WaitNotEqual WaitResult = "not-equal" // WaitTimedOut means the optional timeout elapsed before the value changed. WaitTimedOut WaitResult = "timed-out" )
type WindowChannel ¶
type WindowChannel struct {
// contains filtered or unexported fields
}
func OpenSecondaryWindowChannel ¶
func OpenSecondaryWindowChannel(parseWindowOptions WindowChannelOptions) (WindowChannel, error)
OpenSecondaryWindowChannel is a non-browser stub that always returns an unavailable error.
func OpenWindowOpenerChannel ¶
func OpenWindowOpenerChannel(parseWindowOptions WindowChannelOptions) (WindowChannel, error)
OpenWindowOpenerChannel is a non-browser stub that always returns an unavailable error.
func (WindowChannel) Close ¶
func (parseC WindowChannel) Close() error
func (WindowChannel) Closed ¶
func (parseC WindowChannel) Closed() bool
func (WindowChannel) Focus ¶
func (parseC WindowChannel) Focus() error
func (WindowChannel) Name ¶
func (parseC WindowChannel) Name() string
func (WindowChannel) Publish ¶
func (parseC WindowChannel) Publish(parsePayload any) error
func (WindowChannel) Subscribe ¶
func (parseC WindowChannel) Subscribe(parseHandler func(WindowEnvelope, error)) (Subscription, error)
func (WindowChannel) TargetOrigin ¶
func (parseC WindowChannel) TargetOrigin() string
type WindowChannelOptions ¶
type WindowEnv ¶
type WindowEnv struct {
// contains filtered or unexported fields
}
WindowEnv exposes shared values attached directly to the browser window object. It is intended for simple cross-surface configuration such as mount selectors, bootstrap flags, and other host-provided runtime settings.
func GetWindowEnv ¶
GetWindowEnv returns an empty reader on non-browser builds.
func SharedWindowEnv ¶
SharedWindowEnv preserves the legacy shared window env accessor name.
func (WindowEnv) LookupString ¶
LookupString resolves a shared window value as a normalized string. Empty strings and JavaScript stringified nullish sentinel values are treated as missing.
type WindowEnvelope ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func NewGoWASMWorker ¶
func NewGoWASMWorker(parseWorkerCtx context.Context, parseWorkerOptions GoWASMWorkerOptions) (Worker, error)
NewGoWASMWorker preserves the legacy Go WASM worker constructor name.
func OpenGoWASMWorker ¶
func OpenGoWASMWorker(parseWorkerCtx context.Context, parseWorkerOptions GoWASMWorkerOptions) (Worker, error)
OpenGoWASMWorker is a non-browser stub that always returns an unavailable error.
func OpenWorker ¶
func OpenWorker(parseWorkerCtx context.Context, parseWorkerOptions WorkerOptions) (Worker, error)
OpenWorker is a non-browser stub that always returns an unavailable error.
func (Worker) PostPorts ¶
func (parseW Worker) PostPorts(parseMessage any, parsePorts ...MessagePort) error
PostPorts sends a payload to the worker together with transferred MessagePorts.
func (Worker) Request ¶
func (parseW Worker) Request(parseCtx context.Context, parseName string, parsePayload any, parseOnProgress func(WorkerMessage, error)) (WorkerMessage, error)
func (Worker) Subscribe ¶
func (parseW Worker) Subscribe(parseHandler func(WorkerMessage, error)) (Subscription, error)
type WorkerMessage ¶
type WorkerOptions ¶
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool routes request-style jobs across a fixed worker set with bounded queueing and explicit shutdown controls.
func OpenWorkerPool ¶
func OpenWorkerPool(parseCtx context.Context, parseOptions WorkerPoolOptions) (WorkerPool, error)
OpenWorkerPool creates a fixed-size worker pool with bounded queueing on top of the existing worker request surface.
func (WorkerPool) Close ¶
func (parseP WorkerPool) Close() error
Close stops accepting work, terminates the worker set, and causes active or queued requests to fail promptly.
func (WorkerPool) Drain ¶
func (parseP WorkerPool) Drain(parseCtx context.Context) error
Drain stops accepting new requests, waits for accepted work to finish, and then terminates the worker set.
func (WorkerPool) GetQueueLimit
deprecated
func (parseP WorkerPool) GetQueueLimit() int
GetQueueLimit returns the configured number of queued requests allowed in addition to the running worker count.
Deprecated: use QueueLimit.
func (WorkerPool) GetSize
deprecated
func (parseP WorkerPool) GetSize() int
GetSize returns the configured worker count for the pool.
Deprecated: use Size (the Get prefix is inconsistent with the package's other accessors).
func (WorkerPool) QueueLimit ¶
func (parseP WorkerPool) QueueLimit() int
QueueLimit returns the configured number of queued requests allowed in addition to the running worker count.
func (WorkerPool) Request ¶
func (parseP WorkerPool) Request(parseCtx context.Context, parseName string, parsePayload any, parseOnProgress func(WorkerMessage, error)) (WorkerMessage, error)
Request submits one job to the pool and waits for its final worker result.
func (WorkerPool) Size ¶
func (parseP WorkerPool) Size() int
Size returns the configured worker count for the pool. (Named without a Get prefix to match the rest of the package's accessors — Name/Transport/Backend/Len/Closed.)
type WorkerPoolOptions ¶
type WorkerPoolOptions struct {
Size int
QueueLimit int
OpenWorker func(context.Context) (Worker, error)
}
WorkerPoolOptions configures a fixed-size pool of request-capable workers.
type WorkerRequester ¶
type WorkerRequester interface {
Request(context.Context, string, any, func(WorkerMessage, error)) (WorkerMessage, error)
}
WorkerRequester defines the request-capable worker surface shared by single workers and worker pools.
type WorkerScope ¶
type WorkerScope struct {
// contains filtered or unexported fields
}
func GetWorkerScope ¶
func GetWorkerScope() (WorkerScope, error)
GetWorkerScope is a non-browser stub that always returns an unavailable error.
func (WorkerScope) Message ¶
func (parseW WorkerScope) Message(parseName string, parsePayload any) error
func (WorkerScope) Post ¶
func (parseW WorkerScope) Post(parseMessage WorkerMessage) error
func (WorkerScope) PostPorts ¶
func (parseW WorkerScope) PostPorts(parseMessage WorkerMessage, parsePorts ...MessagePort) error
PostPorts sends a worker-scope message together with transferred MessagePorts.
func (WorkerScope) Progress ¶
func (parseW WorkerScope) Progress(parseId string, parseName string, parsePayload any) error
func (WorkerScope) Ready ¶
func (parseW WorkerScope) Ready(parseName string) error
func (WorkerScope) Result ¶
func (parseW WorkerScope) Result(parseId string, parseName string, parsePayload any) error
func (WorkerScope) Subscribe ¶
func (parseW WorkerScope) Subscribe(parseHandler func(WorkerMessage, error)) (Subscription, error)