Version: dev

expand_coupling_imports

Stable function · Load-time lowering and templates

Tier: stable · Kind: function · Topic: Load-time lowering and templates

JuliaTypeScriptPythonRustGo
expand_coupling_importsexpandCouplingImportsexpand_coupling_importsexpand_coupling_importsnot exported

Julia

expand_coupling_imports(file::EsmFile; base_path, load_ref)
expand_coupling_imports(file::EsmFile; base_path=".", load_ref=nothing)
    -> Vector{CouplingEntry}

Expand every CouplingImport entry in file.coupling into concrete edges, splicing them in the position of the import entry (esm-spec §10.10.3). Returns the effective coupling vector; a file with no coupling_import entries returns file.coupling unchanged (same object, so no reload) and needs no options.

base_path anchors the import refs. load_ref is an optional resolver (ref, base_path) -> raw JSON doc (tests supply an in-memory resolver); it defaults to _default_coupling_load_ref.

Source

TypeScript

function expandCouplingImports(file: EsmFile, options?: CouplingImportOptions): CouplingEntry[] | undefined

Expand every coupling_import entry in file.coupling into concrete edges, splicing them in the position of the import entry (esm-spec §10.10.3). Returns the effective coupling array, or undefined if the file has no coupling block. Non-import entries pass through untouched; a file with no coupling_import entries needs no options and returns file.coupling verbatim.

Source

Python

expand_coupling_imports(esm_file: Any, base_path: str = '.', load_ref: LoadRefFn | None = None) -> list[Any]

Expand every coupling_import entry in esm_file.coupling into concrete (typed) coupling edges, splicing them in the position of the import entry (esm-spec §10.10.3).

Non-import entries pass through untouched; a file with no coupling_import entries returns its coupling list verbatim and never touches disk (so no load_ref is needed). load_ref(ref, base_path) returns a parsed coupling-library document; the default reads it from disk relative to base_path.

Source

Rust

pub fn expand_coupling_imports(file: &EsmFile, options: &CouplingImportOptions<'_>) -> Result<Option<Vec<CouplingEntry>>, DiagnosticError>

Expand every coupling_import entry in file.coupling into concrete edges, splicing them in the position of the import entry (esm-spec §10.10.3). Returns the effective coupling array, or None if the file has no coupling block. Non-import entries pass through untouched; a file with no coupling_import entries returns a clone of file.coupling verbatim.

Source · Rust docs

Go

Go does not export this function.