# TS2386: Overload signatures must all be optional or required.

> Overloads of a method or property disagree on whether it is optional. Mark all of them with ? or none of them.

## What it means

An overloaded method declares one member. Writing `?` on some of its signatures and not on
others asks for a member that is both optional and required, which is reported on the
signature that differs.

## Example

```ts
export class Store {
  get(key: string): string;
  get?(key: number): string;
  get(key: string | number): string {
    return String(key);
  }
}
```

## How to fix

- Put `?` on every signature of the member, or on none.
- If one form really is optional, give it a separate name.

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