x-tag 仕様には、純粋な JS で次の署名があります -
xtag.register('x-accordion', {
// extend existing elements
extends: 'div',
mixins: ['superdefaults', 'otherdefaults'],
lifecycle:{
created: function(){
// fired once at the time a component
// is initially created or parsed
},
inserted: function(){
// fired each time a component
// is inserted into the DOM
},
removed: function(){
// fired each time an element
// is removed from DOM
},
attributeChanged: function(){
// fired when attributes are set
}
},
events: {
'click:delegate(x-toggler)': function(){
// activate a clicked toggler
}
},
accessors: {
'togglers': {
get: function(){
// return all toggler children
},
set: function(value){
// set the toggler children
}
}
},
methods: {
nextToggler: function(){
// activate the next toggler
},
previousToggler: function(){
// activate the previous toggler
}
}
});
明らかに、メソッド、アクセサー、およびイベントは複数のエントリを持つことができます。
register 関数に渡されるオブジェクト リテラルに相当する Typescript を定義しようとしています。これを達成する方法はありますか?