TypeScript / Source merge

TypeScript Module Merge

This page has a stable URL for review, documentation, and implementation comparison. The fixture tabs show merge inputs and output; the contract tabs show JSON and compact ruleset renderings with stable IDs and deterministic ownership.

Basic .ts mergetypescripttop_level_declarationsstructural_signaturenative_read_portable_writenormalize_tracked_layout_mergec_style_linetypescript_declarations

Fixture sources

JSON fixture: structuredmerge-fixtures/typescript/slice-104-merge/module-merge.json

Compact ruleset: structuredmerge-fixtures/rulesets/typescript/slice-104-merge/module-merge.smrules

Fixture view
import { foo } from './foo';

export function greet(name: string) {
  return foo(name);
}

export interface Person {
  name: string;
}
Contract view
{
  "contract_id": "typescript-module-merge",
  "format": "typescript",
  "owners": "top_level_declarations",
  "match": "structural_signature",
  "read": "native_read_portable_write",
  "attach": "normalize_tracked_layout_merge",
  "comment_style": "c_style_line",
  "render": "typescript_declarations",
  "surfaces": [
    {
      "name": "doc_comment",
      "selector": "fixed_kind"
    }
  ],
  "delegates": [
    {
      "surface": "doc_comment",
      "strategy": "same_ruleset"
    }
  ]
}