mirror of
https://github.com/astefanutti/decktape.git
synced 2024-09-11 22:27:11 +03:00
BREAKING CHANGE: Please run node 12.20 or higher BREAKING CHANGE: This package is now a pure esm, please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
42 lines
854 B
JavaScript
42 lines
854 B
JavaScript
export const create = page => new Shower(page);
|
|
|
|
class Shower {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
getName() {
|
|
return 'Shower 1.x';
|
|
}
|
|
|
|
isActive() {
|
|
return this.page.evaluate(_ =>
|
|
typeof shower === 'object' && typeof shower.modules === 'undefined');
|
|
}
|
|
|
|
configure() {
|
|
return this.page.evaluate(_ => {
|
|
shower.showPresenterNotes = _ => {};
|
|
shower.first();
|
|
shower.enterSlideMode();
|
|
});
|
|
}
|
|
|
|
slideCount() {
|
|
return this.page.evaluate(_ => shower.slideList.length);
|
|
}
|
|
|
|
hasNextSlide() {
|
|
return this.page.evaluate(_ => shower.getCurrentSlideNumber() + 1 in shower.slideList);
|
|
}
|
|
|
|
nextSlide() {
|
|
return this.page.evaluate(_ => shower.next());
|
|
}
|
|
|
|
currentSlideIndex() {
|
|
return this.page.evaluate(_ => shower.getSlideHash(shower.getCurrentSlideNumber()).substring(1));
|
|
}
|
|
}
|