import { CustomElementConstructor } from './types';
import { name } from './name.js';

export function define(Ctor: CustomElementConstructor): CustomElementConstructor {
  customElements.define(Ctor.is || name(), Ctor);
  return Ctor;
}

import { CustomElementConstructor } from './types';
import { name } from './name.js';

export function define(
  ctor: CustomElementConstructor
): CustomElementConstructor {
  if (!ctor.is) {
    ctor.is = name();
  }
  customElements.define(ctor.is, ctor);
  return ctor;
}

Define is class property on constructor if it's not present.
Define is class property on constructor if it's not present.
