compileTsSource()
Function in Authoring
Compile a TypeScript source string through the TypeShade authoring pipeline.
import { compileTsSource } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
function compileTsSource( source: string, options: CompileTsSourceOptions = {},): CompileTsSourceResultParameters
sourcestringoptionsoptionalCompileTsSourceOptions
Return value
Description
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.
Source
src/compiler/ts/source-file.ts, line 189, at commit 26de7be8