Hello! I have created a simple interface in Kotlin...
# javascript
s
Hello! I have created a simple interface in Kotlin that I want to export to typescript.
Copy code
@JsExport
interface IAddress {
  var id: String
}
What is exported in the
.d.ts
file is this:
Copy code
interface IAddress {
        id: string;
        readonly __doNotUseIt: __doNotImplementIt;
    }
There is the
__doNotUseIt
property that is added. How can I have this not added to the typed definition file. I’m using Kotlin 1.6.20-M1 Thanks! 🙂
youtrack 1
t
Just don’t use it! 🙂
@hfhbd Do you have such problems?
b
You can get rid of it by making the interdace external
h
Yes, I do have the same type, but only at the top of the
.d.ts
file, not in my definitions.
Copy code
declare const __doNotImplementIt: unique symbol
type __doNotImplementIt = typeof __doNotImplementIt
Ah, it only happens when you export a Kotlin interface. We don't export interfaces, only classes.
s
@turansky I can’t only “don’t use it” because when I want to create an object with that interface, I get an error.
Copy code
const addr: shared.IAddress = {
      id: 'sdsds',
    }
Property '__doNotUseIt' is missing in type '{ id: string; }' but required in type 'IAddress'
And thanks @Big Chungus, making the interface
external
did fix my problem!