@netless/slide 0.7.5 → 0.7.6

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.
package/README.md CHANGED
@@ -233,3 +233,13 @@
233
233
  #### 0.7.3
234
234
 
235
235
  * postMessage 获取日志添加 session 控制
236
+
237
+ #### 0.7.5
238
+
239
+ * 支持全部的元素动画
240
+ * 修复字动画位置不正确
241
+
242
+ #### 0.7.6
243
+
244
+ * 新增 Slide.snapshot 及 Slide.snapshotWithTimingEnd 两个截图 api
245
+ * 新增 SLIDE_EVENTS.slideStepEnd 及 SLIDE_EVENTS slideStepStart 两个事件
package/lib/Slide.d.ts CHANGED
@@ -106,6 +106,10 @@ export declare const SLIDE_EVENTS: {
106
106
  readonly animateEnd: "animateEnd";
107
107
  /** slide 状态变化触发 */
108
108
  readonly stateChange: "stateChange";
109
+ /** ppt 已经没有下一步动作触发 **/
110
+ readonly slideStepEnd: "slideEnd";
111
+ /** ppt 已经没有上一步动作触发 **/
112
+ readonly slideStepStart: "slideStart";
109
113
  };
110
114
  export interface ISlideRenderOptions {
111
115
  /** 预期最低渲染 fps, 默认 40 */
@@ -296,6 +300,10 @@ export interface SlideEventEmitter {
296
300
  on(event: typeof SLIDE_EVENTS.stateChange, listener: (state: ISlideState) => void): this;
297
301
  emit(event: typeof SLIDE_EVENTS.syncEventLag): boolean;
298
302
  on(event: typeof SLIDE_EVENTS.syncEventLag, listener: () => void): this;
303
+ emit(event: typeof SLIDE_EVENTS.slideStepEnd): boolean;
304
+ on(event: typeof SLIDE_EVENTS.slideStepEnd, listener: () => void): this;
305
+ emit(event: typeof SLIDE_EVENTS.slideStepStart): boolean;
306
+ on(event: typeof SLIDE_EVENTS.slideStepStart, listener: () => void): this;
299
307
  }
300
308
  declare const Slide_base: new () => SlideEventEmitter;
301
309
  export declare class Slide extends Slide_base {
@@ -542,6 +550,17 @@ export declare class Slide extends Slide_base {
542
550
  * 返回 ppt 是否存在上一步动作
543
551
  */
544
552
  hasPrevStep(): boolean;
553
+ /**
554
+ * 截取当前状态的截图
555
+ * @return 图片 dataUrl, 如果失败则返回 null
556
+ */
557
+ snapshot(): Promise<string | null>;
558
+ /**
559
+ * 截取动画最后一步状态的截图
560
+ * @param index 要截取的页码
561
+ * @return 图片 dataUrl, 如果失败则返回 null
562
+ */
563
+ snapshotWithTimingEnd(index: number): Promise<string | null>;
545
564
  /**
546
565
  * 设置全局音量, 非同步操作, 只会修改本地音量,不会触发同步事件
547
566
  * @param v 数值范围 0 ~ 1