Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
553 stars 44 forks source link

Use external object when defining a variable identical to class name #328

Open liorgonnen opened 4 years ago

liorgonnen commented 4 years ago

three.js contains a definition file called AudioContext.d.ts.

The file contents is:

export const AudioContext: AudioContext;

This is being translated to:

external var AudioContext: AudioContext

There are two issues here:

  1. The AudioContext class doesn't exist (it's part of the Web Audio API)
  2. This is the issue I want to focus on here: Even if the class was defined (or if I add it manually), we still get a conflicting declarations error.

Could this be translated into either:

external object AudioContext

or

external interface AudioContext

(I'm currently using the latter here and here

Schahen commented 4 years ago

Interesting. I wonder what does original definition stands for in first place

 export const AudioContext: AudioContext;   
Schahen commented 4 years ago

I have to move it to 0.5.9 since there's a need to investigate what would be the better option.