55 lines
2.2 KiB
Go
55 lines
2.2 KiB
Go
//go:build !(js && wasm)
|
|
|
|
package wasmruntime
|
|
|
|
import "kjol/vdom"
|
|
|
|
// The server half of the host API (see host.go). Nothing here touches a browser,
|
|
// because there isn't one: measurements are zero, listeners are never installed,
|
|
// timers never fire, storage is always empty. Components call these
|
|
// unconditionally and render their unmeasured state, which is what SSR ships.
|
|
|
|
func Measure(*vdom.Ref) Rect { return Rect{} }
|
|
func Viewport() Size { return Size{} }
|
|
func CSSVarPx(string) float64 { return 0 }
|
|
|
|
func RAF(func()) int { return 0 }
|
|
func CancelRAF(int) {}
|
|
func AfterRender(func()) {}
|
|
|
|
func SetStyle(*vdom.Ref, string, string) {}
|
|
func RemoveStyle(*vdom.Ref, string) {}
|
|
func SetText(*vdom.Ref, string) {}
|
|
func SetHTML(*vdom.Ref, string) {}
|
|
|
|
func Focus(*vdom.Ref) {}
|
|
func Blur(*vdom.Ref) {}
|
|
func SelectionRange(*vdom.Ref) (int, int) { return 0, 0 }
|
|
func SetSelectionRange(*vdom.Ref, int, int) {}
|
|
func ScrollIntoView(*vdom.Ref, bool, string) {}
|
|
func ScrollLeft(*vdom.Ref) float64 { return 0 }
|
|
func SetScrollLeft(*vdom.Ref, float64) {}
|
|
|
|
// OverflowsX is false on the server: with no layout, nothing can overflow. A
|
|
// component that collapses overflowing content therefore SSRs its uncollapsed form,
|
|
// and the client collapses it on the first commit — before paint, so it is not seen.
|
|
func OverflowsX(*vdom.Ref) bool { return false }
|
|
|
|
func Contains(*vdom.Ref, any) bool { return false }
|
|
func ClosestAttr(any, string, string) (string, bool) { return "", false }
|
|
func QuerySelector(string) *vdom.Ref { return vdom.NewRef() }
|
|
|
|
func OnWindow(string, bool, func(vdom.Event)) Unsub { return func() {} }
|
|
func OnDocument(string, bool, func(vdom.Event)) Unsub { return func() {} }
|
|
func ObserveResize(*vdom.Ref, func()) Unsub { return func() {} }
|
|
|
|
func SetTimeout(int, func()) int { return 0 }
|
|
func ClearTimeout(int) {}
|
|
|
|
func StorageGet(string) (string, bool) { return "", false }
|
|
func StorageSet(string, string) {}
|
|
func StorageRemove(string) {}
|
|
|
|
func Download(string, string, []byte) {}
|
|
func Print(string, []byte) {}
|