/
pptelement.ts
88 lines (82 loc) · 1.54 KB
/
pptelement.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* The model for a parsed Powerpoint Element which the parsers generate
*/
export interface PowerpointElement {
name: string; //or the name combined
shapeType: string; //the preset type of shape as defined the Offixe XML schema
specialityType: SpecialityType; //Do something special such as "images","textboxes","media"
elementPosition: {
//location to place the element
x: number;
y: number;
};
elementOffsetPosition: {
cx: number;
cy: number;
};
paragraph?: {
text: string;
textCharacterProperties: {
fontAttributes: FontAttributes[];
font: string;
size: number;
fillColor: string;
};
paragraphProperties: {
alignment: TextAlignment;
};
};
shape?: {
border?: {
thickness: number;
color: string;
type: BorderType;
radius?: number;
};
fill: {
fillType: FillType;
fillColor: string;
};
opacity: number;
};
fontStyle?: {
font: string;
fontSize: number;
fontColor: string;
};
links?: {
Type: LinkType;
Uri: string;
//wherever or whichever element this might link do
};
raw: any; //the entire unparsed element object
}
export enum BorderType {
dotted = "dotted",
dashed = "dashed",
solid = "solid"
}
export enum FontAttributes {
Bold,
Italics,
Underline,
StrikeThrough
}
export enum TextAlignment {
Center = "center",
Left = "left",
Right = "right",
Justified = "justify"
}
export enum SpecialityType {
Image = "Image",
None = "None"
}
export enum LinkType {
Asset = "Asset",
External = "External"
}
export enum FillType {
Image = "Image",
Solid = "Solid"
}