import { djbase, djclass, bind, prototype, AbstractConstructor } from "../declare"; import { DjxWidgetBase } from "../tsx/DjxWidgetBase"; import { createElement } from "../tsx"; interface MyWidgetAttrs { title: string; counter: number; } interface MyWidgetEvents { "count-inc": Event; "count-dec": Event; } @djclass export class MyWidget extends djbase(DjxWidgetBase as AbstractConstructor>) { @bind({ node: "titleNode", type: "innerHTML" }) title = ""; @prototype() counter = 0; render() { const Frame = (props: any) =>
{props.children}
; return

this._onIncClick(e)}>[+] this._onDecClick()}>[-]
; } _onIncClick(e: MouseEvent) { this.emit("count-inc", { bubbles: false }); } _onDecClick() { this.emit("count-dec", { bubbles: false }); } }