Hey everyone, interfaces in my d.ts files have a _...
# javascript
j
Hey everyone, interfaces in my d.ts files have a __doNotUseOrImplementIt property:
Copy code
interface IFoo {
        bar(): void;
        readonly __doNotUseOrImplementIt: {
            readonly "IFoo": unique symbol;
        };
    }
An implementation without the property obviously doesn't compile. An implementation with the property doesn't compile either. For example this doesn't build:
Copy code
class Foo implements IFoo {
    bar(): void {
        throw new Error("Method not implemented.");
    }
    readonly __doNotUseOrImplementIt: { readonly foo: unique symbol; };
}
Suggested workarounds in KT-56618 are: • write a script to remove them (looks like a hack with unknown side effects) • do expect/actual for any interfaces you want to implement in TS Has anyone else run into this? Are these truly my best options? Am I just doing something wrong?
t
You can mark
IFoo
as
external
to avoid regular interfaces limitations
e
I'm currently using a post compile step to remove them.