177177177
1771771773y ago

weird interface

how can a class implement this interface
interface I {
(): void
type: string
}
interface I {
(): void
type: string
}
or a const i accidently did this
const a = () => {}

a.type = 'ok'
const a = () => {}

a.type = 'ok'
and it changed a's type to { (): void; type: string }
1 Reply
Bubbles
Bubbles3y ago
For a class you can do class X implements I {}

Did you find this page helpful?