# Type conventions

> ngwr declares its public shapes as interfaces and exports a small set of shared type aliases. This page explains the conventions behind that choice — see the Catalog for the types you meet most often.

Source: https://ngwr.dev/reference/interfaces/overview  
Kind: Reference

## Why ngwr provides this

Inline `T | null | undefined` unions repeat everywhere a value can be absent; `Maybe<T>` names the pattern once and keeps public signatures short. `SafeAny` exists because a bare `any` is invisible in review and impossible to grep — the alias marks every deliberate type-system escape so they can be found and burned down later.

## Why interfaces, not types

ngwr declares every object shape as an `interface` — errors point at the named shape instead of an expanded literal, consumers can `extends` them, and declaration merging stays available. `type` is reserved for what interfaces can't express: unions (`WrColor`, mode strings) and aliases (`Maybe<T>`). The lib folders mirror the convention — every entry keeps its shapes in `interfaces/`. Note that `export type { WrCascaderOption }` is just TypeScript's type-only **export syntax** (erased at runtime) — the declaration behind it is still an `interface`.

## See also

- [Catalog](https://ngwr.dev/reference/interfaces/catalog) — The public types you meet most often, in one table.
- [Common types](https://ngwr.dev/reference/interfaces/common) — The `Maybe\<T>` and `SafeAny` aliases every entry point leans on.
- [Theme types](https://ngwr.dev/reference/interfaces/theme) — The colour and mode unions — `WrColor`, `WrThemeMode`, `WrResolvedTheme`.
