LoadLayeredFromContentOptions
Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:5
Options for loadLayeredFromContent: loadLayered for config files read through a fetch callback.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T = unknown
Properties
Section titled “Properties”coerce?
Section titled “coerce?”
optionalcoerce?: (raw) =>T|undefined
Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:31
Turns each layer’s raw value into the shape being merged, before the merge; return undefined to treat the layer as
absent. Same as LoadLayeredOptions.coerce.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”T | undefined
dir:
string
Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:11
Directory the fetched files are written into before they are executed (see loadConfigFromContent): it has to sit
under a tree where the packages a config imports resolve, which is what withConfigSandbox prepares. The caller
creates and removes it.
extensions?
Section titled “extensions?”
optionalextensions?: readonlystring[]
Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:22
Override the extension probe order.
Inherited from
Section titled “Inherited from”ReadConfigSourceOptions.extensions
fallback?
Section titled “fallback?”
optionalfallback?:object
Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:16
Read <file>.config.* and take its [key] as the lower layer; the dedicated file (name), if any, is merged on
top. Either layer may be absent.
optionalfile?:string
Base name of the fallback file, fetched as <file>.config.*. Not needed with preloaded.
key:
string
The key in the fallback file whose value is taken.
preloaded?
Section titled “preloaded?”
optionalpreloaded?:Loaded<object> |null
The fallback file as the caller already loaded it (null: it was looked for and isn’t there), used as is instead
of fetching it again. Its filepath is reported in sources.
fetch: (
path) =>Promise<string|undefined>
Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:20
Fetches one file by relative path (holocron.config.ts): its content, or
undefined when it doesn’t exist. Throw for anything else (a network
failure, a permission error) — that propagates rather than reading as “absent”.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string | undefined>
Inherited from
Section titled “Inherited from”name:
string
Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:14
Base name — "holocron" probes holocron.config.{ts,js,mjs,cjs,json}.