# prefer-function-type

Prefer function types over single-signature structural types

A structural type containing only one callable signature adds structure without expressing another capability.
Instead, you SHOULD write the callable directly as a function or constructor type.

Nominal, inherited, and overloaded callable types retain their declarations.

- Category: style
- Level: warning
- Fix: automatic
- Scope: module

## Reported

```ds title="main.ds"
type Transform = { (value: int32): string };
```

## Accepted

```ds title="main.ds"
type Transform = (value: int32) => string;
```

## Prior art

- [typescript-eslint · prefer-function-type](https://typescript-eslint.io/rules/prefer-function-type)

[language/linter/src/rules/style/prefer_function_type.rs:9](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/prefer_function_type.rs#L9)
