I'm trying to write an external declaration for th...
# javascript
j
I'm trying to write an external declaration for the following typescript interface:
Copy code
export interface Headers {
  'content-length'?: string;
}
Dukat generates the following, which is valid Kotlin in general:
Copy code
external interface Headers {
    var `content-length`: String?
        get() = definedExternally
        set(value) = definedExternally
}
But now the compiler complains:
Name contains illegal chars that can't appear in JavaScript identifier
Does this mean that the kotlin compiler doesn't support outputting JS with string properties? I tried with
@JsName
, but it doesn't accept the dash either. Is there a way to work around this? EDIT: question posted on StackOverflow https://stackoverflow.com/questions/56434633/external-declaration-gives-name-contains-illegal-chars-that-cant-appear-in-jav
u
@Joffrey Please, create issue also in
dukat
github https://github.com/Kotlin/dukat/issues And I join the question. Why illegal chars can't appear in JavaScript property identifier?
j
@U75957 well, this is not a Dukat issue, since I cannot even write a correct external definition manually. There is nothing (to my knowledge) that Dukat could output that would work