@netless/slide 0.7.5 → 0.7.7

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,18 @@
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 两个事件
246
+
247
+ #### 0.7.7
248
+
249
+ * 新增 "@slide/_request_frozen_" 全局事件, 冻结所有 ppt
250
+ * 新增 "@slide/_request_release_" 全局事件, 释放所有 ppt
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,9 +300,15 @@ 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 {
310
+ static instances: Slide[];
311
+ static _tempFrozenIds: string[];
302
312
  static _tempLog: string;
303
313
  static _tempLogIndex: number;
304
314
  static flushLog(force?: boolean): Promise<void>;
@@ -351,6 +361,8 @@ export declare class Slide extends Slide_base {
351
361
  private recoverHandler;
352
362
  private reportError;
353
363
  initSlideConfig(config: ISlideConfig): ISlideConfig;
364
+ static handleFrozenAllSlide: () => void;
365
+ static handleReleaseAllSlide: () => void;
354
366
  static handleLogReport: (sessionId: string) => Promise<void>;
355
367
  static handleLogDownload: () => Promise<void>;
356
368
  private initPlayer;
@@ -542,6 +554,17 @@ export declare class Slide extends Slide_base {
542
554
  * 返回 ppt 是否存在上一步动作
543
555
  */
544
556
  hasPrevStep(): boolean;
557
+ /**
558
+ * 截取当前状态的截图
559
+ * @return 图片 dataUrl, 如果失败则返回 null
560
+ */
561
+ snapshot(): Promise<string | null>;
562
+ /**
563
+ * 截取动画最后一步状态的截图
564
+ * @param index 要截取的页码
565
+ * @return 图片 dataUrl, 如果失败则返回 null
566
+ */
567
+ snapshotWithTimingEnd(index: number): Promise<string | null>;
545
568
  /**
546
569
  * 设置全局音量, 非同步操作, 只会修改本地音量,不会触发同步事件
547
570
  * @param v 数值范围 0 ~ 1