@magnusopera/fscript 0.83.1 → 0.83.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,3 +3,9 @@
3
3
  Embeddable FScript language engine: parser, type inference, and evaluator.
4
4
 
5
5
  This package exposes parser, inference, evaluation, exported-function invocation, REPL-like sessions, virtual imports, and JS-provided externs for Node and browser-compatible ESM hosts.
6
+
7
+ Provide complete environments with `registration({types, unions, functions})` and pass them as `{registration: environment}`. `HostTypes.describe` declares visible fields; `scriptConstructible: true` enables ordinary script records, while the default retains an opaque JavaScript payload through `HostTypes.wrap` / `unwrap`. `HostTypes.describeUnion`, `wrapUnion`, and `unwrapUnion` support registered nominal cases. `T.named(name)` references those types in signatures.
8
+
9
+ `HostFunctions.create({name, parameters, result, invoke})` builds a typed function from explicit script types. Handlers receive tagged arguments and an invocation context with `apply` for synchronous script callbacks. Existing `extern` declarations still work. Fable task execution and Promise-returning handlers are unsupported.
10
+
11
+ See the [JavaScript hosting reference](https://fscript.magnusopera.io/manual/embedding/fable-javascript) for descriptor tables and examples. Run the local sample after building: `node examples/hosting.mjs`.