custom-element.d.ts 767 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @license
  3. * Copyright 2017 Google LLC
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. import { ClassDescriptor } from './base.js';
  7. /**
  8. * Allow for custom element classes with private constructors
  9. */
  10. declare type CustomElementClass = Omit<typeof HTMLElement, 'new'>;
  11. /**
  12. * Class decorator factory that defines the decorated class as a custom element.
  13. *
  14. * ```js
  15. * @customElement('my-element')
  16. * class MyElement extends LitElement {
  17. * render() {
  18. * return html``;
  19. * }
  20. * }
  21. * ```
  22. * @category Decorator
  23. * @param tagName The tag name of the custom element to define.
  24. */
  25. export declare const customElement: (tagName: string) => (classOrDescriptor: CustomElementClass | ClassDescriptor) => any;
  26. export {};
  27. //# sourceMappingURL=custom-element.d.ts.map