# TSR1204: Global augmentation in a sound file changes types for the whole program without a check. Move it to a '.d.ts' file.

> 'declare global' or a global merge from a script file in a sound file changes types program-wide. Move it to a .d.ts file.

## What it means

`declare global { ... }` and global declarations merged from a script file (such as `interface Array<T> { ... }` at the top level of a non-module file) change types for the whole program without a check. In a sound file they are reported at `global`, or at the merged declaration's name.

## Example

```ts
// Global augmentation changes types for the whole program.
declare global { // @expect TSR1204
  interface Window {
    tsrFixtureState?: string;
  }
}
export {};
```

## How to fix

- Move the `declare global` block into a project `.d.ts` file.

Sound mode is defined in [design record 0007](https://github.com/Webb-Ventures/typescript-rust/blob/main/docs/design/0007-sound-mode.md) (accepted 2026-10-15).

Source: https://ts-r.dev/errors/TSR1204/
