Constructor
new PowerPoint(opts, projects, aggregators, baseDate?)
- Source:
Constructor for the PowerPoint class.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
object | The presentation specification containing various configuration parameters |
projects |
Array.<object> | An array of project objects |
aggregators |
Array.<object> | An array of aggregators objects |
baseDate? |
Date | The base date from which to calculate dates |
Methods
(static) configureTemplate(template, config)
- Source:
Returns a presentation template that has been configured using the given substitutions.
Parameters:
| Name | Type | Description |
|---|---|---|
template |
Object | |
config |
Object |
(static) toUpperCaseFirst(s) → {string}
- Source:
Sets the first character of a string to uppercase.
Parameters:
| Name | Type | Description |
|---|---|---|
s |
string |
Returns:
- Type
- string
addSection(sectionNames)
- Source:
Adds sections to the PowerPoint object
Parameters:
| Name | Type | Description |
|---|---|---|
sectionNames |
Array.<string> | An array of section names |
addSlide(slideOpts)
- Source:
Adds a single slide to the PowerPoint object
Parameters:
| Name | Type | Description |
|---|---|---|
slideOpts |
object | The options object for the slide |
addSlides(slides)
- Source:
Adds slides to the PowerPoint object
Parameters:
| Name | Type | Description |
|---|---|---|
slides |
Array.<object> | An array of slide objects |
download(name) → {Promise.<File>}
- Source:
Downloads the generated PowerPoint presentation as a file with the given name.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name of the downloaded file. If not provided, defaults to the slide title and subject. |
Returns:
A Promise that resolves with the File object representing the downloaded PowerPoint presentation
- Type
- Promise.<File>
getBlob() → {Promise.<Blob>}
- Source:
Generates a new PowerPoint presentation file and returns it as a Blob.
Returns:
A Promise that resolves with the Blob object representing the generated PowerPoint presentation
- Type
- Promise.<Blob>
prepare(onprepared, onfail)
- Source:
Fetches any dynamic data from the API and integrates it into the slide specs. It then builds the presentation ready for download and calls any callback function.
Parameters:
| Name | Type | Description |
|---|---|---|
onprepared |
function | The callback function to be called after preparing the presentation. |
onfail |
function | The callback function to be called if the presentation fails to prepare |