Skip to main content

SCRIPT_WIT

Constant SCRIPT_WIT 

Source
pub const SCRIPT_WIT: &str = "package jco:script@0.1.0;\n\n/// A JavaScript script packaged as a component.\n///\n/// The component does not execute the script. A host instantiates it to read the\n/// script out and feeds it to a Jco script engine component through\n/// `jco:script-engine/script-loader`.\ninterface script {\n    /// Name the script was packaged under, usually its entry file name.\n    name: func() -> string;\n\n    /// The script as a bundled ES module whose imports name WIT imports of the engine world.\n    source: func() -> string;\n\n    /// Fully-qualified engine world the script was bundled against.\n    engine-world: func() -> string;\n\n    /// JavaScript export names found in the script.\n    exports: func() -> list<string>;\n}\n\nworld script-only {\n    export script;\n}\n";
Expand description

WIT for jco:script, the world script-only components export.