Configuration
Start with the defaults. Add settings for the names, environment, and package boundaries your binding needs.
A minimal configuration
{
"module": "MyApp.Bindings",
"lib": ["esnext", "dom"],
"types": []
}
Pass the file with --config ./xantham.json. All properties are optional. The repository schema lists the available settings; use the schema from your Xantham version when pinning a build.
Name the F# API
modulesets the generated F# module. The default is derived from the npm name:@scope/pkg-namebecomesScope.PkgName.namespacenames a related package family. Use the same namespace when generating packages that reference each other.autoOpenExportsmarks generatedExportstypes as auto-open. It defaults tofalse; value exports then use explicitExports.memberaccess.runtimeoverrides the JavaScript import path. The default is the package name, with the@types/naming convention undone.
Select the environment
lib
Select TypeScript libraries, such as esnext and dom. Omitting this uses the compiler default, which includes DOM.
types
Select ambient providers. Omit for automatic discovery, use an empty array to disable it, or list installed providers such as node.
For a worker environment that supplies its own globals, use the libraries its type package recommends. Loading DOM alongside a provider that redeclares the same globals can cause conflicts.
Explicit imports and reference directives still resolve their dependencies when types is empty. A configured provider must be installed where the input package can resolve it.
Select public inputs
Use subpaths to select concrete keys from the package's exports map:
{
"subpaths": ["./client", "./server"]
}
Use publicInputs to choose exact public keys and declaration files:
{
"publicInputs": {
".": "dist/index.d.ts",
"./client": "dist/client.d.ts"
}
}
Only the listed public inputs are generated. Include "." to select the root. Keys must be exact public paths; expand wildcard exports into concrete keys.
publicInputs is mutually exclusive with entry and subpaths. Each declaration path must name an existing TypeScript file inside the input package.
Use separate configurations for browser and worker variants with different globals.
Configure package boundaries
groups decides whether a dependency is generated, referenced, mapped to an existing F# type, or widened. See Dependencies and shared types for examples.
Resolve NoInfer
resolveNoInfer: true maps TypeScript's NoInfer<T> directly to T. The default preserves NoInfer<T> through the support library.
Generate your own standard library
compilerLib controls the layout when generating a combined TypeScript library binding:
{
"compilerLib": {
"module": "MyBindings.TypeScript",
"esModule": "Es",
"domModule": "Dom",
"autoOpenEs": false,
"autoOpenDom": false
}
}
Defaults are TypeScript.Lib, Es, and Dom, with both auto-open flags off. The child module names must be distinct F# identifiers. ES and DOM are emitted together in one recursive module file.
Most consumers can use Xantham.Fable.Core.TS.