Skip to content

Commit

Permalink
added "defineLayout" and other updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Jan 1, 2020
1 parent fffa54a commit dab489b
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ export = PptxGenJS

declare class PptxGenJS {
/**
* Library Version
* PptxGenJS Library Version
*/
readonly version: string

// Presentation Props

/**
* Presentation layout name
* Available Layouts:
* 'LAYOUT_4x3' (10" x 7.5")
* 'LAYOUT_16x9' (10" x 5.625")
* 'LAYOUT_16x10' (10" x 6.25")
* 'LAYOUT_WIDE' (13.33" x 7.5")
* 'LAYOUT_USER' (user specified, can be any size)
* @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e
*/
* Presentation layout name
* Standard layouts:
* - 'LAYOUT_4x3' (10" x 7.5")
* - 'LAYOUT_16x9' (10" x 5.625")
* - 'LAYOUT_16x10' (10" x 6.25")
* - 'LAYOUT_WIDE' (13.33" x 7.5")
* Custom layouts:
* Use `pptx.defineLayout()` to create custom layouts (e.g.: 'A4')
* @type {string}
* @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e
*/
layout: string
/**
* Whether Right-to-Left (RTL) mode is enabled
Expand All @@ -41,6 +43,10 @@ declare class PptxGenJS {
// Presentation Metadata
author: string
company: string
/**
* @type {string}
* @note the `revision` value must be a whole number only (without "." or "," - otherwise, PPT will throw errors upon opening!)
*/
revision: string
subject: string
title: string
Expand All @@ -54,6 +60,13 @@ declare class PptxGenJS {
*/
addSlide(masterSlideName?: string): PptxGenJS.Slide
/**
* Define a custom Slide Layout
* @example pptx.defineLayout({ name:'A3', width:16.5, height:11.7 });
* @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e
* @param {IUserLayout} layout - an object with user-defined w/h
*/
defineLayout(layout: PptxGenJS.IUserLayout): void;
/**
* Adds a new slide master [layout] to the Presentation
* @param {ISlideMasterOptions} slideMasterOpts - layout definition
*/
Expand Down Expand Up @@ -509,6 +522,11 @@ declare namespace PptxGenJS {
width?: number
height?: number
}
export interface IUserLayout {
name: string;
width: number;
height: number;
}
export interface ISlideNumber extends PositionOptions {
fontFace?: string
fontSize?: number
Expand Down

0 comments on commit dab489b

Please sign in to comment.