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