chore: 🏷️ Aggiornati tipi di dato del componente base
This commit is contained in:
parent
fd4b756bcb
commit
43ceb11755
|
@ -53,46 +53,43 @@ export default class Component implements ComponentAttrs {
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
* @abstract
|
* @abstract
|
||||||
*/
|
*/
|
||||||
view(vnode: Mithril.vnode) {}
|
view(vnode: Mithril.Vnode): Mithril.Children {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
oninit(vnode: Mithril.vnode) {
|
oninit(vnode: Mithril.Vnode) {
|
||||||
this.setAttrs(vnode.attrs);
|
this.setAttrs(vnode.attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
oncreate(vnode: Mithril.vnode) {
|
oncreate(vnode: Mithril.VnodeDOM) {
|
||||||
this.element = vnode.dom;
|
this.element = vnode.dom;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
onbeforeupdate(vnode: Mithril.vnode) {
|
onbeforeupdate(vnode: Mithril.VnodeDOM) {
|
||||||
this.setAttrs(vnode.attrs);
|
this.setAttrs(vnode.attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
onupdate(vnode: Mithril.vnode) {
|
onupdate(vnode: Mithril.VnodeDOM) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
onbeforeremove(vnode: Mithril.vnode) {
|
onbeforeremove(vnode: Mithril.VnodeDOM) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
onremove(vnode: Mithril.vnode) {
|
onremove(vnode: Mithril.VnodeDOM) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a jQuery object for this component's element. If you pass in a
|
* Returns a jQuery object for this component's element. If you pass in a
|
||||||
|
@ -120,7 +117,7 @@ export default class Component implements ComponentAttrs {
|
||||||
*
|
*
|
||||||
* @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children
|
* @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children
|
||||||
*/
|
*/
|
||||||
static component(attrs = {}, children = null): Mithril.vnode {
|
static component(attrs = {}, children = null): Mithril.Vnode {
|
||||||
const componentAttrs: Record<string, unknown> = { ...attrs};
|
const componentAttrs: Record<string, unknown> = { ...attrs};
|
||||||
|
|
||||||
return Mithril.m(this, componentAttrs, children);
|
return Mithril.m(this, componentAttrs, children);
|
||||||
|
|
Loading…
Reference in New Issue