---
title: "SemanticDiff: interface in Tooling, TypeShade API reference"
description: "SemanticDiff, an interface in Tooling. The four buckets of difference."
url: https://typeshade.dev/api/semanticdiff-interface/
language: en
---

# `SemanticDiff`

Interface in Tooling

The four buckets of difference.

`import type { SemanticDiff } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface SemanticDiff {
  readonly interface: readonly string[];
  readonly resources: readonly string[];
  readonly constants: readonly string[];
  readonly controlFlow: readonly string[];
}
```

## Description

Each entry is a fact line prefixed `-` (present in `a`, absent from `b`) or `+` (the reverse). When all four are empty the modules agree on everything this comparison inspects; [`isSemanticallyEqual`](https://typeshade.dev/api/issemanticallyequal/) performs that test.

## Instance properties

**`interface` read only `readonly string[]`**

Entry-point signatures and the vertex attribute layout.

**`resources` read only `readonly string[]`**

Bind groups, std140/std430 struct layouts, and required capabilities.

**`constants` read only `readonly string[]`**

Module consts, pipeline overrides, and the multiset of numeric literals in function bodies. A literal’s value is reported here and nowhere else, because the control-flow skeleton leaves it out, so changing a constant and changing the shape of the code around it land in different buckets.

**`controlFlow` read only `readonly string[]`**

Per-statement control-flow skeleton, one line per statement, addressed by path.

## See also

- [`isSemanticallyEqual`](https://typeshade.dev/api/issemanticallyequal/)

## Source

[`src/core/semantic-diff.ts`, line 55](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/semantic-diff.ts#L55), at commit af54ddad5
