mirror of
https://github.com/jlengrand/open-wc.git
synced 2026-03-10 08:31:19 +00:00
fix(scoped-elements): add constructor to type definition
This commit is contained in:
committed by
Thomas Allmer
parent
3183c5bd33
commit
31ff454a87
5
.changeset/clean-impalas-study.md
Normal file
5
.changeset/clean-impalas-study.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@open-wc/scoped-elements': patch
|
||||
---
|
||||
|
||||
Add constructor to ScopedElementsHost type so that base constructors have the same return type as extensions. See [TypeScript issue](https://github.com/microsoft/TypeScript/issues/40110).
|
||||
15
packages/scoped-elements/src/types.d.ts
vendored
15
packages/scoped-elements/src/types.d.ts
vendored
@@ -1,11 +1,12 @@
|
||||
import { Constructor } from "@open-wc/dedupe-mixin";
|
||||
import { LitElement } from "lit-element";
|
||||
import { Constructor } from '@open-wc/dedupe-mixin';
|
||||
import { LitElement } from 'lit-element';
|
||||
|
||||
export type ScopedElementsMap = {
|
||||
[key: string]: typeof HTMLElement;
|
||||
}
|
||||
[key: string]: typeof HTMLElement;
|
||||
};
|
||||
|
||||
export declare class ScopedElementsHost {
|
||||
constructor(...args: any[]);
|
||||
/**
|
||||
* Obtains the scoped elements definitions map
|
||||
*/
|
||||
@@ -24,9 +25,11 @@ export declare class ScopedElementsHost {
|
||||
/**
|
||||
* Defines a scoped element
|
||||
*/
|
||||
defineScopedElement<T extends HTMLElement>(tagName: string, klass: Constructor<T>): void
|
||||
defineScopedElement<T extends HTMLElement>(tagName: string, klass: Constructor<T>): void;
|
||||
}
|
||||
|
||||
declare function ScopedElementsMixinImplementation<T extends Constructor<LitElement>>(superclass: T): T & Constructor<ScopedElementsHost> & typeof ScopedElementsHost
|
||||
declare function ScopedElementsMixinImplementation<T extends Constructor<LitElement>>(
|
||||
superclass: T,
|
||||
): T & Constructor<ScopedElementsHost> & typeof ScopedElementsHost;
|
||||
|
||||
export type ScopedElementsMixin = typeof ScopedElementsMixinImplementation;
|
||||
|
||||
Reference in New Issue
Block a user