File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ type WritableKeys<T> = Extract<
3939 * An {@link !Element} component
4040 * @typeParam T Component element type
4141 */
42- export abstract class ElementComponent < T extends Element > {
42+ export abstract class BaseComponent < T extends Element > {
4343 public readonly element : T ;
4444
4545 protected constructor ( element : T ) {
@@ -49,15 +49,15 @@ export abstract class ElementComponent<T extends Element> {
4949 /**
5050 * Insert component after the last child
5151 */
52- public append ( component : ElementComponent < any > ) {
52+ public append ( component : BaseComponent < any > ) {
5353 this . element . appendChild ( component . element ) ;
5454 return this ;
5555 }
5656
5757 /**
5858 * Insert component before the first child
5959 */
60- public prepend ( component : ElementComponent < any > ) {
60+ public prepend ( component : BaseComponent < any > ) {
6161 this . element . prepend ( component . element ) ;
6262 return this ;
6363 }
Original file line number Diff line number Diff line change 1414 * You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515 * If not, see <https://www.gnu.org/licenses/>.
1616 */
17- import { ElementComponent } from "./index.js" ;
17+ import { BaseComponent } from "./index.js" ;
1818
1919type ElementToTagName < T extends HTMLElement > = {
2020 [ K in keyof HTMLElementTagNameMap ] : HTMLElementTagNameMap [ K ] extends T ? K : never
@@ -26,7 +26,7 @@ type ElementToTagName<T extends HTMLElement> = {
2626 * To create your own component, it's recommended to extend this class.
2727 * @typeParam T Component element type
2828 */
29- export class Component < T extends HTMLElement = HTMLElement > extends ElementComponent < T > {
29+ export class Component < T extends HTMLElement = HTMLElement > extends BaseComponent < T > {
3030 /**
3131 * Create Component instance
3232 * @param element Instance or tag name
Original file line number Diff line number Diff line change 1414 * You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515 * If not, see <https://www.gnu.org/licenses/>.
1616 */
17- import { ElementComponent } from "./index.js" ;
17+ import { BaseComponent } from "./index.js" ;
1818
1919/**
2020 * An SVG component (`<svg>`)
2121 */
22- export class SvgComponent extends ElementComponent < SVGSVGElement > {
22+ export class SvgComponent extends BaseComponent < SVGSVGElement > {
2323 public constructor ( element ?: SVGSVGElement ) {
2424 super ( element ?? document . createElementNS ( "http://www.w3.org/2000/svg" , "svg" ) ) ;
2525 }
Original file line number Diff line number Diff line change 1414 * You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515 * If not, see <https://www.gnu.org/licenses/>.
1616 */
17- export { ElementComponent } from "./ElementComponent .js" ;
17+ export { BaseComponent } from "./BaseComponent .js" ;
1818export { Component } from "./Component.js" ;
1919export { SvgComponent } from "./SvgComponent.js" ;
You can’t perform that action at this time.
0 commit comments