@netless/slide 0.1.28 → 0.1.33
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/lib/Slide.d.ts +32 -5
- package/lib/Slide.js +24 -24
- package/lib/SyncTaskManager.d.ts +0 -1
- package/lib/SyncTaskManager.js +0 -2
- package/package.json +2 -2
package/lib/Slide.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const delay: (value: number) => Promise<unknown>;
|
|
2
|
+
export declare function waitUntil(fn: () => boolean, timeout: number): Promise<void>;
|
|
1
3
|
export declare const SLIDE_EVENTS: {
|
|
2
4
|
/** 同步事件派发 */
|
|
3
5
|
readonly syncDispatch: "syncDispatch";
|
|
@@ -61,6 +63,11 @@ export interface ISlideConfig {
|
|
|
61
63
|
interface MediaState {
|
|
62
64
|
type: "pause" | "play";
|
|
63
65
|
time: number;
|
|
66
|
+
frozenTime?: number;
|
|
67
|
+
}
|
|
68
|
+
interface TimeNodeSeqState {
|
|
69
|
+
step: number;
|
|
70
|
+
state: "idle" | "running" | "end" | null;
|
|
64
71
|
}
|
|
65
72
|
interface ISlideState {
|
|
66
73
|
taskId: string;
|
|
@@ -68,10 +75,12 @@ interface ISlideState {
|
|
|
68
75
|
currentSlideIndex: number;
|
|
69
76
|
mainSeqStep: number;
|
|
70
77
|
mainSeqState: "idle" | "running" | "end" | null;
|
|
71
|
-
appliedInteractiveSeqIds: string[];
|
|
72
78
|
mediaState: {
|
|
73
79
|
[key: string]: MediaState;
|
|
74
80
|
};
|
|
81
|
+
interactiveSeqState: {
|
|
82
|
+
[key: string]: TimeNodeSeqState;
|
|
83
|
+
};
|
|
75
84
|
}
|
|
76
85
|
export declare type SyncEvent = SyncInteractiveAnimEvent | SyncPrevStepEvent | SyncNextStepEvent | SyncRenderSlideEvent | SyncSetResourceEvent | SyncMediaPlayEvent | SyncMediaPauseEvent | SyncMediaSeekEvent;
|
|
77
86
|
export interface BasicSyncEvent {
|
|
@@ -96,7 +105,7 @@ export interface SyncMediaSeekEvent extends BasicSyncEvent {
|
|
|
96
105
|
}
|
|
97
106
|
export interface SyncInteractiveAnimEvent extends BasicSyncEvent {
|
|
98
107
|
type: "interactiveAnim";
|
|
99
|
-
|
|
108
|
+
seqId: string;
|
|
100
109
|
}
|
|
101
110
|
export interface SyncPrevStepEvent extends BasicSyncEvent {
|
|
102
111
|
type: "prevStep";
|
|
@@ -156,7 +165,7 @@ export declare class Slide extends Slide_base {
|
|
|
156
165
|
private isLoading;
|
|
157
166
|
private interactive;
|
|
158
167
|
private anchor;
|
|
159
|
-
private player
|
|
168
|
+
private player?;
|
|
160
169
|
private frameWidth;
|
|
161
170
|
private frameHeight;
|
|
162
171
|
private frame;
|
|
@@ -172,7 +181,15 @@ export declare class Slide extends Slide_base {
|
|
|
172
181
|
private playerController;
|
|
173
182
|
private lock;
|
|
174
183
|
private isInitResized;
|
|
184
|
+
private cacheImage;
|
|
185
|
+
private config;
|
|
186
|
+
private isFrowning;
|
|
187
|
+
private isReleasing;
|
|
188
|
+
private designWidth;
|
|
189
|
+
private designHeight;
|
|
190
|
+
private _slideCount;
|
|
175
191
|
constructor(config: ISlideConfig);
|
|
192
|
+
private initPlayer;
|
|
176
193
|
private createController;
|
|
177
194
|
private persistLog;
|
|
178
195
|
private handleSlideRef;
|
|
@@ -188,6 +205,7 @@ export declare class Slide extends Slide_base {
|
|
|
188
205
|
* @param state ISlideState
|
|
189
206
|
*/
|
|
190
207
|
setSlideState(state: Partial<ISlideState>): Promise<void>;
|
|
208
|
+
private initInteractiveSeq;
|
|
191
209
|
private initMedia;
|
|
192
210
|
/**
|
|
193
211
|
* 返回 slide 总页数
|
|
@@ -222,7 +240,7 @@ export declare class Slide extends Slide_base {
|
|
|
222
240
|
* 实时渲染属性, 只读属性.
|
|
223
241
|
* @readonly
|
|
224
242
|
*/
|
|
225
|
-
get renderOptions(): ISlideRenderOptions;
|
|
243
|
+
get renderOptions(): ISlideRenderOptions | null;
|
|
226
244
|
/**
|
|
227
245
|
* drawCall 次数, 即每帧调用 gpu drawElements 次数, 只读属性.
|
|
228
246
|
* @readonly
|
|
@@ -242,7 +260,7 @@ export declare class Slide extends Slide_base {
|
|
|
242
260
|
* 渲染 Slide 的 canvas 元素.
|
|
243
261
|
* @readonly
|
|
244
262
|
*/
|
|
245
|
-
get view(): HTMLCanvasElement;
|
|
263
|
+
get view(): HTMLCanvasElement | null;
|
|
246
264
|
/**
|
|
247
265
|
* Slide 宽度. 此宽度为设计宽度, 由 ppt 决定. 只读属性.
|
|
248
266
|
* @readonly
|
|
@@ -284,6 +302,7 @@ export declare class Slide extends Slide_base {
|
|
|
284
302
|
*/
|
|
285
303
|
prevStep(): void;
|
|
286
304
|
private doPrevStep;
|
|
305
|
+
private isSlideStateReady;
|
|
287
306
|
private emitStateChange;
|
|
288
307
|
private emitSyncDispatch;
|
|
289
308
|
/**
|
|
@@ -306,6 +325,14 @@ export declare class Slide extends Slide_base {
|
|
|
306
325
|
*/
|
|
307
326
|
resume(): void;
|
|
308
327
|
getPreviewImage(slideIndex: number): Promise<string | null>;
|
|
328
|
+
/**
|
|
329
|
+
* 进入冻结状态, 将 ppt 画面缓存为一张图片, 并释放 webgl 上下文
|
|
330
|
+
*/
|
|
331
|
+
frozen(): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* 从冻结状态恢复
|
|
334
|
+
*/
|
|
335
|
+
release(): Promise<void>;
|
|
309
336
|
/**
|
|
310
337
|
* 销毁方法.
|
|
311
338
|
*/
|