Add unknown ranges and open object values

This commit is contained in:
2026-08-14 08:00:22 +09:00
parent 8c50dd202d
commit 848c7f169f
53 changed files with 9047 additions and 6572 deletions
+5 -1
View File
@@ -64,6 +64,10 @@ console.log(JSON.parse(completion));
`globals`, `loadImport`, and `completeImport` are host-owned. The package does not assume a filesystem or virtual project model. Import callbacks are synchronous; preload or cache remote content before evaluation.
Plain strings, numbers, booleans, arrays, and objects are concrete host values. Use `{ $decodal: 'String' | 'Int' | 'Float' | 'Bool' }` for primitive schemas, `{ $decodal: 'Array', item: value }` for array schemas, and `{ $decodal: 'Map', value: value }` for associative-array schemas. Descriptors also accept `constraints` and `default`.
Plain strings, numbers, booleans, arrays, and objects are concrete values. Use `{ $decodal: 'String' | 'Int' | 'Float' | 'Bool' }` for primitive ranges, `{ $decodal: 'Unknown' }` for the top range, `{ $decodal: 'Array', item: value }` for array ranges, and `{ $decodal: 'Map', value: value }` for associative-array ranges. Primitive, unknown, array, and map descriptors also accept `constraints` and `default`.
Use `{ $decodal: 'Range', constraints, default }` when constructing a general range directly.
An object with named fields and an open rest range uses `{ $decodal: 'Object', fields, rest }`. The `fields` property is a record of values and `rest` is the range applied to every other field.
Methods return JSON strings so callers can handle diagnostics and successful results without depending on Rust data structures.