@shbernal/pptxgenjs 5.0.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Bn as WriteFileProps, C as CHART_TYPE, Ln as ThemeProps, Q as OutputType, T as ChartType, Vn as WriteProps, Zt as ISlideRelMedia, bn as SlideLayout, it as SCHEME_COLOR_NAMES, jn as TableToSlidesProps, ln as PresLayout, lt as SchemeColor, mn as SectionProps, mt as AddSlideProps, ot as SHAPE_TYPE, pt as WRITE_OUTPUT_TYPE, un as PresSlide, ut as ShapeType, v as AlignH, wn as SlideMasterProps, y as AlignV, zn as WriteBaseProps } from "./units-CpDIQgsT.js";
1
+ import { $ as OutputType, $n as WriteProps, Bn as TableStyleProps, C as CHART_TYPE, Hn as TableToSlidesProps, Mn as SlideMasterProps, On as SlideLayout, Qn as WriteFileProps, Sn as SectionProps, T as ChartType, Yn as ThemeProps, Zn as WriteBaseProps, _n as PresLayout, a as StandardLayout, at as SCHEME_COLOR_NAMES, dt as ShapeType, gt as AddSlideProps, ht as WRITE_OUTPUT_TYPE, rn as ISlideRelMedia, st as SHAPE_TYPE, ut as SchemeColor, v as AlignH, vn as PresSlide, wt as CustomPropertyValue, y as AlignV } from "./units-y594YyBo.js";
2
2
 
3
3
  //#region src/runtime/types.d.ts
4
4
  type RuntimeAdapter = {
@@ -25,7 +25,7 @@ declare class PptxGenJS {
25
25
  * @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e
26
26
  */
27
27
  private _layout;
28
- set layout(value: string);
28
+ set layout(value: string | StandardLayout);
29
29
  get layout(): string;
30
30
  /**
31
31
  * PptxGenJS Library Version
@@ -69,6 +69,10 @@ declare class PptxGenJS {
69
69
  private _title;
70
70
  set title(value: string);
71
71
  get title(): string;
72
+ /** Slide number shown on the first slide (maps to firstSlideNum in presentation.xml) */
73
+ private _firstSlideNum;
74
+ set firstSlideNum(value: number);
75
+ get firstSlideNum(): number;
72
76
  /**
73
77
  * Whether Right-to-Left (RTL) mode is enabled
74
78
  * @type {boolean}
@@ -85,6 +89,9 @@ declare class PptxGenJS {
85
89
  /** this Presentation's sections */
86
90
  private readonly _sections;
87
91
  get sections(): SectionProps[];
92
+ /** custom document properties stored in docProps/custom.xml */
93
+ private _customProperties;
94
+ private readonly _tableStyles;
88
95
  /** slide layout definition objects, used for generating slide layout files */
89
96
  private readonly _slideLayouts;
90
97
  get slideLayouts(): SlideLayout[];
@@ -171,6 +178,13 @@ declare class PptxGenJS {
171
178
  * @returns {Promise<string>} the presentation name
172
179
  */
173
180
  writeFile(props?: WriteFileProps | string): Promise<string>;
181
+ /**
182
+ * Set a custom document property stored in `docProps/custom.xml`.
183
+ * Calling with the same name replaces the existing value.
184
+ * @param name - property name
185
+ * @param value - string, integer/float number, boolean, or Date
186
+ */
187
+ setCustomProperty(name: string, value: CustomPropertyValue): void;
174
188
  /**
175
189
  * Add a new Section to Presentation
176
190
  * @param {ISectionProps} section - section properties
@@ -194,6 +208,22 @@ declare class PptxGenJS {
194
208
  * @param {SlideMasterProps} props - layout properties
195
209
  */
196
210
  defineSlideMaster(props: SlideMasterProps): void;
211
+ /**
212
+ * Register a reusable custom table style and return its GUID.
213
+ * The style is written to `ppt/tableStyles.xml` and is editable in PowerPoint's
214
+ * Table Styles gallery. Pass the returned GUID as `TableProps.tableStyle`, and use
215
+ * the `has*` flags (`hasHeader`, `hasBandedRows`, …) to activate the matching regions.
216
+ * @param {TableStyleProps} props - custom table style definition (requires `name`)
217
+ * @returns {string} braced GUID to use as `tableStyle`
218
+ * @example
219
+ * const brand = pptx.defineTableStyle({
220
+ * name: 'Brand Banded',
221
+ * firstRow: { fill:'1A2B3C', color:'FFFFFF', bold:true },
222
+ * band1H: { fill:'EAF1F8' },
223
+ * })
224
+ * slide.addTable(rows, { tableStyle: brand, hasHeader:true, hasBandedRows:true })
225
+ */
226
+ defineTableStyle(props: TableStyleProps): string;
197
227
  /**
198
228
  * Reproduces an HTML table as a PowerPoint table - including column widths, style, etc. - creates 1 or more slides as needed
199
229
  * @param {string} eleId - table HTML element ID
@@ -203,4 +233,4 @@ declare class PptxGenJS {
203
233
  }
204
234
  //#endregion
205
235
  export { PptxGenJS as t };
206
- //# sourceMappingURL=pptxgen-BqDpIYsq.d.ts.map
236
+ //# sourceMappingURL=pptxgen-DzBNFPxG.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pptxgen-DzBNFPxG.d.ts","names":[],"sources":["../src/runtime/types.ts","../src/pptxgen.ts"],"mappings":";;;KAGY,cAAA;EAAA,SACF,mBAAA,EAAqB,iBAAA;EAC9B,SAAA,GAAY,GAAA,EAAK,cAAA;IAAmB,IAAA;EAAA,MAAmB,OAAA;EACvD,mBAAA,GAAsB,GAAA,EAAK,cAAA,KAAmB,OAAA;EAC9C,SAAA,GAAY,QAAA,UAAkB,IAAA,WAAe,WAAA,GAAc,IAAA,GAAO,UAAA,KAAe,OAAA;AAAA;;;cC+L7D,SAAA;;AAZG;;;;;;;;;;;UA2Bf,OAAA;EAAA,IACG,MAAA,CAAO,KAAA,WAAgB,cAAA;EAAA,IAavB,MAAA;EAmLc;;;EAAA,iBA5KR,QAAA;EAAA,IACN,OAAA;EA6MiB;;;EAAA,QAtMpB,OAAA;EAAA,IACG,MAAA,CAAO,KAAA;EAAA,IAIP,MAAA;EA0b2B;;;EAAA,QAnb9B,QAAA;EAAA,IACG,OAAA,CAAQ,KAAA;EAAA,IAIR,OAAA;EA0b0C;;;;EAAA,QAlb7C,SAAA;EAAA,IACG,QAAA,CAAS,KAAA;EAAA,IAIT,QAAA;EA8iBU;;;EAAA,QAviBb,QAAA;EAAA,IACG,OAAA,CAAQ,KAAA;EAAA,IAIR,OAAA;EAvEH;;;EAAA,QA8EA,MAAA;EAAA,IACG,KAAA,CAAM,KAAA,EAAO,UAAA;EAAA,IAIb,KAAA,IAAS,UAAA;EA7DT;;;EAAA,QAoEH,MAA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