-
Notifications
You must be signed in to change notification settings - Fork 690
/
Copy pathcore-interfaces.ts
1913 lines (1870 loc) · 47.3 KB
/
core-interfaces.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* PptxGenJS Interfaces
*/
import { CHART_NAME, PLACEHOLDER_TYPE, SHAPE_NAME, SLIDE_OBJECT_TYPES, TEXT_HALIGN, TEXT_VALIGN, WRITE_OUTPUT_TYPE } from './core-enums'
// Core Types
// ==========
/**
* Coordinate number - either:
* - Inches (0-n)
* - Percentage (0-100)
*
* @example 10.25 // coordinate in inches
* @example '75%' // coordinate as percentage of slide size
*/
export type Coord = number | `${number}%`
export interface PositionProps {
/**
* Horizontal position
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
x?: Coord
/**
* Vertical position
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
y?: Coord
/**
* Height
* - inches or percentage
* @example 10.25 // height in inches
* @example '75%' // height as percentage of slide size
*/
h?: Coord
/**
* Width
* - inches or percentage
* @example 10.25 // width in inches
* @example '75%' // width as percentage of slide size
*/
w?: Coord
}
/**
* Either `data` or `path` is required
*/
export interface DataOrPathProps {
/**
* URL or relative path
*
* @example 'https://onedrives.com/myimg.png` // retrieve image via URL
* @example '/home/gitbrent/images/myimg.png` // retrieve image via local path
*/
path?: string
/**
* base64-encoded string
* - Useful for avoiding potential path/server issues
*
* @example 'image/png;base64,iVtDafDrBF[...]=' // pre-encoded image in base-64
*/
data?: string
}
export interface BackgroundProps extends DataOrPathProps, ShapeFillProps {
/**
* Color (hex format)
* @deprecated v3.6.0 - use `ShapeFillProps` instead
*/
fill?: Color
/**
* source URL
* @deprecated v3.6.0 - use `DataOrPathProps` instead - remove in v4.0.0
*/
src?: string
}
/**
* Color in Hex format
* @example 'FF3399'
*/
export type HexColor = string
export type ThemeColor = 'tx1' | 'tx2' | 'bg1' | 'bg2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6'
export type Color = HexColor | ThemeColor | ModifiedThemeColor
export type Margin = number | [number, number, number, number]
export type HAlign = 'left' | 'center' | 'right' | 'justify'
export type VAlign = 'top' | 'middle' | 'bottom'
export interface ModifiedThemeColor {
baseColor: HexColor | ThemeColor
/**
* - number 0-100
*/
alpha?: number
alphaMod?: number
alphaOff?: number
blue?: number
blueMod?: number
blueOff?: number
green?: number
greenMod?: number
greenOff?: number
red?: number
redMod?: number
redOff?: number
hue?: number
hueMod?: number
hueOff?: number
lum?: number
lumMod?: number
lumOff?: number
sat?: number
satMod?: number
satOff?: number
shade?: number
tint?: number
comp?: boolean
gray?: boolean
inv?: boolean
gamma?: boolean
}
// used by charts, shape, text
export interface BorderProps {
/**
* Border type
* @default solid
*/
type?: 'none' | 'dash' | 'solid'
/**
* Border color (hex)
* @example 'FF3399'
* @default '666666'
*/
color?: HexColor
// TODO: add `transparency` prop to Borders (0-100%)
// TODO: add `width` - deprecate `pt`
/**
* Border size (points)
* @default 1
*/
pt?: number
}
// used by: image, object, text,
export interface HyperlinkProps {
_rId: number
/**
* Slide number to link to
*/
slide?: number
/**
* Url to link to
*/
url?: string
/**
* Hyperlink Tooltip
*/
tooltip?: string
}
// used by: chart, text, image
export interface ShadowProps {
/**
* shadow type
* @default 'none'
*/
type: 'outer' | 'inner' | 'none'
/**
* opacity (percent)
* - range: 0.0-1.0
* @example 0.5 // 50% opaque
*/
opacity?: number // TODO: "Transparency (0-100%)" in PPT // TODO: deprecate and add `transparency`
/**
* blur (points)
* - range: 0-100
* @default 0
*/
blur?: number
/**
* angle (degrees)
* - range: 0-359
* @default 0
*/
angle?: number
/**
* shadow offset (points)
* - range: 0-200
* @default 0
*/
offset?: number // TODO: "Distance" in PPT
/**
* shadow color (hex format)
* @example 'FF3399'
*/
color?: HexColor
/**
* whether to rotate shadow with shape
* @default false
*/
rotateWithShape?: boolean
}
// used by: shape, table, text
export interface ShapeFillProps {
/**
* Fill color
* - `HexColor` or `ThemeColor`
* @example 'FF0000' // hex color (red)
* @example pptx.SchemeColor.text1 // Theme color (Text1)
*/
color?: Color
/**
* Transparency (percent)
* - MS-PPT > Format Shape > Fill & Line > Fill > Transparency
* - range: 0-100
* @default 0
*/
transparency?: number
/**
* Fill type
* @default 'solid'
*/
type?: 'none' | 'solid'
/**
* Transparency (percent)
* @deprecated v3.3.0 - use `transparency`
*/
alpha?: number
}
export interface ShapeLineProps extends ShapeFillProps {
/**
* Line width (pt)
* @default 1
*/
width?: number
/**
* Dash type
* @default 'solid'
*/
dashType?: 'solid' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'sysDash' | 'sysDot'
/**
* Begin arrow type
* @since v3.3.0
*/
beginArrowType?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle'
/**
* End arrow type
* @since v3.3.0
*/
endArrowType?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle'
// FUTURE: beginArrowSize (1-9)
// FUTURE: endArrowSize (1-9)
/**
* Dash type
* @deprecated v3.3.0 - use `dashType`
*/
lineDash?: 'solid' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'sysDash' | 'sysDot'
/**
* @deprecated v3.3.0 - use `beginArrowType`
*/
lineHead?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle'
/**
* @deprecated v3.3.0 - use `endArrowType`
*/
lineTail?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle'
/**
* Line width (pt)
* @deprecated v3.3.0 - use `width`
*/
pt?: number
/**
* Line size (pt)
* @deprecated v3.3.0 - use `width`
*/
size?: number
}
// used by: chart, slide, table, text
export interface TextBaseProps {
/**
* Horizontal alignment
* @default 'left'
*/
align?: HAlign
/**
* Bold style
* @default false
*/
bold?: boolean
/**
* Add a line-break
* @default false
*/
breakLine?: boolean
/**
* Add standard or custom bullet
* - use `true` for standard bullet
* - pass object options for custom bullet
* @default false
*/
bullet?:
| boolean
| {
/**
* Bullet type
* @default bullet
*/
type?: 'bullet' | 'number'
/**
* Bullet character code (unicode)
* @since v3.3.0
* @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA)
*/
characterCode?: string
/**
* Indentation (space between bullet and text) (points)
* @since v3.3.0
* @default 27 // DEF_BULLET_MARGIN
* @example 10 // Indents text 10 points from bullet
*/
indent?: number
/**
* Number type
* @since v3.3.0
* @example 'romanLcParenR' // roman numerals lower-case with paranthesis right
*/
numberType?:
| 'alphaLcParenBoth'
| 'alphaLcParenR'
| 'alphaLcPeriod'
| 'alphaUcParenBoth'
| 'alphaUcParenR'
| 'alphaUcPeriod'
| 'arabicParenBoth'
| 'arabicParenR'
| 'arabicPeriod'
| 'arabicPlain'
| 'romanLcParenBoth'
| 'romanLcParenR'
| 'romanLcPeriod'
| 'romanUcParenBoth'
| 'romanUcParenR'
| 'romanUcPeriod'
/**
* Number bullets start at
* @since v3.3.0
* @default 1
* @example 10 // numbered bullets start with 10
*/
numberStartAt?: number
// DEPRECATED
/**
* Bullet code (unicode)
* @deprecated v3.3.0 - use `characterCode`
*/
code?: string
/**
* Margin between bullet and text
* @since v3.2.1
* @deplrecated v3.3.0 - use `indent`
*/
marginPt?: number
/**
* Number to start with (only applies to type:number)
* @deprecated v3.3.0 - use `numberStartAt`
*/
startAt?: number
/**
* Number type
* @deprecated v3.3.0 - use `numberType`
*/
style?: string
}
/**
* Text color
* - `HexColor` or `ThemeColor`
* - MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Color
* @example 'FF0000' // hex color (red)
* @example pptx.SchemeColor.text1 // Theme color (Text1)
*/
color?: Color
/**
* Font face name
* @example 'Arial' // Arial font
*/
fontFace?: string
/**
* Font size
* @example 12 // Font size 12
*/
fontSize?: number
/**
* Text highlight color (hex format)
* @example 'FFFF00' // yellow
*/
highlight?: HexColor
/**
* italic style
* @default false
*/
italic?: boolean
/**
* language
* - ISO 639-1 standard language code
* @default 'en-US' // english US
* @example 'fr-CA' // french Canadian
*/
lang?: string
/**
* Add a soft line-break (shift+enter) before line text content
* @default false
* @since v3.5.0
*/
softBreakBefore?: boolean
/**
* tab stops
* - PowerPoint: Paragraph > Tabs > Tab stop position
* @example [{ position:1 }, { position:3 }] // Set first tab stop to 1 inch, set second tab stop to 3 inches
*/
tabStops?: Array<{ position: number, alignment?: 'l' | 'r' | 'ctr' | 'dec' }>
/**
* text direction
* `horz` = horizontal
* `vert` = rotate 90^
* `vert270` = rotate 270^
* `wordArtVert` = stacked
* @default 'horz'
*/
textDirection?: 'horz' | 'vert' | 'vert270' | 'wordArtVert'
/**
* Transparency (percent)
* - MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Transparency
* - range: 0-100
* @default 0
*/
transparency?: number
/**
* underline properties
* - PowerPoint: Font > Color & Underline > Underline Style/Underline Color
* @default (none)
*/
underline?: {
style?:
| 'dash'
| 'dashHeavy'
| 'dashLong'
| 'dashLongHeavy'
| 'dbl'
| 'dotDash'
| 'dotDashHeave'
| 'dotDotDash'
| 'dotDotDashHeavy'
| 'dotted'
| 'dottedHeavy'
| 'heavy'
| 'none'
| 'sng'
| 'wavy'
| 'wavyDbl'
| 'wavyHeavy'
color?: Color
}
/**
* vertical alignment
* @default 'top'
*/
valign?: VAlign
}
export interface PlaceholderProps extends PositionProps, TextBaseProps {
name: string
type: PLACEHOLDER_TYPE
/**
* margin (points)
*/
margin?: Margin
}
export interface ObjectNameProps {
/**
* Object name
* - used instead of default "Object N" name
* - PowerPoint: Home > Arrange > Selection Pane...
* @since v3.10.0
* @default 'Object 1'
* @example 'Antenna Design 9'
*/
objectName?: string
}
export interface ThemeProps {
/**
* Headings font face name
* @example 'Arial Narrow'
* @default 'Calibri Light'
*/
headFontFace?: string
/**
* Body font face name
* @example 'Arial'
* @default 'Calibri'
*/
bodyFontFace?: string
/**
* Theme hex colors in following order: Text/Background - Dark 1, Text/Background - Light 1, Text/Background - Dark 2, Text/Background - Light 2, Accent 1, Accent 2, Accent 3, Accent 4, Accent 5, Accent 6, Hyperlink, Followed Hyperlink
* @example '['000000', 'FFFFFF', '44546A', 'E7E6E6', '4472C4', 'ED7D31', 'A5A5A5', 'FFC000', '5B9BD5', '70AD47', '0563C1', '954F72']'
* @default '['000000', 'FFFFFF', '44546A', 'E7E6E6', '4472C4', 'ED7D31', 'A5A5A5', 'FFC000', '5B9BD5', '70AD47', '0563C1', '954F72']'
*/
themeColors?: string[]
}
// image / media ==================================================================================
export type MediaType = 'audio' | 'online' | 'video'
export interface ImageProps extends PositionProps, DataOrPathProps, ObjectNameProps {
/**
* Alt Text value ("How would you describe this object and its contents to someone who is blind?")
* - PowerPoint: [right-click on an image] > "Edit Alt Text..."
*/
altText?: string
/**
* Flip horizontally?
* @default false
*/
flipH?: boolean
/**
* Flip vertical?
* @default false
*/
flipV?: boolean
hyperlink?: HyperlinkProps
/**
* Placeholder type
* - values: 'body' | 'header' | 'footer' | 'title' | et. al.
* @example 'body'
* @see https://docs.microsoft.com/en-us/office/vba/api/powerpoint.ppplaceholdertype
*/
placeholder?: string
/**
* Image rotation (degrees)
* - range: -360 to 360
* @default 0
* @example 180 // rotate image 180 degrees
*/
rotate?: number
/**
* Enable image rounding
* @default false
*/
rounding?: boolean
/**
* Shadow Props
* - MS-PPT > Format Picture > Shadow
* @example
* { type: 'outer', color: '000000', opacity: 0.5, blur: 20, offset: 20, angle: 270 }
*/
shadow?: ShadowProps
/**
* Image sizing options
*/
sizing?: {
/**
* Sizing type
*/
type: 'contain' | 'cover' | 'crop'
/**
* Image width
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
w: Coord
/**
* Image height
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
h: Coord
/**
* Offset from left to crop image
* - `crop` only
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
x?: Coord
/**
* Offset from top to crop image
* - `crop` only
* - inches or percentage
* @example 10.25 // position in inches
* @example '75%' // position as percentage of slide size
*/
y?: Coord
}
/**
* Transparency (percent)
* - MS-PPT > Format Picture > Picture > Picture Transparency > Transparency
* - range: 0-100
* @default 0
* @example 25 // 25% transparent
*/
transparency?: number
}
/**
* Add media (audio/video) to slide
* @requires either `link` or `path`
*/
export interface MediaProps extends PositionProps, DataOrPathProps, ObjectNameProps {
/**
* Media type
* - Use 'online' to embed a YouTube video (only supported in recent versions of PowerPoint)
*/
type: MediaType
/**
* Cover image
* @since 3.9.0
* @default "play button" image, gray background
*/
cover?: string
/**
* media file extension
* - use when the media file path does not already have an extension, ex: "/folder/SomeSong"
* @since 3.9.0
* @default extension from file provided
*/
extn?: string
/**
* video embed link
* - works with YouTube
* - other sites may not show correctly in PowerPoint
* @example 'https://www.youtube.com/embed/Dph6ynRVyUc' // embed a youtube video
*/
link?: string
/**
* full or local path
* @example 'https://freesounds/simpsons/bart.mp3' // embed mp3 audio clip from server
* @example '/sounds/simpsons_haha.mp3' // embed mp3 audio clip from local directory
*/
path?: string
}
// shapes =========================================================================================
export interface ShapeProps extends PositionProps, ObjectNameProps {
/**
* Horizontal alignment
* @default 'left'
*/
align?: HAlign
/**
* Radius (only for pptx.shapes.PIE, pptx.shapes.ARC, pptx.shapes.BLOCK_ARC)
* - In the case of pptx.shapes.BLOCK_ARC you have to setup the arcThicknessRatio
* - values: [0-359, 0-359]
* @since v3.4.0
* @default [270, 0]
*/
angleRange?: [number, number]
/**
* Radius (only for pptx.shapes.BLOCK_ARC)
* - You have to setup the angleRange values too
* - values: 0.0-1.0
* @since v3.4.0
* @default 0.5
*/
arcThicknessRatio?: number
/**
* Shape fill color properties
* @example { color:'FF0000' } // hex color (red)
* @example { color:'0088CC', transparency:50 } // hex color, 50% transparent
* @example { color:pptx.SchemeColor.accent1 } // Theme color Accent1
*/
fill?: ShapeFillProps
/**
* Flip shape horizontally?
* @default false
*/
flipH?: boolean
/**
* Flip shape vertical?
* @default false
*/
flipV?: boolean
/**
* Add hyperlink to shape
* @example hyperlink: { url: "https://github.com/gitbrent/pptxgenjs", tooltip: "Visit Homepage" },
*/
hyperlink?: HyperlinkProps
/**
* Line options
*/
line?: ShapeLineProps
/**
* Points (only for pptx.shapes.CUSTOM_GEOMETRY)
* - type: 'arc'
* - `hR` Shape Arc Height Radius
* - `wR` Shape Arc Width Radius
* - `stAng` Shape Arc Start Angle
* - `swAng` Shape Arc Swing Angle
* @see http://www.datypic.com/sc/ooxml/e-a_arcTo-1.html
* @example [{ x: 0, y: 0 }, { x: 10, y: 10 }] // draw a line between those two points
*/
points?: Array<
| { x: Coord, y: Coord, moveTo?: boolean }
| { x: Coord, y: Coord, curve: { type: 'arc', hR: Coord, wR: Coord, stAng: number, swAng: number } }
| { x: Coord, y: Coord, curve: { type: 'cubic', x1: Coord, y1: Coord, x2: Coord, y2: Coord } }
| { x: Coord, y: Coord, curve: { type: 'quadratic', x1: Coord, y1: Coord } }
| { close: true }
>
/**
* Rounded rectangle radius (only for pptx.shapes.ROUNDED_RECTANGLE)
* - values: 0.0 to 1.0
* @default 0
*/
rectRadius?: number
/**
* Rotation (degrees)
* - range: -360 to 360
* @default 0
* @example 180 // rotate 180 degrees
*/
rotate?: number
/**
* Shadow options
* TODO: need new demo.js entry for shape shadow
*/
shadow?: ShadowProps
/**
* @deprecated v3.3.0
*/
lineSize?: number
/**
* @deprecated v3.3.0
*/
lineDash?: 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDot'
/**
* @deprecated v3.3.0
*/
lineHead?: 'arrow' | 'diamond' | 'none' | 'oval' | 'stealth' | 'triangle'
/**
* @deprecated v3.3.0
*/
lineTail?: 'arrow' | 'diamond' | 'none' | 'oval' | 'stealth' | 'triangle'
/**
* Shape name (used instead of default "Shape N" name)
* @deprecated v3.10.0 - use `objectName`
*/
shapeName?: string
}
// tables =========================================================================================
export interface TableToSlidesProps extends TableProps {
_arrObjTabHeadRows?: TableRow[]
// _masterSlide?: SlideLayout
/**
* Add an image to slide(s) created during autopaging
* - `image` prop requires either `path` or `data`
* - see `DataOrPathProps` for details on `image` props
* - see `PositionProps` for details on `options` props
*/
addImage?: { image: DataOrPathProps, options: PositionProps }
/**
* Add a shape to slide(s) created during autopaging
*/
addShape?: { shapeName: SHAPE_NAME, options: ShapeProps }
/**
* Add a table to slide(s) created during autopaging
*/
addTable?: { rows: TableRow[], options: TableProps }
/**
* Add a text object to slide(s) created during autopaging
*/
addText?: { text: TextProps[], options: TextPropsOptions }
/**
* Whether to enable auto-paging
* - auto-paging creates new slides as content overflows a slide
* @default true
*/
autoPage?: boolean
/**
* Auto-paging character weight
* - adjusts how many characters are used before lines wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // lines are longer (increases the number of characters that can fit on a given line)
*/
autoPageCharWeight?: number
/**
* Auto-paging line weight
* - adjusts how many lines are used before slides wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // tables are taller (increases the number of lines that can fit on a given slide)
*/
autoPageLineWeight?: number
/**
* Whether to repeat head row(s) on new tables created by autopaging
* @since v3.3.0
* @default false
*/
autoPageRepeatHeader?: boolean
/**
* The `y` location to use on subsequent slides created by autopaging
* @default (top margin of Slide)
*/
autoPageSlideStartY?: number
/**
* Column widths (inches)
*/
colW?: number | number[]
/**
* Master slide name
* - define a master slide to have your auto-paged slides have corporate design, etc.
* @see https://gitbrent.github.io/PptxGenJS/docs/masters.html
*/
masterSlideName?: string
/**
* Slide margin
* - this margin will be across all slides created by auto-paging
*/
slideMargin?: Margin
/**
* @deprecated v3.3.0 - use `autoPageRepeatHeader`
*/
addHeaderToEach?: boolean
/**
* @deprecated v3.3.0 - use `autoPageSlideStartY`
*/
newSlideStartY?: number
}
export interface TableCellProps extends TextBaseProps {
/**
* Auto-paging character weight
* - adjusts how many characters are used before lines wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // lines are longer (increases the number of characters that can fit on a given line)
*/
autoPageCharWeight?: number
/**
* Auto-paging line weight
* - adjusts how many lines are used before slides wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // tables are taller (increases the number of lines that can fit on a given slide)
*/
autoPageLineWeight?: number
/**
* Cell border
*/
border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps]
/**
* Cell colspan
*/
colspan?: number
/**
* Fill color
* @example { color:'FF0000' } // hex color (red)
* @example { color:'0088CC', transparency:50 } // hex color, 50% transparent
* @example { color:pptx.SchemeColor.accent1 } // theme color Accent1
*/
fill?: ShapeFillProps
hyperlink?: HyperlinkProps
/**
* Cell margin (inches)
* @default 0
*/
margin?: Margin
/**
* Cell rowspan
*/
rowspan?: number
}
export interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
_arrObjTabHeadRows?: TableRow[]
/**
* Whether to enable auto-paging
* - auto-paging creates new slides as content overflows a slide
* @default false
*/
autoPage?: boolean
/**
* Auto-paging character weight
* - adjusts how many characters are used before lines wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // lines are longer (increases the number of characters that can fit on a given line)
*/
autoPageCharWeight?: number
/**
* Auto-paging line weight
* - adjusts how many lines are used before slides wrap
* - range: -1.0 to 1.0
* @see https://gitbrent.github.io/PptxGenJS/docs/api-tables.html
* @default 0.0
* @example 0.5 // tables are taller (increases the number of lines that can fit on a given slide)
*/
autoPageLineWeight?: number
/**
* Whether table header row(s) should be repeated on each new slide creating by autoPage.
* Use `autoPageHeaderRows` to designate how many rows comprise the table header (1+).
* @default false
* @since v3.3.0
*/
autoPageRepeatHeader?: boolean
/**
* Number of rows that comprise table headers
* - required when `autoPageRepeatHeader` is set to true.
* @example 2 - repeats the first two table rows on each new slide created
* @default 1
* @since v3.3.0
*/
autoPageHeaderRows?: number
/**
* The `y` location to use on subsequent slides created by autopaging
* @default (top margin of Slide)
*/
autoPageSlideStartY?: number
/**
* Table border
* - single value is applied to all 4 sides
* - array of values in TRBL order for individual sides
*/
border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps]
/**
* Width of table columns (inches)
* - single value is applied to every column equally based upon `w`
* - array of values in applied to each column in order
* @default columns of equal width based upon `w`
*/
colW?: number | number[]
/**
* Cell background color
* @example { color:'FF0000' } // hex color (red)
* @example { color:'0088CC', transparency:50 } // hex color, 50% transparent
* @example { color:pptx.SchemeColor.accent1 } // theme color Accent1
*/
fill?: ShapeFillProps
/**
* Cell margin (inches)
* - affects all table cells, is superceded by cell options
*/
margin?: Margin
/**
* Height of table rows (inches)
* - single value is applied to every row equally based upon `h`
* - array of values in applied to each row in order
* @default rows of equal height based upon `h`
*/
rowH?: number | number[]
/**
* DEV TOOL: Verbose Mode (to console)
* - tell the library to provide an almost ridiculous amount of detail during auto-paging calculations
* @default false // obviously
*/
verbose?: boolean // Undocumented; shows verbose output
/**
* @deprecated v3.3.0 - use `autoPageSlideStartY`
*/
newSlideStartY?: number
}
export interface TableCell {
_type: SLIDE_OBJECT_TYPES.tablecell
/** lines in this cell (autoPage) */
_lines?: TableCell[][]
/** `text` prop but guaranteed to hold "TableCell[]" */
_tableCells?: TableCell[]
/** height in EMU */
_lineHeight?: number
_hmerge?: boolean
_vmerge?: boolean
_rowContinue?: number
_optImp?: any
text?: string | TableCell[] // TODO: FUTURE: 20210815: ONly allow `TableCell[]` dealing with string|TableCell[] *SUCKS*
options?: TableCellProps
}
export interface TableRowSlide {
rows: TableRow[]
}
export type TableRow = TableCell[]
// text ===========================================================================================
export interface TextGlowProps {