Make hyperlinks declarative
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { File } from "../file";
|
||||
import { IXmlableObject } from "./xmlable-object";
|
||||
|
||||
export abstract class BaseXmlComponent {
|
||||
@ -9,7 +10,7 @@ export abstract class BaseXmlComponent {
|
||||
this.rootKey = rootKey;
|
||||
}
|
||||
|
||||
public abstract prepForXml(): IXmlableObject | undefined;
|
||||
public abstract prepForXml(file?: File): IXmlableObject | undefined;
|
||||
|
||||
public get IsDeleted(): boolean {
|
||||
return this.deleted;
|
||||
|
@ -4,3 +4,4 @@ export * from "./default-attributes";
|
||||
export * from "./imported-xml-component";
|
||||
export * from "./xmlable-object";
|
||||
export * from "./initializable-xml-component";
|
||||
export * from "./base";
|
||||
|
@ -1,19 +1,19 @@
|
||||
import { File } from "../file";
|
||||
import { BaseXmlComponent } from "./base";
|
||||
import { IXmlableObject } from "./xmlable-object";
|
||||
export { BaseXmlComponent };
|
||||
|
||||
export const EMPTY_OBJECT = Object.seal({});
|
||||
|
||||
export abstract class XmlComponent extends BaseXmlComponent {
|
||||
// tslint:disable-next-line:readonly-keyword
|
||||
protected root: Array<BaseXmlComponent | string>;
|
||||
// tslint:disable-next-line:readonly-keyword no-any
|
||||
protected root: Array<BaseXmlComponent | string | any>;
|
||||
|
||||
constructor(rootKey: string) {
|
||||
super(rootKey);
|
||||
this.root = new Array<BaseXmlComponent | string>();
|
||||
}
|
||||
|
||||
public prepForXml(): IXmlableObject | undefined {
|
||||
public prepForXml(file?: File): IXmlableObject | undefined {
|
||||
const children = this.root
|
||||
.filter((c) => {
|
||||
if (c instanceof BaseXmlComponent) {
|
||||
@ -23,7 +23,7 @@ export abstract class XmlComponent extends BaseXmlComponent {
|
||||
})
|
||||
.map((comp) => {
|
||||
if (comp instanceof BaseXmlComponent) {
|
||||
return comp.prepForXml();
|
||||
return comp.prepForXml(file);
|
||||
}
|
||||
return comp;
|
||||
})
|
||||
|
Reference in New Issue
Block a user