gizapp/section
what a page's client section (<script client>, the GHTML reference §4) imports. It is browser code only: the section's runtime (app/sys/client.giz, which the generated page imports as _C) and the typed giz-surface element. A server module never imports it, and it imports no server module, so a page's client script links alone.
import * as Section from "gizapp/section";Types
SurfaceElement
class SurfaceElement { el: Client.Element; constructor(el: Client.Element) { this.el = el; } save(key: string, done: (failure: string) => void): void { Client.surfaceSave(this.el, key, done); } load(key: string, done: (found: bool, failure: string) => void): void { Client.surfaceLoad(this.el, key, done); } call(name: string, input: bytes, done: (answer: bytes, failure: string) => void): void { Client.surfaceCall(this.el, name, input, done); } render(name: string, input: bytes, done: (failure: string) => void): void { Client.surfaceRender(this.el, name, input, done); } fullscreen(done: (failure: string) => void): void { Client.surfaceFullscreen(this.el, done); } mute(muted: bool): void { Client.surfaceMute(this.el, muted); } }A giz-surface element of the page, typed: the calls that a page's client section makes on it.
el:i64
Functions
constructor
constructor(el: Client.Element)The giz-surface element EL (surfaceIn finds it).
Effects: fail, read, write, alloc.
surfaceIn
function surfaceIn(el: Client.Element): SurfaceElementThe surface element inside the element EL (its first giz-surface), typed.
Effects: fail, read, write, alloc.
Methods
SurfaceElement.save
save(key: string, done: (failure: string) => void): voidSaves the program's snapshot under KEY on this device; DONE gets the reason of a failure, "" for none.
Effects: fail, read.
SurfaceElement.load
load(key: string, done: (found: bool, failure: string) => void): voidLoads the snapshot saved under KEY; DONE gets whether there was one.
Effects: fail, read.
SurfaceElement.call
call(name: string, input: bytes, done: (answer: bytes, failure: string) => void): voidCalls the program's export NAME with INPUT; DONE gets its answer.
Effects: fail, read.
SurfaceElement.render
render(name: string, input: bytes, done: (failure: string) => void): voidRuns the program's render export NAME with INPUT.
Effects: fail, read.
SurfaceElement.fullscreen
fullscreen(done: (failure: string) => void): voidShows the surface's canvas on the whole screen; the request must come from a click.
Effects: fail, read.
SurfaceElement.mute
mute(muted: bool): voidMutes or unmutes the program's sounds (its cues).
Effects: fail, read.