Buslowicz / twc

TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
32 stars 1 forks source link

two preserves imported interfaces (and should not) #138

Open tpluscode opened 6 years ago

tpluscode commented 6 years ago

I have code similar to this

import {IHydraResource} from 'alcaeus/types/Resources';

@CustomElement()
export class AugeanConsole extends Polymer.Element {

    model: IHydraResource = null;
}

The interface has no meaning in JavaScript and with twc 0.4.6 it was replaced with object.

In twc 0.5.5 however the interface makes its way through to JS code and breaks at runtime (targeting Polymer 2.0).

class AugeanConsole extends Polymer.Element {
  static get is() {
    return "augean-console";
  }
  static get properties() {
    return {
      model: {
        type: IHydraResource,
        value: null
      }
    }
  }
}