Re: [w3c/webcomponents] How to define APIs only for custom element authors (#758)

> can we realize APIs which are available only for custom element authors

Do you mean, can we allow the mixins to be used only with Element classes? If so, then yeah we can:

The mixin could check the base class to make sure it is an Element class, f.e., pseudo code of the native code in JS:

```js
function withSomeFeature(Base = HTMLElement) {
  if (!extends from(Base, Element)) throw new TypeError('mixin can only be used on classes extending Element')

  // continue, return class extends Base...
}
```

Or did you mean something else?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/758#issuecomment-421536878

Received on Saturday, 15 September 2018 07:04:49 UTC