Expose header
This commit is contained in:
@ -1,21 +1,23 @@
|
|||||||
import { Relationships } from "file/relationships";
|
|
||||||
import { Document } from "./document";
|
import { Document } from "./document";
|
||||||
import { SectionPropertiesOptions } from "./document/body/section-properties/section-properties";
|
import { SectionPropertiesOptions } from "./document/body/section-properties/section-properties";
|
||||||
|
import { Header } from "./header/header";
|
||||||
import { Media } from "./media";
|
import { Media } from "./media";
|
||||||
import { Numbering } from "./numbering";
|
import { Numbering } from "./numbering";
|
||||||
import { Paragraph } from "./paragraph";
|
import { Paragraph } from "./paragraph";
|
||||||
import { IPropertiesOptions, Properties } from "./properties";
|
import { IPropertiesOptions, Properties } from "./properties";
|
||||||
|
import { Relationships } from "./relationships";
|
||||||
import { Styles } from "./styles";
|
import { Styles } from "./styles";
|
||||||
import { DefaultStylesFactory } from "./styles/factory";
|
import { DefaultStylesFactory } from "./styles/factory";
|
||||||
import { Table } from "./table";
|
import { Table } from "./table";
|
||||||
|
|
||||||
export class File {
|
export class File {
|
||||||
private document: Document;
|
private readonly document: Document;
|
||||||
private styles: Styles;
|
private readonly styles: Styles;
|
||||||
private properties: Properties;
|
private readonly properties: Properties;
|
||||||
private numbering: Numbering;
|
private readonly numbering: Numbering;
|
||||||
private media: Media;
|
private readonly media: Media;
|
||||||
private relationships: Relationships;
|
private readonly relationships: Relationships;
|
||||||
|
private readonly header: Header;
|
||||||
|
|
||||||
constructor(options?: IPropertiesOptions, sectionPropertiesOptions?: SectionPropertiesOptions) {
|
constructor(options?: IPropertiesOptions, sectionPropertiesOptions?: SectionPropertiesOptions) {
|
||||||
this.document = new Document(sectionPropertiesOptions);
|
this.document = new Document(sectionPropertiesOptions);
|
||||||
@ -32,8 +34,9 @@ export class File {
|
|||||||
|
|
||||||
this.properties = new Properties(options);
|
this.properties = new Properties(options);
|
||||||
this.numbering = new Numbering();
|
this.numbering = new Numbering();
|
||||||
this.media = new Media();
|
|
||||||
this.relationships = new Relationships();
|
this.relationships = new Relationships();
|
||||||
|
this.media = new Media();
|
||||||
|
this.header = new Header();
|
||||||
}
|
}
|
||||||
|
|
||||||
public addParagraph(paragraph: Paragraph): void {
|
public addParagraph(paragraph: Paragraph): void {
|
||||||
@ -53,7 +56,7 @@ export class File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public createImage(image: string): void {
|
public createImage(image: string): void {
|
||||||
const mediaData = this.media.addMedia(image);
|
const mediaData = this.media.addMedia(image, this.relationships.RelationshipCount);
|
||||||
this.relationships.createRelationship(
|
this.relationships.createRelationship(
|
||||||
mediaData.referenceId,
|
mediaData.referenceId,
|
||||||
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
||||||
@ -85,4 +88,8 @@ export class File {
|
|||||||
public get Relationships(): Relationships {
|
public get Relationships(): Relationships {
|
||||||
return this.relationships;
|
return this.relationships;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get Header(): Header {
|
||||||
|
return this.header;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user