improved type annotation for Attributes#prepForXml

This commit is contained in:
felipe
2017-03-10 08:58:29 +01:00
parent 3a6cf81c60
commit 958b5ea307

View File

@ -16,7 +16,7 @@ export abstract class XmlAttributeComponent extends BaseXmlComponent {
}
}
public prepForXml(): object {
public prepForXml(): {_attr: {[key: string]: (string | number | boolean)}} {
const attrs = {};
if (this.root !== undefined) {
_.forOwn(this.root, (value, key) => {
@ -26,6 +26,6 @@ export abstract class XmlAttributeComponent extends BaseXmlComponent {
}
});
}
return {[this.rootKey]: attrs};
return {_attr: attrs};
}
}