RuntimeOptions
Interface in Runtime
How createRuntime() makes a runtime.
import type { RuntimeOptions } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface RuntimeOptions<D extends object = object> { readonly device?: D; readonly programs?: readonly Pack[]; readonly console?: 'print' | ConsoleSink; readonly consoleBytes?: number; readonly emit?: (manifest: Pack, options: { readonly console?: boolean }) => Pack;}Instance properties
deviceoptionalread onlyDThe host’s
GPUDevice, which the runtime uses and never destroys. Omitted: the runtime requests one, with the featuresprogramsneed.programsoptionalread onlyreadonly Pack[]The programs the requested device must be able to run.
consoleoptionalread only'print' | ConsoleSinkWhere the events of an entry’s
console.*calls go: printed to the host’s console, with a warning for the calls that did not fit the buffer ('print', the default), or handed to a sink, which takes the lines and the count and prints nothing. The count of each buffer’s lines and dropped calls is whatsubmit()resolves to, either way.consoleBytesoptionalread onlynumberThe console buffer’s size for each dispatch and draw that records, in bytes. 1 MiB. A call the buffer has no room for is dropped whole, and counted in the
droppedofsubmit()’s row for that dispatch or draw.emitoptionalread only(manifest: Pack, options: { readonly console?: boolean }) => PackThe load-time emitter,
repackfromtypeshade/emit, which emits a manifest again from the portable IR it carries when a load asks for a variant the build did not write (load(m, { console: true })), under the options the manifest was packed under (packModule(m, { emit })). The runtime never imports it itself, so a host that does not pass it ships no emitter.
Source
src/runtime/runtime.ts, line 41, at commit 26de7be8