compileTsSource()
함수, 작성 분류
Compile a TypeScript source string through the TypeShade authoring pipeline.
import { compileTsSource } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
function compileTsSource( source: string, options: CompileTsSourceOptions = {},): CompileTsSourceResult매개변수
sourcestringoptions선택 사항CompileTsSourceOptions
반환값
설명
A source without the "use typeshade" directive returns hasDirective: false, no
functions and one MISSING_DIRECTIVE error (unless options.requireDirective is false).
wgsl is present only when the file lowered at least one function with no error diagnostic
and options.emit is not false; a backend that throws on such a module is reported as a
BACKEND error diagnostic and leaves wgsl undefined.
소스
src/compiler/ts/source-file.ts, 189행, 커밋 c66579bf 기준