shape_ext_typescript/
lib.rs1pub mod error_mapping;
14pub mod marshaling;
15pub mod runtime;
16
17const TYPESCRIPT_SHAPE_SOURCE: &str = r#"/// @module typescript
23/// TypeScript interop runtime — provides access to the embedded V8 engine.
24///
25/// This module is bundled with the TypeScript language runtime extension and
26/// is only available when the extension is loaded. It does NOT live in `std::*`.
27
28/// Evaluate a TypeScript/JavaScript expression and return its result.
29///
30/// The expression is compiled (TS is transpiled to JS) and executed in the
31/// extension's embedded V8 isolate. The result is marshalled back to a Shape
32/// value.
33pub builtin fn eval(code: string) -> _
34
35/// Import a JavaScript/TypeScript module by specifier and return it.
36///
37/// The module is resolved and loaded in the V8 runtime. The returned handle
38/// provides access to the module's exports.
39pub builtin fn import(specifier: string) -> _
40"#;
41
42shape_abi_v1::language_runtime_plugin! {
43 name: c"typescript",
44 version: c"0.1.0",
45 description: c"TypeScript language runtime for foreign function blocks (V8 via deno_core)",
46 shape_source: TYPESCRIPT_SHAPE_SOURCE,
47 vtable: {
48 init: runtime::ts_init,
49 register_types: runtime::ts_register_types,
50 compile: runtime::ts_compile,
51 invoke: runtime::ts_invoke,
52 dispose_function: runtime::ts_dispose_function,
53 language_id: runtime::ts_language_id,
54 get_lsp_config: runtime::ts_get_lsp_config,
55 free_buffer: runtime::ts_free_buffer,
56 drop: runtime::ts_drop,
57 }
58}