API Reference #

This page is a compact map of the public developer surface. The generated budo-llm.md file in the repository is the exhaustive source for signatures, edge cases, and WebAssembly import lists. Use this page when you want to remember where something lives.

CLI #

Budo Pro: android-apk and android-aab are Budo Pro commands. During Budo's public launch, the released Budo binaries include them for free; a later release will make them a paid feature. Budo built from source without the private Android feature pack under private/android keeps the commands, which then report that packaging is unavailable.

Terminal
budo run <DIRECTORY|FILE> [--width N] [--height N] [--title STR] [--fullscreen] [--no-vsync] [--file-root PATH]
budo run --from-input js|ts|lua|wat|wasm [--width N] [--height N] [--title STR] [--fullscreen] [--no-vsync] [--file-root PATH]
budo <DIRECTORY>
budo init <DIRECTORY> [--template ui | --language c [--template canvas|gpu]]
budo web-serve <DIRECTORY>
budo web-export <DIRECTORY> [-o DIR]
budo android-apk <DIRECTORY> [--release|--debug] [--install] [--no-build] [--clean] [-o DIR]
budo android-aab <DIRECTORY> [--release|--debug] [--no-build] [--clean] [-o DIR]
budo budo.d.ts
budo budo-llm.md
budo version          # also --version, -v
budo help

JavaScript globals #

JavaScript and TypeScript apps run in QuickJS. Budo injects sys, console, fetch, and subsystem aliases where documented.

The sys tree contains canvas, transform, path, svg, font, graphics, gl, math, input, window, animation, timer, audio, midi, db, file, network, udp, magneto, device, neural, and capabilities.

sys.animation #

sys.animation.requestFrame(callback)
sys.animation.waitForInput(callback, timeoutMs)
sys.animation.cancelFrame(handle)

Register one frame callback. The callback receives a timestamp in milliseconds.

waitForInput registers the callback like requestFrame, but it runs only on the next input event, canvas resize, or after timeoutMs (optional). Until then the last frame stays on screen and Budo stops drawing: desktop builds sleep on window events and Android renders only when needed. End a frame with waitForInput when nothing animates and requestFrame while something moves; an app with sys.gl passes that draw to the screen after the canvas keeps calling requestFrame.

sys.timer #

sys.timer.once(delay, callback)
sys.timer.every(interval, callback)
sys.timer.clear(id)

JavaScript-only frame-resolution timers.

sys.window #

sys.window.getWidth()
sys.window.getHeight()
sys.window.getDisplayDensity()

Use display density for UI that should keep a stable physical size across devices.

sys.input #

sys.input.get()
sys.input.isKeyDown(scancode)
sys.input.isKeyPressed(scancode)
sys.input.startTextInput({text, selectionStart, selectionEnd, multiline?})
sys.input.updateTextInput({text, selectionStart, selectionEnd, caret:{x,y,width,height}})
sys.input.stopTextInput()

get() returns pointer, pointer list, timing, modifier, focus, committed text, full textEdit replacements, persistent composition, and textInputActive. Apply textEdit before sending the current model back through updateTextInput. Text sessions provide IME composition, selection edits, candidate positioning, and soft-keyboard lifecycle on desktop, web, and Android. Android Back and single-line Done/Return finalize composition into textEdit. Text selections use UTF-16 code units. Scancode queries remain physical and layout-independent.

sys.capabilities #

Capability entries have an available boolean. The main entries are neural, midi, udp, http and sensors.

if (sys.capabilities.udp.available) {
  console.log('UDP enabled');
}

sys.canvas #

sys.canvas.clear(color)
sys.canvas.drawRect(x, y, width, height)
sys.canvas.drawRoundRect(x, y, width, height, rx, ry)
sys.canvas.drawCircle(cx, cy, radius)
sys.canvas.drawOval(x, y, width, height)
sys.canvas.drawLine(x1, y1, x2, y2)
sys.canvas.drawPoint(x, y)
sys.canvas.drawText(text, x, y, fontSize)
sys.canvas.measureText(text, fontSize)
sys.canvas.measureTextRect(text, fontSize)
sys.canvas.drawArc(x, y, width, height, startAngle, sweepAngle, useCenter)
sys.canvas.readPixels()
sys.canvas.save()
sys.canvas.restore()
sys.canvas.translate(dx, dy)
sys.canvas.rotate(degrees)
sys.canvas.rotate(degrees, px, py)
sys.canvas.scale(sx, sy)
sys.canvas.skew(sx, sy)
sys.canvas.reset()
sys.canvas.clipRect(x, y, width, height)
sys.canvas.clipRoundRect(x, y, width, height, rx, ry)
sys.canvas.clipPath(path)
sys.canvas.saveLayer(alpha, x, y, width, height, backdropBlur)
sys.canvas.drawParagraph(text, x, y, width, fontSize, options)
sys.canvas.measureParagraph(text, width, fontSize, options)
sys.canvas.drawRichText(spans, x, y, width, options)
sys.canvas.measureRichText(spans, width, options)

The optional fontSize defaults to 32 for drawing and measurement.

clipRoundRect and clipPath clip with anti-aliased edges; ry defaults to rx. Undo a clip with restore() after save().

saveLayer(alpha = 255, x?, y?, width?, height?, backdropBlur = 0) draws what follows into an offscreen layer that restore() composites back with one opacity (0–255), so overlapping shapes fade as a group. With a rectangle the layer is clipped to it. A backdropBlur above 0 starts the layer with a blurred copy of what is already drawn below it, for frosted-glass panels:

sys.canvas.save()
sys.canvas.clipRoundRect(x, y, w, h, 16)
sys.canvas.saveLayer(255, x, y, w, h, 24)
sys.canvas.setFillColor('#FFFFFF99')
sys.canvas.drawRect(x, y, w, h)
sys.canvas.restore()
sys.canvas.restore()

drawRichText(spans, x, y, width, options) and measureRichText(spans, width, options) lay out a paragraph made of spans: strings, or { text, size, color, font } objects (font is a name registered with sys.font.load). Lines grow to their largest span and baselines align; options adds size, the default span size, to the paragraph options.

drawParagraph wraps text to width (0 disables wrapping) at spaces and \n, breaking words that are wider than a line. y is the top of the paragraph, not a baseline. options takes align ('left', 'center', 'right'), lineHeight (a multiple of the font size, default 1.25), and maxLines (the last line ends with an ellipsis). Both functions return { width, height, lines }, so measureParagraph can size a layout before drawing.

Colors accept #RRGGBB, #RRGGBBAA, or numeric ARGB.

Canvas paint state #

sys.canvas.setFillColor(color)
sys.canvas.setStrokeColor(color)
sys.canvas.setStrokeWidth(width)
sys.canvas.setAntiAlias(enabled)
sys.canvas.setAlpha(alpha)
sys.canvas.setStrokeCap(cap)
sys.canvas.setStrokeJoin(join)
sys.canvas.setBlendMode(mode)
sys.canvas.setImageFilter(name, ...args)
sys.canvas.setColorFilter(name, ...args)
sys.canvas.setGradient(kind, ...args)
sys.canvas.getError()

Blend modes, image filters, and color filters are advanced Skia APIs.

Gradients replace the paint color for fills, strokes, and text:

sys.canvas.setGradient('linear', x0, y0, x1, y1, ['#2E7D6F', '#8FD3C1'])
sys.canvas.setGradient('radial', cx, cy, radius, ['#FFFFFF', '#FFFFFF00'], [0, 1])
sys.canvas.setGradient('sweep', cx, cy, ['#F00', '#0F0', '#00F', '#F00'])
sys.canvas.setGradient(null)

colors holds 2 to 16 colors and the optional stops one 0–1 position per color. Colors blend in OKLab, so transitions stay even and transparent stops do not turn gray. A gradient makes the paint opaque (setAlpha then fades it) and lasts until setGradient(null) or the next setFillColor or setStrokeColor.

sys.path #

const path = sys.path.create()
sys.path.reset(path)
sys.path.moveTo(path, x, y)
sys.path.lineTo(path, x, y)
sys.path.quadTo(path, x1, y1, x2, y2)
sys.path.cubicTo(path, x1, y1, x2, y2, x3, y3)
sys.path.close(path)
sys.path.addRect(path, x, y, width, height)
sys.path.addCircle(path, cx, cy, radius)
sys.path.addSvg(path, d)        // SVG path data; false when it does not parse
sys.canvas.drawPath(path)

sys.svg and sys.font #

const svg = sys.svg.load('icon.svg')
const svgFromBytes = sys.svg.loadFromBuffer(svgBytes)
sys.canvas.drawSvg(svg, x, y, width, height)
sys.svg.destroy(svg)
sys.svg.getWidth(svg)
sys.svg.getHeight(svg)

sys.font.load(path, name)
sys.font.loadFromBuffer(fontBytes, name)
sys.canvas.setFont(name)
sys.canvas.setFont(null)       // back to the default font (nil in Lua)

sys.gl #

const program = sys.gl.createProgram('shader.vert', 'shader.frag')
const fromBytes = sys.gl.createProgramFromBuffer(vertexBytes, fragmentBytes)
sys.gl.bindScreen()
sys.gl.bindRenderTarget(targetId)
sys.gl.setUniform1f(program, 'u_strength', 0.5)
sys.gl.bindTexture2D(program, 'u_image', texture, 1)
sys.gl.bindTexture(program, 'u_scene', targetId, 1)
sys.gl.bindCanvasTexture(program, 'u_ui', canvasTexture, 1)
sys.gl.drawFullscreen(program)
sys.gl.drawFullscreenImmediate(program, sourceTexture)
sys.gl.drawRegion(program, x, y, width, height, targetId)
sys.gl.drawMesh(program, layout, options)
sys.gl.destroyProgram(program)
sys.gl.getLastError()
sys.gl.getProjectDir()

GL operations are immediate. Programs, render targets, buffers, layouts, and textures are numeric handles, and every sys.gl call takes the program handle first. Uniforms include scalar, vector, array, and matrix forms such as setUniform1f, setUniform3fv, and setUniformMatrix4.

Render targets, buffers, vertex layouts, textures, cubemaps, and mesh draws are also available. Resource loaders that normally take project-relative paths also have FromBuffer variants for bytes from file.readBinary(), fetch().arrayBuffer(), or other sources. See Rendering and shaders for the model and budo-llm.md for the full signature list.

sys.graphics #

const surface = sys.graphics.createCanvasTexture(512, 256)
surface.canvas.drawText('HUD', 32, 96, 42)
program.canvasTexture('u_hud', surface, 1).drawFullscreen()
surface.destroy()

Canvas textures are Skia surfaces backed by GL textures and framebuffers. They are useful for drawing text, UI, or vector content into a texture that a shader can sample.

sys.math #

Math helpers mutate caller-owned arrays. Matrix layout is column-major.

sys.math.mat4Identity(out)
sys.math.mat4Multiply(out, a, b)
sys.math.mat4Perspective(out, fovy, aspect, near, far)
sys.math.mat4Ortho(out, left, right, bottom, top, near, far)
sys.math.mat4LookAt(out, eye, target, up)
sys.math.mat4Translate(out, a, v)
sys.math.mat4RotateX(out, a, radians)
sys.math.mat4RotateY(out, a, radians)
sys.math.mat4RotateZ(out, a, radians)
sys.math.mat4Scale(out, a, v)
sys.math.mat4Invert(out, a)
sys.math.mat4Transpose(out, a)
sys.math.vec3Add(out, a, b)
sys.math.vec3Sub(out, a, b)
sys.math.vec3Scale(out, a, scale)
sys.math.vec3Normalize(out, a)
sys.math.vec3Cross(out, a, b)
sys.math.vec3Dot(a, b)
sys.math.vec3Length(a)
sys.math.vec3TransformMat4(out, a, matrix)
sys.math.quatFromAxisAngle(out, axis, radians)
sys.math.quatMultiply(out, a, b)
sys.math.quatSlerp(out, a, b, t)
sys.math.quatToMat4(out, q)

sys.audio #

sys.audio.start()
sys.audio.stop()
sys.audio.isPlaying()
sys.audio.setMasterGain(gain)
sys.audio.getMasterGain()
sys.audio.createOscillator()
sys.audio.destroyOscillator(id)
sys.audio.setOscillatorType(id, type)
sys.audio.setOscillatorFrequency(id, frequency)
sys.audio.setOscillatorGain(id, gain)
sys.audio.setOscillatorDetune(id, cents)
sys.audio.setOscillatorEnvelope(id, attack, decay, sustain, release)
sys.audio.startOscillator(id)
sys.audio.stopOscillator(id)
sys.audio.noteOn(id)
sys.audio.noteOff(id)
sys.audio.createBuffer(sampleRate, channels, samples)
sys.audio.loadBuffer(path)
sys.audio.loadBufferFromBuffer(buffer)
sys.audio.setBufferData(buffer, samplesArray, offset)
sys.audio.destroyBuffer(buffer)
sys.audio.playBuffer(buffer, loop, gain)
sys.audio.stopBuffer(playback)
sys.audio.midiToFreq(note)
sys.audio.getError()

createBuffer allocates an empty mono or stereo PCM buffer. loadBuffer decodes a project-relative WAV, MP3, Ogg Vorbis, or FLAC asset; loadBufferFromBuffer decodes the same formats from an ArrayBuffer. Both return a buffer ID, or -1 on failure. Play either kind of buffer with playBuffer; use getError() after a failed load to inspect the last audio error.

sys.midi #

sys.midi.getInputCount()
sys.midi.getOutputCount()
sys.midi.getInputDevices()
sys.midi.getOutputDevices()
sys.midi.refreshDevices()
sys.midi.onDevicesChanged(callbackOrNull)
sys.midi.openInput(deviceIndex, callback)
sys.midi.closeInput(handle)
sys.midi.openOutput(deviceIndex)
sys.midi.closeOutput(handle)
sys.midi.sendMessage(handle, status, data1, data2)
sys.midi.sendRaw(handle, bytes)
sys.midi.noteOn(handle, channel, note, velocity)
sys.midi.noteOff(handle, channel, note, velocity)
sys.midi.controlChange(handle, channel, control, value)
sys.midi.programChange(handle, channel, program)
sys.midi.pitchBend(handle, channel, value)
sys.midi.channelPressure(handle, channel, pressure)
sys.midi.polyPressure(handle, channel, note, pressure)
sys.midi.createSession(name, port)
sys.midi.connectSession(session, host, port)
sys.midi.destroySession(session)
sys.midi.onSessionMessage(session, callback)
sys.midi.sessionSend(session, status, data1, data2)
sys.midi.sessionSendRaw(session, bytes)
sys.midi.getSessions()

Constants include MIDI message types and common control-change numbers. onDevicesChanged establishes a silent baseline when registered, replaces any previous listener, and accepts null to unsubscribe. On a later topology change the callback runs on the runtime frame thread with {inputs, outputs, generation}. The snapshots are already refreshed and detect device replacement or reordering even when counts remain unchanged.

sys.db, sys.files, sys.assets, fetch, and sys.net.udp #

const db = sys.db.open(name)
sys.db.close(db)
sys.db.execute(db, sql)
sys.db.run(db, sql, ...params)
sys.db.query(db, sql, ...params)
sys.db.lastInsertId(db)
sys.db.getError()

sys.files.list(path)
sys.files.readText(path)
sys.files.readBinary(path)
sys.files.writeText(path, text)
sys.files.writeBinary(path, bytes)
sys.files.exists(path)
sys.files.isDirectory(path)
sys.files.size(path)
sys.files.pickText(callback, extension?)
sys.files.saveText(suggestedName, text, callback)
sys.files.getError()

// Read-only convenience wrapper over sys.files paths under assets/.
sys.assets.list(path)
sys.assets.readText(path)
sys.assets.readBinary(path)
sys.assets.exists(path)
sys.assets.isDirectory(path)
sys.assets.size(path)
sys.assets.getError()

fetch(url, options)
sys.net.fetch(url, options)

const socket = sys.net.udp.bind(port)
sys.net.udp.getPort(socket)
sys.net.udp.send(socket, host, port, bytes)
sys.net.udp.onMessage(socket, callback)
sys.net.udp.close(socket)

sys.files is the canonical virtual filesystem. Except for a root list(), its paths start with assets/ or files/. sys.assets accepts bundle-relative paths, prepends assets/, exposes no write methods, and shares getError() state with sys.files. Therefore sys.assets.readText('config.json') is equivalent to sys.files.readText('assets/config.json'), while sys.assets.list() is equivalent to sys.files.list('assets'). JS pickText(callback, extension?) opens the platform system picker and returns whether it launched; an extension such as .json filters the picker and is enforced on the selected display name. The callback receives ({name,text}, null) or (null, error), and reads at most 8 MiB. saveText(name, text, callback) opens the platform Save As flow and reports null on success or an error string. Both APIs access locations outside Budo's mounts only through explicit user consent.

Network access is disabled until app.json declares a network policy.

sys.sensors, sys.device, and sys.neural #

sys.sensors.isAvailable()
sys.sensors.hasAccelerometer()
sys.sensors.hasCompass()
sys.sensors.start()
sys.sensors.stop()
sys.sensors.isActive()
sys.sensors.getAccel()
sys.sensors.getCompass()

sys.device.keepScreenOn(enabled)
sys.device.setClipboardText(text)
sys.device.getClipboardText()
sys.device.haptic(kind)
sys.device.getPreferences()
sys.device.setCursor(name)

sys.neural.isAvailable()
sys.neural.getError()
sys.neural.loadModel(path)
sys.neural.loadModelFromBuffer(buffer)
sys.neural.unloadModel(model)
sys.neural.getModelInfo(model)
sys.neural.setInput(model, name, data, shape)
sys.neural.run(model, inputs)
sys.neural.getOutput(model, name)

Neural inference requires ONNX Runtime support and "neural": true in app.json.

getClipboardText() returns null when the clipboard holds no text. Browsers only read the clipboard asynchronously, so on the web it returns the last text copied, cut, or pasted on the page.

haptic(kind) plays light (default), medium, heavy, selection, success, warning, or error feedback; it returns false on devices without haptics (desktop).

getPreferences() returns { darkMode, reducedMotion, highContrast, fontScale, safeArea: { top, right, bottom, left }, keyboardInset }: the system appearance, motion and contrast settings, the text size multiplier, insets (physical pixels) to keep free of notches and system bars, and the height (physical pixels, from the bottom) the on-screen keyboard covers, 0 when it is hidden or on desktop. Lay out above keyboardInset while a text field is focused: budo-ui does it for you. It is cheap to call every frame.

setCursor(name) takes CSS cursor names: default, text, pointer, grab, grabbing, move, ew-resize, ns-resize, nwse-resize, nesw-resize, not-allowed, wait, crosshair, or none.

sys.accessibility #

sys.accessibility.isAvailable()
sys.accessibility.isActive()
sys.accessibility.update(nodes)
sys.accessibility.takeActions()

Budo draws everything itself, so screen readers only know what the app tells them. Publish a flat list of nodes in reading order whenever the UI changes:

sys.accessibility.update([
  { id: 'save', role: 'button', label: 'Save', x, y, width, height },
  { id: 'dark', role: 'switch', label: 'Dark mode', checked: true, x, y, width, height },
  { id: 'level', role: 'slider', label: 'Volume', min: 0, max: 100, rangeValue: 40, value: '40%', x, y, width, height },
])
for (const { id, action, value } of sys.accessibility.takeActions()) {
  // action: 'press', 'focus', 'increment', 'decrement', or 'setValue' (with value)
}

Roles: button, checkbox, radio, switch, slider, textbox, list, listitem, heading, text, combobox, option, tab, image, group, link. Bounds are physical canvas pixels. On the web the nodes become invisible ARIA elements over the canvas; on Android they are exposed to TalkBack; on macOS to VoiceOver. Windows and Linux report isAvailable() === false for now. BUDO_ACCESSIBILITY=1 forces isActive() on macOS, for checking a tree with Accessibility Inspector.

isActive() tells whether a screen reader probably runs (always true on the web, where browsers do not tell), so apps can skip building the tree.

Lua reference #

Lua uses the same sys namespace names for canvas, paint, transform, path, SVG, font, GL, input, window, animation, audio, MIDI, SQLite, files/assets, network, UDP, sensors, device, neural, math, and capabilities.

Differences are language-shaped. Lists are 1-based. fetch is callback-based. readBinary returns a Lua string. Neural tensors are Lua tables. sys.timer is JavaScript-only.

local function frame(timestamp)
  sys.canvas.clear('#101116')
  sys.canvas.setFillColor('#ffffff')
  sys.canvas.drawText('Lua', 32, 64, 24)
  sys.animation.requestFrame(frame)
end

sys.animation.requestFrame(frame)

WebAssembly reference #

WebAssembly imports host functions from env. Names use snake case: canvas_clear, canvas_set_fill_color, transform_translate, path_create, gl_create_program, audio_create_oscillator, db_open, files_read_text, udp_bind, midi_open_input, magneto_get_accel, device_keep_screen_on, neural_load_model, and so on. File import paths start with assets/ or files/. WebAssembly has no sys namespace, so sys.assets does not add a separate import family; use env.files_* with an assets/ path.

String-backed imports take pointer and length pairs. Tensor and pixel APIs copy through exported linear memory. Optional features should be guarded with capability imports or compiled into target-specific modules.

For the complete import list, generate or open budo-llm.md from the same Budo build you ship.

<!-- BEGIN GENERATED API AVAILABILITY -->

Runtime availability #

This section is generated from api/contracts/*.json. Each cell names the guest-visible export; - means that operation is not exposed to that runtime. Platform lists describe where each runtime adapter is registered.

accessibility #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
is_available() -> boolsys.accessibility.isAvailablesys.accessibility.isAvailableenv.accessibility_is_available-
is_active() -> boolsys.accessibility.isActivesys.accessibility.isActiveenv.accessibility_is_active-
update(nodes: nodes) -> boolsys.accessibility.updatesys.accessibility.updateenv.accessibility_update-
take_actions() -> actionssys.accessibility.takeActionssys.accessibility.takeActionsenv.accessibility_take_actions-

audio #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
start() -> voidsys.audio.startsys.audio.startenv.audio_start-
stop() -> voidsys.audio.stopsys.audio.stopenv.audio_stop-
is_playing() -> boolsys.audio.isPlayingsys.audio.isPlaying--
set_master_gain(gain: f32) -> voidsys.audio.setMasterGainsys.audio.setMasterGainenv.audio_set_master_gain-
get_master_gain() -> f32sys.audio.getMasterGainsys.audio.getMasterGain--
create_oscillator() -> i32 oscillator_id; -1 on failuresys.audio.createOscillatorsys.audio.createOscillatorenv.audio_create_oscillator-
destroy_oscillator(oscillator_id: i32) -> voidsys.audio.destroyOscillatorsys.audio.destroyOscillatorenv.audio_destroy_oscillator-
set_oscillator_type(oscillator_id: i32, type: wave_type) -> voidsys.audio.setOscillatorTypesys.audio.setOscillatorTypeenv.audio_oscillator_set_type-
set_oscillator_frequency(oscillator_id: i32, frequency_hz: f32) -> voidsys.audio.setOscillatorFrequencysys.audio.setOscillatorFrequencyenv.audio_oscillator_set_frequency-
set_oscillator_gain(oscillator_id: i32, gain: f32) -> voidsys.audio.setOscillatorGainsys.audio.setOscillatorGainenv.audio_oscillator_set_gain-
set_oscillator_detune(oscillator_id: i32, cents: f32) -> voidsys.audio.setOscillatorDetunesys.audio.setOscillatorDetuneenv.audio_oscillator_set_detune-
start_oscillator(oscillator_id: i32) -> voidsys.audio.startOscillatorsys.audio.startOscillatorenv.audio_oscillator_start-
stop_oscillator(oscillator_id: i32) -> voidsys.audio.stopOscillatorsys.audio.stopOscillatorenv.audio_oscillator_stop-
set_oscillator_envelope(oscillator_id: i32, attack: f32, decay: f32, sustain: f32, release: f32) -> voidsys.audio.setOscillatorEnvelopesys.audio.setOscillatorEnvelopeenv.audio_oscillator_set_envelope-
note_on(oscillator_id: i32) -> voidsys.audio.noteOnsys.audio.noteOnenv.audio_oscillator_note_on-
note_off(oscillator_id: i32) -> voidsys.audio.noteOffsys.audio.noteOffenv.audio_oscillator_note_off-
load_buffer(project_relative_path: string) -> i32 buffer_id; -1 on failuresys.audio.loadBuffersys.audio.loadBuffer--
load_buffer_from_buffer(encoded_audio: bytes) -> i32 buffer_id; -1 on failuresys.audio.loadBufferFromBuffersys.audio.loadBufferFromBuffer--
create_buffer(sample_rate: i32, channels: i32, sample_count: i32) -> i32 buffer_id; -1 on failuresys.audio.createBuffersys.audio.createBuffer--
set_buffer_data(buffer_id: i32, samples: f32[], offset?: i32) -> voidsys.audio.setBufferDatasys.audio.setBufferData--
destroy_buffer(buffer_id: i32) -> voidsys.audio.destroyBuffersys.audio.destroyBuffer--
play_buffer(buffer_id: i32, loop?: bool, gain?: f32) -> i32 playback_id; -1 on failuresys.audio.playBuffersys.audio.playBuffer--
stop_buffer(playback_id: i32) -> voidsys.audio.stopBuffersys.audio.stopBuffer--
midi_to_frequency(midi_note: i32) -> f32 frequency_hzsys.audio.midiToFreqsys.audio.midiToFreqenv.audio_midi_to_freq-
get_error() -> stringsys.audio.getErrorsys.audio.getError--
get_sample_rate() -> i32 frames per second of the device (stream callbacks run at it)sys.audio.getSampleRate---
open_output(options?: {channels: 1|2, latencyMs}, callback: (buffer: f32[] interleaved, info) -> void) -> i32 stream; -1 on failuresys.audio.openOutput---
close_output(stream: i32) -> voidsys.audio.closeOutput---
open_input(options?: {channels: 1|2, latencyMs}, callback: (samples: f32[] interleaved, info) -> void) -> i32 stream; -1 on failuresys.audio.openInput---
close_input(stream: i32) -> voidsys.audio.closeInput---
open_decoder(source: assets/|files/ path | bytes, options?: {sampleRate, channels}) -> i32 decoder; -1 on failuresys.audio.openDecoder---
create_decoder(options?: {sampleRate, channels}) -> i32 push decodersys.audio.createDecoder---
feed_decoder(decoder: i32, bytes: bytes|null, end?: bool) -> boolsys.audio.feedDecoder---
decode(decoder: i32, out: f32[]) -> i32 frames; 0 at the end or when bytes are needed; -1 on failuresys.audio.decode---
get_decoder_info(decoder: i32) -> decoder infosys.audio.getDecoderInfo---
seek_decoder(decoder: i32, seconds: f64) -> boolsys.audio.seekDecoder---
close_decoder(decoder: i32) -> voidsys.audio.closeDecoder---
fft(re: f32[], im: f32[], inverse: bool) -> bool; in place, power-of-two lengthssys.audio.fft---
get_spectrum(samples: f32[], out_db: f32[]) -> f32[] Hann-windowed levels in dB, samples.length / 2 binssys.audio.getSpectrum---
detect_pitch(samples: f32[], sample_rate: f64, options: pitch options) -> pitch {frequency, clarity, level}sys.audio.detectPitch---

canvas #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
path_draw(path) -> void using current paintsys.canvas.drawPathsys.canvas.drawPathenv.canvas_draw_pathenv.canvas_draw_path
svg_draw(SVG handle, x:f32, y:f32, width:f32, height:f32) -> voidsys.canvas.drawSvgsys.canvas.drawSvgenv.canvas_draw_svg-
clear(color: ARGB) -> voidsys.canvas.clearsys.canvas.clearenv.canvas_clearenv.canvas_clear
read_pixelsread RGBA8 premultiplied pixelssys.canvas.readPixelssys.canvas.readPixelsenv.canvas_read_pixels-
draw_rect(x:f32, y:f32, width:f32, height:f32) -> voidsys.canvas.drawRectsys.canvas.drawRectenv.canvas_draw_rectenv.canvas_draw_rect
draw_round_rect(x:f32, y:f32, width:f32, height:f32, rx:f32, ry:f32) -> voidsys.canvas.drawRoundRectsys.canvas.drawRoundRectenv.canvas_draw_round_rectenv.canvas_draw_round_rect
draw_circle(cx:f32, cy:f32, radius:f32) -> voidsys.canvas.drawCirclesys.canvas.drawCircleenv.canvas_draw_circleenv.canvas_draw_circle
draw_oval(x:f32, y:f32, width:f32, height:f32) -> voidsys.canvas.drawOvalsys.canvas.drawOvalenv.canvas_draw_oval-
draw_line(x1:f32, y1:f32, x2:f32, y2:f32) -> voidsys.canvas.drawLinesys.canvas.drawLineenv.canvas_draw_lineenv.canvas_draw_line
draw_point(x:f32, y:f32) -> voidsys.canvas.drawPointsys.canvas.drawPointenv.canvas_draw_point-
draw_textdraw UTF-8 text and return its widthsys.canvas.drawTextsys.canvas.drawTextenv.canvas_draw_textenv.canvas_draw_text
measure_textmeasure UTF-8 text widthsys.canvas.measureTextsys.canvas.measureTextenv.canvas_measure_text-
measure_text_rectmeasure UTF-8 text boundssys.canvas.measureTextRectsys.canvas.measureTextRectenv.canvas_measure_text_rect-
draw_arc(x:f32, y:f32, width:f32, height:f32, start_degrees:f32, sweep_degrees:f32, use_center:bool) -> voidsys.canvas.drawArcsys.canvas.drawArcenv.canvas_draw_arc-
font_set(registered name or null) -> voidsys.canvas.setFontsys.canvas.setFont--
set_fill_color(color: ARGB) -> void and select fill stylesys.canvas.setFillColorsys.canvas.setFillColorenv.canvas_set_fill_colorenv.canvas_set_fill_color
set_stroke_color(color: ARGB) -> void and select stroke stylesys.canvas.setStrokeColorsys.canvas.setStrokeColorenv.canvas_set_stroke_colorenv.canvas_set_stroke_color
set_stroke_width(width:f32) -> voidsys.canvas.setStrokeWidthsys.canvas.setStrokeWidthenv.canvas_set_stroke_widthenv.canvas_set_stroke_width
set_anti_alias(enabled:bool) -> voidsys.canvas.setAntiAliassys.canvas.setAntiAliasenv.canvas_set_anti_aliasenv.canvas_set_anti_alias
set_alpha(alpha:i32 clamped to 0..255) -> voidsys.canvas.setAlphasys.canvas.setAlphaenv.canvas_set_alphaenv.canvas_set_alpha
set_stroke_cap(butt|round|square) -> voidsys.canvas.setStrokeCapsys.canvas.setStrokeCap--
set_stroke_join(miter|round|bevel) -> voidsys.canvas.setStrokeJoinsys.canvas.setStrokeJoin--
set_blend_modeset a stable Skia blend-mode name or numeric ABI valuesys.canvas.setBlendModesys.canvas.setBlendModeenv.canvas_set_blend_mode-
set_image_filterset or clear a managed blur/drop-shadow image filtersys.canvas.setImageFiltersys.canvas.setImageFilter--
set_color_filterset or clear a managed matrix/blend color filtersys.canvas.setColorFiltersys.canvas.setColorFilter--
set_blur_filter(sigma_x:f32, sigma_y:f32) -> void--env.canvas_set_blur_filter-
set_drop_shadow_filter(dx:f32, dy:f32, sigma_x:f32, sigma_y:f32, color_argb:i32) -> void--env.canvas_set_drop_shadow_filter-
set_drop_shadow_only_filter(dx:f32, dy:f32, sigma_x:f32, sigma_y:f32, color_argb:i32) -> void--env.canvas_set_drop_shadow_only_filter-
clear_image_filter() -> void--env.canvas_clear_image_filter-
set_color_matrix_filter(matrix_ptr:i32, matrix_len:i32) -> void; requires exactly 20 f32 values--env.canvas_set_color_matrix_filter-
set_blend_color_filter(color_argb:i32, blend_mode:i32) -> void--env.canvas_set_blend_color_filter-
clear_color_filter() -> void--env.canvas_clear_color_filter-
save() -> voidsys.canvas.savesys.canvas.saveenv.transform_saveenv.transform_save
restore() -> voidsys.canvas.restoresys.canvas.restoreenv.transform_restoreenv.transform_restore
translate(dx:f32, dy:f32) -> voidsys.canvas.translatesys.canvas.translateenv.transform_translateenv.transform_translate
rotate(degrees:f32) -> void; managed bindings also accept an optional pivotsys.canvas.rotatesys.canvas.rotateenv.transform_rotateenv.transform_rotate
rotate_around(degrees:f32, px:f32, py:f32) -> void--env.transform_rotate_around-
scale(sx:f32, sy:f32) -> voidsys.canvas.scalesys.canvas.scaleenv.transform_scaleenv.transform_scale
skew(sx:f32, sy:f32) -> voidsys.canvas.skewsys.canvas.skewenv.canvas_skew-
reset_transform() -> voidsys.canvas.resetsys.canvas.resetenv.canvas_reset_transform-
clip_rect(x:f32, y:f32, width:f32, height:f32) -> voidsys.canvas.clipRectsys.canvas.clipRectenv.canvas_clip_rectenv.canvas_clip_rect
set_gradientset or clear a linear/radial/sweep gradient on the default paintsys.canvas.setGradientsys.canvas.setGradient--
set_linear_gradient(x0:f32, y0:f32, x1:f32, y1:f32, colors_ptr:i32, stops_ptr:i32, count:i32) -> void; stops_ptr < 0 spaces colors evenly--env.canvas_set_linear_gradientenv.canvas_set_linear_gradient
set_radial_gradient(cx:f32, cy:f32, radius:f32, colors_ptr:i32, stops_ptr:i32, count:i32) -> void--env.canvas_set_radial_gradientenv.canvas_set_radial_gradient
set_sweep_gradient(cx:f32, cy:f32, colors_ptr:i32, stops_ptr:i32, count:i32) -> void--env.canvas_set_sweep_gradientenv.canvas_set_sweep_gradient
clear_gradient() -> void--env.canvas_clear_gradientenv.canvas_clear_gradient
clip_round_rect(x:f32, y:f32, width:f32, height:f32, rx:f32, ry:f32) -> void; managed bindings default ry to rxsys.canvas.clipRoundRectsys.canvas.clipRoundRectenv.canvas_clip_round_rectenv.canvas_clip_round_rect
clip_path(path) -> void; unknown paths throw in managed bindingssys.canvas.clipPathsys.canvas.clipPathenv.canvas_clip_pathenv.canvas_clip_path
save_layer(alpha?:0..255, x?, y?, width?, height?, backdropBlur?) -> void; restore() composites the layersys.canvas.saveLayersys.canvas.saveLayerenv.canvas_save_layerenv.canvas_save_layer
save_layer_bounds(x:f32, y:f32, width:f32, height:f32, alpha:i32, backdrop_blur:f32) -> void; clips the layer to its bounds--env.canvas_save_layer_boundsenv.canvas_save_layer_bounds
draw_paragraphdraw wrapped UTF-8 text in a box and return its metricssys.canvas.drawParagraphsys.canvas.drawParagraphenv.canvas_draw_paragraphenv.canvas_draw_paragraph
measure_paragraphmeasure wrapped UTF-8 textsys.canvas.measureParagraphsys.canvas.measureParagraphenv.canvas_measure_paragraphenv.canvas_measure_paragraph
draw_rich_textdraw wrapped text made of styled spans and return its metricssys.canvas.drawRichTextsys.canvas.drawRichTextenv.canvas_draw_rich_textenv.canvas_draw_rich_text
measure_rich_textmeasure wrapped styled spanssys.canvas.measureRichTextsys.canvas.measureRichTextenv.canvas_measure_rich_textenv.canvas_measure_rich_text

canvas_texture #

JavaScript: desktop, android, web; Lua: unsupported; Wasmtime: unsupported; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
create(width:i32, height:i32) -> CanvasTexture object with id, width, height, texture, target, and canvassys.graphics.createCanvasTexture---
resize(width:i32, height:i32) -> void and refresh public GL metadataCanvasTexture.resize---
destroy() -> void and invalidate the object handleCanvasTexture.destroy---
canvas_clear(color?:ARGB) -> voidCanvasTexture.canvas.clear---
canvas_draw_rect(x:f32, y:f32, width:f32, height:f32) -> void using the owner default paintCanvasTexture.canvas.drawRect---
canvas_draw_arc(x:f32, y:f32, width:f32, height:f32, start_angle:f32, sweep_angle:f32) -> void using the owner default paintCanvasTexture.canvas.drawArc---
canvas_draw_line(x1:f32, y1:f32, x2:f32, y2:f32) -> void using the owner default paintCanvasTexture.canvas.drawLine---
canvas_draw_oval(x:f32, y:f32, width:f32, height:f32) -> void using the owner default paintCanvasTexture.canvas.drawOval---
canvas_draw_point(x:f32, y:f32) -> void using the owner default paintCanvasTexture.canvas.drawPoint---
canvas_draw_round_rect(x:f32, y:f32, width:f32, height:f32, radiusX:f32, radiusY:f32) -> void using the owner default paintCanvasTexture.canvas.drawRoundRect---
canvas_measure_text(text:string, font_size?:f32) -> number width using the owner active fontCanvasTexture.canvas.measureText---
canvas_measure_text_rect(text:string, font_size?:f32) -> { width: number, height: number } using the owner active fontCanvasTexture.canvas.measureTextRect---
canvas_read_pixels() -> Uint8Array using the owner default paintCanvasTexture.canvas.readPixels---
canvas_draw_circle(cx:f32, cy:f32, radius:f32) -> void using the owner default paintCanvasTexture.canvas.drawCircle---
canvas_draw_text(text:string, x:f32, y:f32, font_size?:f32) -> number width using the owner active font and default paintCanvasTexture.canvas.drawText---
set_fill_color(color: ARGB) -> void and select fill styleCanvasTexture.canvas.setFillColor---
set_stroke_color(color: ARGB) -> void and select stroke styleCanvasTexture.canvas.setStrokeColor---
set_stroke_width(width:f32) -> voidCanvasTexture.canvas.setStrokeWidth---
set_anti_alias(enabled:bool) -> voidCanvasTexture.canvas.setAntiAlias---
set_alpha(alpha:i32 clamped to 0..255) -> voidCanvasTexture.canvas.setAlpha---
set_stroke_cap(butt|round|square) -> voidCanvasTexture.canvas.setStrokeCap---
set_stroke_join(miter|round|bevel) -> voidCanvasTexture.canvas.setStrokeJoin---
set_blend_modeset a stable Skia blend-mode name or numeric ABI valueCanvasTexture.canvas.setBlendMode---
set_image_filterset or clear a managed blur/drop-shadow image filterCanvasTexture.canvas.setImageFilter---
set_color_filterset or clear a managed matrix/blend color filterCanvasTexture.canvas.setColorFilter---
font_set(registered name or null) -> voidCanvasTexture.canvas.setFont---
set_gradientset or clear a linear/radial/sweep gradient on the owner default paintCanvasTexture.canvas.setGradient---
canvas_draw_paragraph(text:string, x:f32, y:f32, width:f32, font_size?:f32, options?) -> { width, height, lines } using the owner active font and default paintCanvasTexture.canvas.drawParagraph---
canvas_measure_paragraph(text:string, width:f32, font_size?:f32, options?) -> { width, height, lines } using the owner active fontCanvasTexture.canvas.measureParagraph---

capabilities #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
neural() -> boolsys.capabilities.neuralsys.capabilities.neuralenv.capability_neural-
llamacpp() -> boolsys.capabilities.llamacppsys.capabilities.llamacppenv.capability_llamacpp-
midi() -> boolsys.capabilities.midisys.capabilities.midienv.capability_midi-
udp() -> boolsys.capabilities.udpsys.capabilities.udpenv.capability_udp-
http() -> boolsys.capabilities.httpsys.capabilities.httpenv.capability_http-
sensors() -> boolsys.capabilities.sensorssys.capabilities.sensorsenv.capability_sensors-

console #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
log(...values) -> voidconsole.logconsole.log--
log_int(value:i32) -> void--env.log_int-
log_float(value:f32) -> void--env.log_float-

device #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
keep_screen_on(bool enabled) -> boolsys.device.keepScreenOnsys.device.keepScreenOnenv.device_keep_screen_onenv.device_keep_screen_on
set_clipboard_text(text: string) -> boolsys.device.setClipboardTextsys.device.setClipboardTextenv.device_set_clipboard_textenv.device_set_clipboard_text
get_clipboard_text() -> string|nullsys.device.getClipboardTextsys.device.getClipboardTextenv.device_get_clipboard_textenv.device_get_clipboard_text
haptic(kind?: haptic) -> boolsys.device.hapticsys.device.hapticenv.device_hapticenv.device_haptic
get_preferences() -> preferencessys.device.getPreferencessys.device.getPreferencesenv.device_get_preferenceenv.device_get_preference
set_cursor(name?: cursor) -> boolsys.device.setCursorsys.device.setCursorenv.device_set_cursorenv.device_set_cursor

drawing_resources #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
path_create() -> path handlesys.path.createsys.path.createenv.path_createenv.path_create
path_reset(path) -> voidsys.path.resetsys.path.resetenv.path_reset-
path_move_to(path, x:f32, y:f32) -> voidsys.path.moveTosys.path.moveToenv.path_move_toenv.path_move_to
path_line_to(path, x:f32, y:f32) -> voidsys.path.lineTosys.path.lineToenv.path_line_toenv.path_line_to
path_quad_to(path, x1:f32, y1:f32, x2:f32, y2:f32) -> voidsys.path.quadTosys.path.quadToenv.path_quad_to-
path_cubic_to(path, x1:f32, y1:f32, x2:f32, y2:f32, x3:f32, y3:f32) -> voidsys.path.cubicTosys.path.cubicToenv.path_cubic_to-
path_close(path) -> voidsys.path.closesys.path.closeenv.path_closeenv.path_close
path_add_rect(path, x:f32, y:f32, width:f32, height:f32) -> voidsys.path.addRectsys.path.addRectenv.path_add_rect-
path_add_circle(path, cx:f32, cy:f32, radius:f32) -> voidsys.path.addCirclesys.path.addCircleenv.path_add_circle-
path_add_svg(path, data:string) -> boolsys.path.addSvgsys.path.addSvgenv.path_add_svgenv.path_add_svg
svg_load(safe project-relative path) -> SVG handle or -1sys.svg.loadsys.svg.loadenv.svg_load-
svg_load_from_buffer(SVG XML bytes) -> SVG handle or -1sys.svg.loadFromBuffersys.svg.loadFromBufferenv.svg_load_from_buffer-
svg_destroy(SVG handle) -> voidsys.svg.destroysys.svg.destroyenv.svg_destroy-
svg_get_width(SVG handle) -> f32sys.svg.getWidthsys.svg.getWidthenv.svg_get_width-
svg_get_height(SVG handle) -> f32sys.svg.getHeightsys.svg.getHeightenv.svg_get_height-
font_load(safe project-relative path, optional name) -> voidsys.font.loadsys.font.load--
font_load_from_buffer(font bytes, optional name) -> voidsys.font.loadFromBuffersys.font.loadFromBuffer--

file #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
list(path?: string) -> file_entry[]|nullsys.files.list
sys.assets.list
sys.files.list
sys.assets.list
env.files_list_json-
read_text(path: string) -> string|nullsys.files.readText
sys.assets.readText
sys.files.readText
sys.assets.readText
env.files_read_text-
read_binary(path: string) -> bytes|nullsys.files.readBinary
sys.assets.readBinary
sys.files.readBinary
sys.assets.readBinary
env.files_read_binary-
exists(path: string) -> boolsys.files.exists
sys.assets.exists
sys.files.exists
sys.assets.exists
env.files_exists-
is_directory(path: string) -> boolsys.files.isDirectory
sys.assets.isDirectory
sys.files.isDirectory
sys.assets.isDirectory
env.files_is_directory-
size(path: string) -> integer|nullsys.files.size
sys.assets.size
sys.files.size
sys.assets.size
env.files_size-
write_text(path: files/ virtual path, text: string) -> absolute_path|nullsys.files.writeTextsys.files.writeText--
write_binary(path: files/ virtual path, data: bytes) -> absolute_path|nullsys.files.writeBinarysys.files.writeBinary--
append_binary(path: files/ virtual path, data: bytes) -> absolute_path|nullsys.files.appendBinary---
pick_text(callback, extension?: string) -> boolsys.files.pickText---
save_text(name: string, text: string, callback) -> boolsys.files.saveText---
get_error() -> stringsys.files.getError
sys.assets.getError
sys.files.getError
sys.assets.getError
--
open_read(path: string) -> i32 handle|nullsys.files.openRead---
read_block(handle: i32, max_bytes?: i32) -> bytes (empty at the end)|nullsys.files.read---
seek(handle: i32, byte_offset: f64) -> boolsys.files.seek---
get_read_info(handle: i32) -> {size, position}sys.files.getReadInfo---
close_read(handle: i32) -> voidsys.files.closeRead---

gl #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
create_programcompile/link vertex and fragment shader files -> positive program id or -1sys.gl.createProgramsys.gl.createProgramenv.gl_create_programenv.gl_create_program
create_program_from_buffercompile/link in-memory vertex and fragment source -> positive program id or -1sys.gl.createProgramFromBuffersys.gl.createProgramFromBufferenv.gl_create_program_from_buffer-
destroy_program(program_id:i32) -> boolsys.gl.destroyProgramsys.gl.destroyProgramenv.gl_destroy_program-
use_program(program_id:i32) -> boolsys.gl.useProgramsys.gl.useProgramenv.gl_use_program-
bind_screen() -> bool; bind default framebuffer and viewportsys.gl.bindScreensys.gl.bindScreenenv.gl_bind_screen-
bind_render_target(target_id:i32) -> bool; zero binds screensys.gl.bindRenderTargetsys.gl.bindRenderTargetenv.gl_bind_render_target-
draw_fullscreen(program_id:i32) -> bool using the queued/default-canvas pathsys.gl.drawFullscreen--env.gl_draw_fullscreen
draw_fullscreen_immediate(program_id:i32, source_texture:u32) -> bool against current targetsys.gl.drawFullscreenImmediatesys.gl.drawFullscreenenv.gl_draw_fullscreen-
set_uniform_1i(program_id, name, i32) -> boolsys.gl.setUniform1isys.gl.setUniform1ienv.gl_set_uniform_1i-
set_uniform_1f(program_id, name, f32) -> boolsys.gl.setUniform1fsys.gl.setUniform1fenv.gl_set_uniform_1fenv.gl_set_uniform_1f
set_uniform_2f(program_id, name, f32, f32) -> boolsys.gl.setUniform2fsys.gl.setUniform2fenv.gl_set_uniform_2fenv.gl_set_uniform_2f
set_uniform_3f(program_id, name, f32, f32, f32) -> boolsys.gl.setUniform3fsys.gl.setUniform3fenv.gl_set_uniform_3f-
set_uniform_4f(program_id, name, f32, f32, f32, f32) -> boolsys.gl.setUniform4fsys.gl.setUniform4fenv.gl_set_uniform_4f-
get_last_error() -> last GL error string or emptysys.gl.getLastErrorsys.gl.getLastError--
get_project_dir() -> loaded project directorysys.gl.getProjectDirsys.gl.getProjectDir--
create_render_target(width:i32, height:i32, depth:bool) -> target id or -1sys.gl.createRenderTargetsys.gl.createRenderTargetenv.gl_create_render_target-
destroy_render_target(target_id:i32) -> boolsys.gl.destroyRenderTargetsys.gl.destroyRenderTargetenv.gl_destroy_render_target-
resize_render_target(target_id:i32, width:i32, height:i32) -> boolsys.gl.resizeRenderTargetsys.gl.resizeRenderTargetenv.gl_resize_render_target-
draw_regionqueued region draw using program and optional targetsys.gl.drawRegion---
draw_region_immediateimmediate region draw against current or explicit targetsys.gl.drawRegionImmediatesys.gl.drawRegionenv.gl_draw_region-
bind_render_target_texturequeued bind of render-target color texture to samplersys.gl.bindTexture---
bind_render_target_texture_immediateimmediate bind of render-target color texture to samplersys.gl.renderTargetTexturesys.gl.bindTextureenv.gl_bind_texture-
bind_canvas_texturequeued bind of flushed CanvasTexture to samplersys.gl.bindCanvasTexture---
program_texturepolymorphic immediate binding of numeric 2D texture or CanvasTexturesys.gl.texture---
create_buffer() -> buffer id or -1; managed forms optionally upload initial datasys.gl.createBuffersys.gl.createBufferenv.gl_create_bufferenv.gl_create_buffer
buffer_data(buffer_id, target, data, byte_len, usage) -> bool--env.gl_buffer_dataenv.gl_buffer_data
update_buffer(buffer_id, byte_offset, data, byte_len) -> boolsys.gl.updateBuffersys.gl.updateBufferenv.gl_buffer_sub_data-
destroy_buffer(buffer_id:i32) -> boolsys.gl.destroyBuffersys.gl.destroyBufferenv.gl_destroy_buffer-
create_texture_2d(width, height, format, optional RGBA bytes) -> texture id or -1sys.gl.createTexture2Dsys.gl.createTexture2Denv.gl_create_texture_2d-
load_texture_2d(safe project-relative image path) -> texture id or -1sys.gl.loadTexture2Dsys.gl.loadTexture2Denv.gl_load_texture_2d-
load_texture_2d_from_buffer(encoded image bytes) -> texture id or -1sys.gl.loadTexture2DFromBuffersys.gl.loadTexture2DFromBufferenv.gl_load_texture_2d_from_buffer-
load_texture_cube(six safe project-relative image paths) -> cubemap id or -1sys.gl.loadTextureCubesys.gl.loadTextureCubeenv.gl_load_texture_cube-
load_texture_cube_from_buffer(six encoded image buffers) -> cubemap id or -1sys.gl.loadTextureCubeFromBuffersys.gl.loadTextureCubeFromBufferenv.gl_load_texture_cube_from_buffer-
update_texture_2d(texture_id, x, y, width, height, pixels) -> boolsys.gl.updateTexture2Dsys.gl.updateTexture2Denv.gl_update_texture_2d-
destroy_texture(texture_id:i32) -> boolsys.gl.destroyTexturesys.gl.destroyTextureenv.gl_destroy_texture-
create_vertex_layout() -> layout id or -1sys.gl.createVertexLayoutsys.gl.createVertexLayoutenv.gl_create_vertex_layoutenv.gl_create_vertex_layout
destroy_vertex_layout(layout_id:i32) -> boolsys.gl.destroyVertexLayoutsys.gl.destroyVertexLayoutenv.gl_destroy_vertex_layout-
set_attributeconfigure one vertex attribute slotsys.gl.setAttributesys.gl.setAttributeenv.gl_set_attributeenv.gl_set_attribute
set_index_bufferattach an index buffer and u16/u32 type to a layoutsys.gl.setIndexBuffersys.gl.setIndexBufferenv.gl_set_index_bufferenv.gl_set_index_buffer
set_uniform_matrix3set one or more column-major mat3 valuessys.gl.setUniformMatrix3sys.gl.setUniformMatrix3env.gl_set_uniform_matrix3fv-
set_uniform_matrix4set one or more column-major mat4 valuessys.gl.setUniformMatrix4sys.gl.setUniformMatrix4env.gl_set_uniform_matrix4fvenv.gl_set_uniform_matrix4fv
set_uniform_1ivset i32 uniform arraysys.gl.setUniform1ivsys.gl.setUniform1ivenv.gl_set_uniform_1iv-
set_uniform_1fvset scalar f32 uniform arraysys.gl.setUniform1fvsys.gl.setUniform1fvenv.gl_set_uniform_1fv-
set_uniform_2fvset vec2 f32 uniform arraysys.gl.setUniform2fvsys.gl.setUniform2fvenv.gl_set_uniform_2fv-
set_uniform_3fvset vec3 f32 uniform arraysys.gl.setUniform3fvsys.gl.setUniform3fvenv.gl_set_uniform_3fv-
set_uniform_4fvset vec4 f32 uniform arraysys.gl.setUniform4fvsys.gl.setUniform4fvenv.gl_set_uniform_4fv-
bind_texture_2dqueued bind of app 2D texture to samplersys.gl.bindTexture2D---
bind_texture_2d_immediateimmediate bind of app 2D texture to sampler-sys.gl.bindTexture2Denv.gl_bind_texture_2d-
bind_texture_cubequeued bind of app cubemap to samplersys.gl.bindTextureCube---
bind_texture_cube_immediateimmediate bind of app cubemap to sampler-sys.gl.bindTextureCubeenv.gl_bind_texture_cube-
draw_meshqueued mesh draw with layout and draw statesys.gl.drawMesh---
draw_mesh_immediateimmediate mesh draw with optional target, depth/cull/blend state, and instance countsys.gl.drawMeshImmediatesys.gl.drawMeshenv.gl_draw_meshenv.gl_draw_mesh
get_attrib_location(program_id, name) -> location or -1sys.gl.getAttribLocationsys.gl.getAttribLocationenv.gl_get_attrib_location-

input_window #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
input_snapshot() -> per-frame input snapshot containing mouse, pointer(s), modifiers, text/edit/composition, timing, frame count, and focussys.input.getsys.input.get--
key_down(SDL scancode:i32) -> bool currently heldsys.input.isKeyDownsys.input.isKeyDownenv.input_get_key_down-
key_pressed(SDL scancode:i32) -> bool pressed during current framesys.input.isKeyPressedsys.input.isKeyPressed--
start_text_input(text, UTF-16 selection start/end, multiline) -> boolsys.input.startTextInputsys.input.startTextInput--
update_text_input(text, UTF-16 selection start/end, caret x/y/width/height) -> boolsys.input.updateTextInputsys.input.updateTextInput--
stop_text_input() -> void; finish composition and platform editing sessionsys.input.stopTextInputsys.input.stopTextInput--
window_width() -> physical canvas width in pixelssys.window.getWidthsys.window.getWidthenv.window_get_widthenv.window_get_width
window_height() -> physical canvas height in pixelssys.window.getHeightsys.window.getHeightenv.window_get_heightenv.window_get_height
display_density() -> f32 drawable-pixel density; defaults to 1sys.window.getDisplayDensitysys.window.getDisplayDensityenv.window_get_display_density-
mouse_x() -> i32 current mouse x--env.input_get_mouse_xenv.input_get_mouse_x
mouse_y() -> i32 current mouse y--env.input_get_mouse_yenv.input_get_mouse_y
mouse_button(button:i32) -> i32 boolean--env.input_get_mouse_buttonenv.input_get_mouse_button
delta_time() -> f32 elapsed seconds since previous frame or 0--env.input_get_delta_time-
total_time() -> f32 elapsed seconds since runtime start or 0--env.input_get_total_time-

llamacpp #

JavaScript: desktop, android; Lua: desktop, android; Wasmtime: unsupported; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
is_available() -> boolsys.llamacpp.isAvailablesys.llamacpp.isAvailable--
get_devices() -> device[]sys.llamacpp.getDevicessys.llamacpp.getDevices--
load_model(path, options, callback) -> voidsys.llamacpp.loadModelsys.llamacpp.loadModel--
get_error() -> stringsys.llamacpp.getErrorsys.llamacpp.getError--

magneto #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
is_available() -> boolsys.sensors.isAvailablesys.sensors.isAvailableenv.magneto_is_available-
has_accelerometer() -> boolsys.sensors.hasAccelerometersys.sensors.hasAccelerometerenv.magneto_has_accelerometer-
has_compass() -> boolsys.sensors.hasCompasssys.sensors.hasCompassenv.magneto_has_compass-
start() -> boolsys.sensors.startsys.sensors.startenv.magneto_start-
stop() -> voidsys.sensors.stopsys.sensors.stopenv.magneto_stop-
is_active() -> boolsys.sensors.isActivesys.sensors.isActiveenv.magneto_is_active-
get_accel() -> {x: f32, y: f32, z: f32}|nullsys.sensors.getAccelsys.sensors.getAccelenv.magneto_get_accel_x
env.magneto_get_accel_y
env.magneto_get_accel_z
-
get_compass() -> {x: f32, y: f32, z: f32, heading: f32}|nullsys.sensors.getCompasssys.sensors.getCompassenv.magneto_get_compass_x
env.magneto_get_compass_y
env.magneto_get_compass_z
env.magneto_get_compass_heading
-

math #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
mat4_identity(out: mat4) -> voidsys.math.mat4Identitysys.math.mat4Identityenv.math_mat4_identityenv.math_mat4_identity
mat4_multiply(out: mat4, a: mat4, b: mat4) -> voidsys.math.mat4Multiplysys.math.mat4Multiplyenv.math_mat4_multiplyenv.math_mat4_multiply
mat4_perspective(out: mat4, fovy: f32, aspect: f32, near: f32, far: f32) -> voidsys.math.mat4Perspectivesys.math.mat4Perspectiveenv.math_mat4_perspectiveenv.math_mat4_perspective
mat4_ortho(out: mat4, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> voidsys.math.mat4Orthosys.math.mat4Orthoenv.math_mat4_ortho-
mat4_lookat(out: mat4, eye: vec3, target: vec3, up: vec3) -> voidsys.math.mat4LookAtsys.math.mat4LookAtenv.math_mat4_lookatenv.math_mat4_lookat
mat4_translate(out: mat4, a: mat4, translation: vec3) -> voidsys.math.mat4Translatesys.math.mat4Translateenv.math_mat4_translate-
mat4_rotate_x(out: mat4, a: mat4, angle: f32) -> voidsys.math.mat4RotateXsys.math.mat4RotateXenv.math_mat4_rotate_xenv.math_mat4_rotate_x
mat4_rotate_y(out: mat4, a: mat4, angle: f32) -> voidsys.math.mat4RotateYsys.math.mat4RotateYenv.math_mat4_rotate_yenv.math_mat4_rotate_y
mat4_rotate_z(out: mat4, a: mat4, angle: f32) -> voidsys.math.mat4RotateZsys.math.mat4RotateZenv.math_mat4_rotate_z-
mat4_scale(out: mat4, a: mat4, scale: vec3) -> voidsys.math.mat4Scalesys.math.mat4Scaleenv.math_mat4_scale-
mat4_invert(out: mat4, a: mat4) -> boolsys.math.mat4Invertsys.math.mat4Invertenv.math_mat4_invert-
mat4_transpose(out: mat4, a: mat4) -> voidsys.math.mat4Transposesys.math.mat4Transposeenv.math_mat4_transpose-
vec3_add(out: vec3, a: vec3, b: vec3) -> voidsys.math.vec3Addsys.math.vec3Addenv.math_vec3_add-
vec3_sub(out: vec3, a: vec3, b: vec3) -> voidsys.math.vec3Subsys.math.vec3Subenv.math_vec3_sub-
vec3_scale(out: vec3, a: vec3, scale: f32) -> voidsys.math.vec3Scalesys.math.vec3Scaleenv.math_vec3_scale-
vec3_normalize(out: vec3, a: vec3) -> voidsys.math.vec3Normalizesys.math.vec3Normalizeenv.math_vec3_normalize-
vec3_cross(out: vec3, a: vec3, b: vec3) -> voidsys.math.vec3Crosssys.math.vec3Crossenv.math_vec3_cross-
vec3_dot(a: vec3, b: vec3) -> f32sys.math.vec3Dotsys.math.vec3Dotenv.math_vec3_dot-
vec3_length(a: vec3) -> f32sys.math.vec3Lengthsys.math.vec3Lengthenv.math_vec3_length-
vec3_transform_mat4(out: vec3, value: vec3, matrix: mat4) -> voidsys.math.vec3TransformMat4sys.math.vec3TransformMat4env.math_vec3_transform_mat4-
vec3_normalize_many(out: vec3[], values: vec3[], count: i32) -> voidsys.math.vec3NormalizeManysys.math.vec3NormalizeMany--
vec3_transform_mat4_many(out: vec3[], values: vec3[], matrix: mat4, count: i32) -> voidsys.math.vec3TransformMat4Manysys.math.vec3TransformMat4Many--
quat_from_axis_angle(out: quat, axis: vec3, angle: f32) -> voidsys.math.quatFromAxisAnglesys.math.quatFromAxisAngleenv.math_quat_from_axis_angle-
quat_multiply(out: quat, a: quat, b: quat) -> voidsys.math.quatMultiplysys.math.quatMultiplyenv.math_quat_multiply-
quat_slerp(out: quat, a: quat, b: quat, t: f32) -> voidsys.math.quatSlerpsys.math.quatSlerpenv.math_quat_slerp-
quat_to_mat4(out: mat4, value: quat) -> voidsys.math.quatToMat4sys.math.quatToMat4env.math_quat_to_mat4-

midi #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
get_input_count() -> integer; 0 when unavailable or no devicessys.midi.getInputCountsys.midi.getInputCountenv.midi_get_input_count-
get_output_count() -> integer; 0 when unavailable or no devicessys.midi.getOutputCountsys.midi.getOutputCountenv.midi_get_output_count-
get_input_devices() -> Array<{id: integer, name: string}>; [] when unavailablesys.midi.getInputDevicessys.midi.getInputDevices--
get_output_devices() -> Array<{id: integer, name: string}>; [] when unavailablesys.midi.getOutputDevicessys.midi.getOutputDevices--
refresh_devices() -> void; no-op when unavailablesys.midi.refreshDevicessys.midi.refreshDevices--
on_devices_changed(callback: (event: {inputs, outputs, generation}) -> void | null) -> voidsys.midi.onDevicesChangedsys.midi.onDevicesChanged--
open_input(device_index: integer, callback: (message) -> void) -> integer handle; -1 on failuresys.midi.openInputsys.midi.openInput--
close_input(handle: integer) -> void; no-op when unavailablesys.midi.closeInputsys.midi.closeInput--
open_output(device_index: integer) -> integer handle; -1 on failuresys.midi.openOutputsys.midi.openOutputenv.midi_open_output-
close_output(handle: integer) -> void; no-op when unavailablesys.midi.closeOutputsys.midi.closeOutputenv.midi_close_output-
send_message(handle: integer, status: byte, data1: byte, data2: byte) -> boolsys.midi.sendMessagesys.midi.sendMessageenv.midi_send_message-
send_raw(handle: integer, data: bytes[1..4096]) -> boolsys.midi.sendRawsys.midi.sendRawenv.midi_send_raw-
note_on(handle: integer, channel: integer, note: integer, velocity: integer) -> boolsys.midi.noteOnsys.midi.noteOnenv.midi_note_on-
note_off(handle: integer, channel: integer, note: integer, velocity: integer) -> boolsys.midi.noteOffsys.midi.noteOffenv.midi_note_off-
control_change(handle: integer, channel: integer, control: integer, value: integer) -> boolsys.midi.controlChangesys.midi.controlChangeenv.midi_control_change-
program_change(handle: integer, channel: integer, program: integer) -> boolsys.midi.programChangesys.midi.programChangeenv.midi_program_change-
pitch_bend(handle: integer, channel: integer, value: integer[-8192..8191]) -> boolsys.midi.pitchBendsys.midi.pitchBendenv.midi_pitch_bend-
channel_pressure(handle: integer, channel: integer, pressure: integer) -> boolsys.midi.channelPressuresys.midi.channelPressure--
poly_pressure(handle: integer, channel: integer, note: integer, pressure: integer) -> boolsys.midi.polyPressuresys.midi.polyPressure--
get_type(status: byte) -> integer message_typesys.midi.getTypesys.midi.getType--
get_channel(status: byte) -> integer[0..15] | -1 for system messagessys.midi.getChannelsys.midi.getChannel--
create_session(name: string, control_port?: integer = 0) -> integer handle; -1 on failure or unavailablesys.midi.createSessionsys.midi.createSessionenv.rtpmidi_create_session-
connect_session(session: integer, host: string, control_port: integer) -> bool invitation_sentsys.midi.connectSessionsys.midi.connectSessionenv.rtpmidi_connect-
destroy_session(session: integer) -> void; no-op when unavailablesys.midi.destroySessionsys.midi.destroySessionenv.rtpmidi_destroy_session-
on_session_message(session: integer, callback: (message) -> void) -> void; no-op when unavailable or session is outside 0..7sys.midi.onSessionMessagesys.midi.onSessionMessage--
session_send(session: integer, status: byte, data1: byte, data2: byte) -> bool; true only when sent to at least one peersys.midi.sessionSendsys.midi.sessionSendenv.rtpmidi_send_message-
session_note_on(session: integer, channel: integer, note: integer, velocity: integer) -> boolsys.midi.sessionNoteOnsys.midi.sessionNoteOn--
session_note_off(session: integer, channel: integer, note: integer, velocity: integer) -> boolsys.midi.sessionNoteOffsys.midi.sessionNoteOff--
session_control_change(session: integer, channel: integer, control: integer, value: integer) -> boolsys.midi.sessionControlChangesys.midi.sessionControlChange--
session_send_raw(session: integer, data: bytes[1..512]) -> boolsys.midi.sessionSendRawsys.midi.sessionSendRaw--
get_sessions() -> Array<{handle, name, port, state, peerCount}>; [] when unavailablesys.midi.getSessionssys.midi.getSessions--
get_session_count() -> integer; 0 when unavailable--env.rtpmidi_get_session_count-

module_lifecycle #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
module_importload another language modulelanguage.importlanguage.require--
load_entrypointload and execute the configured application entrypointruntime.entrypointruntime.entrypointruntime.entrypointruntime.entrypoint
guest_memoryguest-exported linear memory used by pointer/buffer host ABIs--guest.exports.memoryguest.exports.memory
guest_initoptional guest export init() called once after instantiation and memory wiring--guest.exports.initguest.exports.init
exitend the application with an exit statusruntime.exitruntime.exitruntime.app_exitruntime.app_exit

network #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
fetchasynchronous policy-controlled HTTP requestsys.net.fetchsys.net.fetch
global.fetch
env.network_fetchenv.network_fetch
parse_json(json_text: string) -> Lua value-global.json_parse--
headers_get(name: string) -> string|nullHeaders.get---
headers_has(name: string) -> boolHeaders.has---
headers_entries() -> Array<[string,string]>Headers.entries---
headers_keys() -> string[]Headers.keys---
headers_values() -> string[]Headers.values---
headers_for_each(callback: (value: string, name: string) -> any) -> voidHeaders.forEach---
response_text() -> string; consumes the body onceResponse.text---
response_json() -> any; consumes the body once and throws SyntaxError for invalid JSONResponse.json---
response_array_buffer() -> ArrayBuffer; consumes the body onceResponse.arrayBuffer---
fetch_status(slot: i32) -> request state--env.network_fetch_statusenv.network_fetch_status
fetch_status_code(slot: i32) -> HTTP status sentinel--env.network_fetch_status_codeenv.network_fetch_status_code
fetch_response_body_length(slot: i32) -> body byte length sentinel--env.network_fetch_response_body_lenenv.network_fetch_response_body_len
fetch_response_body(slot: i32, destination_ptr: i32, max_len: i32) -> i32 bytes copied--env.network_fetch_response_bodyenv.network_fetch_response_body
fetch_response_headers_length(slot: i32) -> serialized header byte length--env.network_fetch_response_headers_len-
fetch_response_headers(slot: i32, destination_ptr: i32, max_len: i32) -> serialized header bytes copied--env.network_fetch_response_headers-
fetch_response_url_length(slot: i32) -> final URL byte length--env.network_fetch_response_url_len-
fetch_response_url(slot: i32, destination_ptr: i32, max_len: i32) -> final URL bytes copied--env.network_fetch_response_url-
fetch_error_length(slot: i32) -> request error byte length--env.network_fetch_error_len-
fetch_error(slot: i32, destination_ptr: i32, max_len: i32) -> request error bytes copied--env.network_fetch_error-
fetch_release(slot: i32) -> void--env.network_fetch_releaseenv.network_fetch_release

neural #

JavaScript: desktop, android; Lua: desktop, android; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
is_available() -> bool indicating whether the ONNX Runtime library can be loadedsys.neural.isAvailablesys.neural.isAvailableenv.neural_is_available-
get_error() -> last context error stringsys.neural.getErrorsys.neural.getErrorenv.neural_get_error-
load_model(safe project-relative .onnx path) -> model_idsys.neural.loadModelsys.neural.loadModelenv.neural_load_model-
load_model_from_buffer(ONNX model bytes) -> model_idsys.neural.loadModelFromBuffersys.neural.loadModelFromBufferenv.neural_load_model_from_buffer-
unload_model(model_id) -> voidsys.neural.unloadModelsys.neural.unloadModelenv.neural_unload_model-
get_model_info(model_id) -> model metadatasys.neural.getModelInfosys.neural.getModelInfo--
get_input_count(model_id) -> input tensor count--env.neural_get_input_count-
get_output_count(model_id) -> output tensor count--env.neural_get_output_count-
get_input_info(model_id, input_index) -> input name, shape, and rank--env.neural_get_input_info-
get_output_info(model_id, output_index) -> output name, shape, and rank--env.neural_get_output_info-
set_inputstage a named tensor for the next inferencesys.neural.setInputsys.neural.setInputenv.neural_set_input_f32-
runrun synchronous model inferencesys.neural.runsys.neural.runenv.neural_run-
get_outputretrieve a named output from the most recent runsys.neural.getOutputsys.neural.getOutputenv.neural_copy_output_f32
env.neural_get_output_f32
-
get_output_shaperetrieve the resolved shape of a named output--env.neural_get_output_shape-

scheduling #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: web.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
animation_start(callback(timestamp_ms)) -> void; replace the persistent Lua frame callback-sys.animation.start--
request_frame(callback(timestamp_ms)) -> handle 1; replace the persistent managed frame callbacksys.animation.requestFramesys.animation.requestFrame--
wait_for_input(callback(timestamp_ms), timeout_ms?) -> handle 1; like request_frame, but the callback runs only on the next input event, canvas resize, or timeout; hosts may sleep meanwhilesys.animation.waitForInputsys.animation.waitForInputguest.exports.animation_wait_for_inputguest.exports.animation_wait_for_input
cancel_frame(handle ignored) -> void; clear the single managed frame callbacksys.animation.cancelFramesys.animation.cancelFrame--
timer_once(delay_ms:number, callback) -> timer id or undefined; non-positive delay fires on a later timer-processing passsys.timer.once---
timer_every(interval_ms:number, callback) -> timer id or undefined; interval is clamped to at least 1 mssys.timer.every---
timer_clear(timer_id:i32) -> void; unknown or inactive ids are ignoredsys.timer.clear---
guest_frameoptional guest export frame(timestamp_ms); invoked once per host frame--guest.exports.frameguest.exports.frame

sqlite #

JavaScript: desktop, android, web; Lua: desktop, android, web; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
open(name: string) -> database_handlesys.db.opensys.db.openenv.db_open-
close(handle: database_handle) -> voidsys.db.closesys.db.closeenv.db_close-
execute(handle: database_handle, sql: string) -> boolsys.db.executesys.db.executeenv.db_execute-
run(handle: database_handle, sql: string, ...params: null|bool|number|string) -> i32 changessys.db.runsys.db.runenv.db_run-
run_integer_parameter(handle: database_handle, sql: string, parameter: i32) -> i32 changes--env.db_run_int-
run_string_parameter(handle: database_handle, sql: string, parameter: string) -> i32 changes--env.db_run_str-
query(handle: database_handle, sql: string, ...params: null|bool|number|string) -> rowssys.db.querysys.db.queryenv.db_query_json-
last_insert_id(handle: database_handle) -> integersys.db.lastInsertIdsys.db.lastInsertIdenv.db_last_insert_id-
get_error() -> stringsys.db.getErrorsys.db.getError--

udp #

JavaScript: desktop, android; Lua: desktop, android; Wasmtime: desktop; Browser WASM: unsupported.

OperationSignatureJavaScriptLuaWasmtimeBrowser WASM
bind(local_port: i32; 0 requests auto-assignment) -> i32 socket_handle; -1 on failuresys.net.udp.bindsys.net.udp.bindenv.udp_bind-
get_port(socket_handle: i32) -> i32 local_port; -1 on failuresys.net.udp.getPortsys.net.udp.getPortenv.udp_get_port-
send(socket_handle: i32, host: string, port: i32, data: bytes) -> boolsys.net.udp.sendsys.net.udp.sendenv.udp_send-
receivereceive datagrams with sender host and portsys.net.udp.onMessagesys.net.udp.onMessageenv.udp_recv-
close(socket_handle: i32) -> voidsys.net.udp.closesys.net.udp.closeenv.udp_close-

<!-- END GENERATED API AVAILABILITY -->