I have a problem with exporting an interface called Person
. I recently added a new property to it, but when I try to export it, I encounter the following error message:
'Person' only refers to a type, but is being used as a value here.
.
// test.d.ts
interface Person {
age: number,
name: string
}
interface Person {
canCode: boolean
}
export Person // => 'Person' only refers to a type, but is being used as a value here.
// test.ts
import { Person } from './test' // => Module '"./test"' declares 'Person' locally, but it is not exported.
const myPerson: Person = {
age: 17,
name: 'Roman',
canCode: true
}
Can someone please help me fix this issue?
Additional Information
Language:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f3878a83968090819a8387b3c7ddc2ddc1">[email protected]</a>
Editor:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b6a7f64664b3a253e38253b">[email protected]</a>
Editor Typescript package:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8a9bca7a5e5bcb1b8adbbabbaa1b8bc88f9fce6f9e6fa">[email protected]</a>
(which is using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="72060b02170111001b020632465c425c41">[email protected]</a>
)
I have already checked all the code and suggestions in VSC, but the issue still persists.