Skip to main content

emit_project

Function emit_project 

Source
pub fn emit_project(
    commons: &TypedCommons,
    ctx: &EmitProjectCtx,
    source_text: &str,
    source_name: &str,
) -> (String, Option<String>)
Expand description

Emit TypeScript source for a single file inside a multi-file project, including cross-file and cross-commons imports computed from EmitProjectCtx. Emit one unit’s TypeScript, plus its source map (slice 1, ADR 0103).

source_text is the originating .bynk file’s text and source_name its project-root-relative path; together they let the source-map builder resolve each recorded span to a (line, col) and embed sourcesContent. Returns the generated TS and the serialised source-map v3 JSON (None when nothing mapped — e.g. a unit whose items all came from sibling files).