@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
19 lines (18 loc) • 905 B
TypeScript
import type { IFs, NestedDirectoryJSON } from 'memfs';
import type { default as TS } from 'typescript';
export type TranspileNestedJsonOptions = {
fileExtensions?: string[];
};
export type TranspileVirtualFsOptions = {
fileExtensions?: string[];
startPath?: string;
};
/**
* Add support for handling typescript files and code.
* Requires the optional dependency 'typescript'.
*/
export declare const getTypescriptSupport: (enabled?: boolean, typescriptImportFile?: string, options?: TS.CompilerOptions) => Promise<{
transpileFile: (value: string, _compilerOptions?: TS.CompilerOptions, _fileName?: string, _diagnostics?: TS.Diagnostic[], _moduleName?: string) => string;
transpileNestedDirectoryJSON: (mountFsJson: NestedDirectoryJSON, _option?: TranspileNestedJsonOptions) => NestedDirectoryJSON;
transpileVirtualFs: (fs: IFs, _options?: TranspileVirtualFsOptions) => IFs;
}>;