Cannot 'implement' Person from class
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
When I try to implement 'Person' on a class like:
```JS
import { Person as PersonSchema } from 'schema-dts';
export class Person implements PersonSchema { ... }
```
TS errors with
```
A class can only implement an object type or intersection of object types with statically known members.
```
Which can be solved by editing this snippet:
```JS
export declare type Person = ({
"@type": "Person";
} & PersonBase) | Patient;
```
to
```JS
export declare type Person = ({
"@type": "Person";
} & PersonBase);
```
Obviously, this case is true for any type declaration in the pattern `(...) | [TYPE]`. The same applies to extending interfaces.
What is the reason for this pattern? Is it intended?
Contributor guide
Assessment
This issue has not been assessed yet.