Commit 39ad574
authored
Add support for "private" custom elements (#1943)
In typescript, users can specify a private constructor to prevent
subclassing
```ts
class XFoo extends HTMLElement {
private constructor() {
super();
}
}
```
In order to support this construction with `@customElement`, we have to
switch from using `Constructor<HTMLElement>` to `Omit<typeof
HTMLElement, 'new'>`.1 parent 660192d commit 39ad574
File tree
2 files changed
+20
-7
lines changed- packages/reactive-element/src
- decorators
- test/decorators
2 files changed
+20
-7
lines changedLines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | | - | |
| 65 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
0 commit comments