RuntimeOptions
인터페이스, 런타임 분류
How createRuntime() makes a runtime.
import type { RuntimeOptions } from 'typeshade/runtime'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
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;}인스턴스 속성
device선택 사항읽기 전용DThe host’s
GPUDevice, which the runtime uses and never destroys. Omitted: the runtime requests one, with the featuresprogramsneed.programs선택 사항읽기 전용readonly Pack[]The programs the requested device must be able to run.
console선택 사항읽기 전용'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.consoleBytes선택 사항읽기 전용numberThe 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.emit선택 사항읽기 전용(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.
소스
src/runtime/runtime.ts, 41행, 커밋 c66579bf 기준