@netless/slide 0.2.9 → 0.3.2

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
@@ -50,4 +50,6 @@ slide.setSlideState(args);
50
50
 
51
51
  Slide 对象上暴露了一系列只读属性, 可以获取当前运行状态, 参考 d.ts 类型定义文件.
52
52
 
53
- ### [changelog](./changelog.md)
53
+ ### [示例及具体文档参考](https://github.com/netless-io/netless-slide-demo)
54
+
55
+ ### [changelog](./changelog.md)
package/lib/Slide.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { ErrorType } from "@netless/ppt-player";
1
2
  export interface RtcAudio {
2
3
  /**
3
4
  * 开始播放音频.
@@ -61,6 +62,11 @@ export interface RtcAudioClazz {
61
62
  }
62
63
  export declare const delay: (value: number) => Promise<unknown>;
63
64
  export declare function waitUntil(fn: () => boolean, timeout: number): Promise<void>;
65
+ interface ILogger {
66
+ info?(msg: string): void;
67
+ error?(msg: string): void;
68
+ warn?(msg: string): void;
69
+ }
64
70
  export declare const SLIDE_EVENTS: {
65
71
  /** 同步事件派发 */
66
72
  readonly syncDispatch: "syncDispatch";
@@ -134,6 +140,10 @@ export interface ISlideConfig {
134
140
  * 提供的音频播放器类, 用于 rtc 混音
135
141
  */
136
142
  rtcAudio?: RtcAudioClazz;
143
+ /**
144
+ * 提供 logger 对象, 用以记录运行日志
145
+ */
146
+ logger?: ILogger;
137
147
  }
138
148
  interface MediaState {
139
149
  type: "pause" | "play";
@@ -256,8 +266,6 @@ export declare class Slide extends Slide_base {
256
266
  private timestamp;
257
267
  private mode;
258
268
  private enableGlobalClick;
259
- private log;
260
- private logId;
261
269
  private lastEmitedState;
262
270
  private persistLogId;
263
271
  private syncQueue;
@@ -270,6 +278,7 @@ export declare class Slide extends Slide_base {
270
278
  private isReleasing;
271
279
  private isTouchStart;
272
280
  private touchStartId;
281
+ private taskId;
273
282
  private designWidth;
274
283
  private designHeight;
275
284
  private _slideCount;
@@ -280,10 +289,7 @@ export declare class Slide extends Slide_base {
280
289
  private handleViewTouchStart;
281
290
  private handleViewTouchEnd;
282
291
  private createController;
283
- private persistLog;
284
292
  private handleSlideRef;
285
- private handleSlideStateLog;
286
- private handleLogDownload;
287
293
  private setMedianControllerAttribute;
288
294
  private frameResizeHandler;
289
295
  private resizeView;
@@ -300,6 +306,10 @@ export declare class Slide extends Slide_base {
300
306
  * 返回 slide 总页数
301
307
  */
302
308
  get slideCount(): number;
309
+ /**
310
+ * 获取 slide 总页数, 可以在 renderSlide 之前调用
311
+ */
312
+ getSlideCountAsync(): Promise<number>;
303
313
  /**
304
314
  * 整个 slide 的状态, 将获取的值传递给另一个客户端, 并调用 setSlideState
305
315
  * 可以完成整体同步. 只读属性.
@@ -429,4 +439,3 @@ export declare class Slide extends Slide_base {
429
439
  destroy(): void;
430
440
  static disposeLocalCache(): void;
431
441
  }
432
- export {};