Rename IData to something more reasonable
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
import { IData } from "file/media";
|
import { IMediaData } from "file/media";
|
||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { Inline } from "./inline";
|
import { Inline } from "./inline";
|
||||||
|
|
||||||
export class Drawing extends XmlComponent {
|
export class Drawing extends XmlComponent {
|
||||||
|
|
||||||
constructor(imageData: IData) {
|
constructor(imageData: IMediaData) {
|
||||||
super("w:drawing");
|
super("w:drawing");
|
||||||
|
|
||||||
if (imageData === undefined) {
|
if (imageData === undefined) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
export interface IData {
|
export interface IMediaData {
|
||||||
referenceId: number;
|
referenceId: number;
|
||||||
stream: fs.ReadStream;
|
stream: fs.ReadStream;
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { IData } from "./data";
|
import { IMediaData } from "./data";
|
||||||
|
|
||||||
export class Media {
|
export class Media {
|
||||||
private map: Map<string, IData>;
|
private map: Map<string, IMediaData>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.map = new Map<string, IData>();
|
this.map = new Map<string, IMediaData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMedia(key: string): IData {
|
public getMedia(key: string): IMediaData {
|
||||||
const data = this.map.get(key);
|
const data = this.map.get(key);
|
||||||
|
|
||||||
if (data === undefined) {
|
if (data === undefined) {
|
||||||
@ -28,8 +28,8 @@ export class Media {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public get array(): IData[] {
|
public get array(): IMediaData[] {
|
||||||
const array = new Array<IData>();
|
const array = new Array<IMediaData>();
|
||||||
|
|
||||||
this.map.forEach((data) => {
|
this.map.forEach((data) => {
|
||||||
array.push(data);
|
array.push(data);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// http://officeopenxml.com/WPparagraph.php
|
// http://officeopenxml.com/WPparagraph.php
|
||||||
import { IData } from "file/media";
|
import { IMediaData } from "file/media";
|
||||||
import { Num } from "file/numbering/num";
|
import { Num } from "file/numbering/num";
|
||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { PictureRun, Run, TextRun } from "./run";
|
import { PictureRun, Run, TextRun } from "./run";
|
||||||
@ -38,7 +38,7 @@ export class Paragraph extends XmlComponent {
|
|||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
|
||||||
public createPictureRun(imageData: IData): PictureRun {
|
public createPictureRun(imageData: IMediaData): PictureRun {
|
||||||
const run = new PictureRun(imageData);
|
const run = new PictureRun(imageData);
|
||||||
this.addRun(run);
|
this.addRun(run);
|
||||||
return run;
|
return run;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Drawing } from "../../drawing";
|
import { Drawing } from "../../drawing";
|
||||||
import { IData } from "../../media/data";
|
import { IMediaData } from "../../media/data";
|
||||||
import { Run } from "../run";
|
import { Run } from "../run";
|
||||||
|
|
||||||
export class PictureRun extends Run {
|
export class PictureRun extends Run {
|
||||||
|
|
||||||
constructor(imageData: IData) {
|
constructor(imageData: IMediaData) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
if (imageData === undefined) {
|
if (imageData === undefined) {
|
||||||
|
Reference in New Issue
Block a user