When the npm library KotlinJS
is published with either the coroutine
or ktor
dependency, the resulting generated typescript d.ts
file contains references to atomicfu
.
export namespace kotlinx.atomicfu {
function atomic$ref$<T>(initial: T, trace: kotlinx.atomicfu.TraceBase): kotlinx.atomicfu.AtomicRef<T>;
function atomic$boolean$(initial: boolean, trace: kotlinx.atomicfu.TraceBase): kotlinx.atomicfu.AtomicBoolean;
function atomic$int$(initial: number, trace: kotlinx.atomicfu.TraceBase): kotlinx.atomicfu.AtomicInt;
function atomic$long$(initial: kotlin.Long, trace: kotlinx.atomicfu.TraceBase): kotlinx.atomicfu.AtomicLong;
}
However, the reference for TraceBase
is missing from the file. When compiling a Typescript
app that depends on the above kotlinJS
library, it raises an error about the absence of TraceBase
.
The only workaround currently is to add skipLibCheck = true
in the tsconfig
file, which is not an ideal solution for users of the library.
Is there a better way to address this issue?