{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/shayanhabibi/Xantham/master/xantham.schema.json", "title": "xantham.json", "description": "Per-package configuration for the Xantham TypeScript-to-F# bindings generator, read from the file beside the package manifest. Comments and trailing commas are accepted.", "type": "object", "additionalProperties": false, "properties": { "module": { "type": "string", "description": "The F# module the binding is written into. Defaults to the package name under the O7 naming contract, where `@scope/pkg-name` becomes `Scope.PkgName`." }, "namespace": { "type": "string", "description": "The F# namespace a package family is written under. The entry package takes it, and each group named under `groups` takes `.`, so `@cloudedge/agents` under `FSharp.CloudEdge` reads `FSharp.CloudEdge.Agents`. Both sides of a reference configure the same namespace." }, "groups": { "type": "object", "additionalProperties": { "$ref": "#/$defs/disposition" }, "description": "What the generator does with each package boundary its declarations reach (decision O7), keyed by npm name, with the compiler's own library as `typescript/lib`. An unlisted group widens." }, "lib": { "type": "array", "items": { "type": "string" }, "description": "The compiler's `lib` option, as `tsconfig.json` spells it. Omitted, the compiler's default applies, which includes the DOM. A global type library that redeclares DOM names sets this to what its README prescribes." }, "types": { "type": "array", "items": { "type": "string" }, "description": "The compiler's `types` option: installed ambient type packages required by this input. Omitted, automatic discovery applies; an empty array disables automatic inclusion. Missing named packages are reported before generation." }, "declarationCatalog": { "type": "boolean", "description": "Emit declarations.json with stable TypeScript declaration identities and final F# names. Defaults to false." }, "declarationReferences": { "type": "array", "items": { "type": "string" }, "description": "Producer declarations.json files, absolute or relative to the input package directory. Matching types reuse their producer's F# identity; incompatible catalogs fail generation." }, "entry": { "type": "string", "description": "The TypeScript input file, relative to the package directory passed to generate, even when the configuration lives elsewhere. Must name an existing .ts, .tsx, .mts or .cts file (including declarations) within that directory. When provided, selects only this input. Omitted, publicInputs or the manifest's public declarations select the compiler program. Set runtime separately for a single public JavaScript subpath." }, "runtime": { "type": "string", "description": "The public JavaScript module or subpath used by generated `[]` attributes. Must be a nonempty string when provided. Independent of the entry declaration path. Defaults to the package name with DefinitelyTyped's `@types/` convention undone, so `@types/three` imports from `three`." }, "resolveNoInfer": { "type": "boolean", "description": "Resolves TypeScript's `NoInfer` (§4.11) to `T` at the mapping site, dropping the name. Defaults to false, which emits `NoInfer` and reaches the support package's own abbreviation." }, "compilerLib": { "type": "object", "additionalProperties": false, "properties": { "module": { "type": "string", "description": "The dotted root F# module for the compiler-library binding." }, "esModule": { "type": "string", "description": "The single F# identifier for the ECMAScript child module." }, "domModule": { "type": "string", "description": "The single F# identifier for the DOM child module." }, "autoOpenEs": { "type": "boolean", "description": "Open the ECMAScript child module from the root. Defaults to false." }, "autoOpenDom": { "type": "boolean", "description": "Open the DOM child module from the root. Defaults to false." } }, "description": "The module layout and opening policy for the combined TypeScript compiler-library binding." }, "autoOpenExports": { "type": "boolean", "description": "Mark every generated `Exports` type [], so a package's value exports resolve unqualified. Defaults false." }, "subpaths": { "type": "array", "items": { "type": "string" }, "description": "The package.json exports keys generated as nested modules, each written as in the map (\"./client\"). Omitted, every non-wildcard ./ key is generated. A key absent from the map fails generation." }, "publicInputs": { "type": "object", "minProperties": 1, "additionalProperties": { "type": "string", "minLength": 1 }, "description": "Exact public export keys (\".\" or concrete \"./path\") mapped to TypeScript files within the input package. Only these inputs are generated; include \".\" explicitly to select the root. Use for expanded wildcards, conditional declarations and separate runtime environments. Mutually exclusive with entry and subpaths." } }, "$defs": { "disposition": { "description": "One group's disposition (decision O7): how deep resolution follows into the group, and what a reference to its types renders as.", "oneOf": [ { "type": "string", "enum": [ "ship", "reference", "widen" ] }, { "type": "object", "additionalProperties": false, "required": [ "map" ], "properties": { "map": { "type": "object", "description": "The destination of each redirected name, keyed by the TypeScript name the group declares. A name outside the table widens.", "additionalProperties": { "description": "Where one TypeScript name is redirected to. A bare string is a destination taking no type arguments; the object form states the arity.", "oneOf": [ { "type": "string" }, { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The F# name a reference renders as, qualified as the destination package spells it." }, "arity": { "type": "integer", "minimum": 0, "description": "The number of type arguments the destination takes. A reference applying any other number widens with finding TR053." } } } ] } } } } ] } } }