@netless/slide 1.1.2 → 1.1.3
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 +152 -139
- package/lib/Slide.js +44 -43
- package/package.json +2 -2
package/lib/Slide.d.ts
CHANGED
|
@@ -6,82 +6,83 @@ export type { ErrorType } from "@netless/ppt-player";
|
|
|
6
6
|
export declare type UrlInterrupter = (url: string) => Promise<string>;
|
|
7
7
|
export interface ILoaderDelegate {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @param url
|
|
9
|
+
* Load JSON resources, need to return JSON text.
|
|
10
|
+
* @param url Original resource address
|
|
11
11
|
*/
|
|
12
12
|
loadJson(url: string): Promise<string>;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @param url
|
|
14
|
+
* Load image resources, return Blob object.
|
|
15
|
+
* @param url Original resource address
|
|
16
16
|
*/
|
|
17
17
|
loadImage(url: string): Promise<Blob>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param url
|
|
19
|
+
* Media file redirection, mp3 and mp4 resources will call this proxy function, and the redirected URL should be returned.
|
|
20
|
+
* @param url Original resource address
|
|
21
21
|
*/
|
|
22
22
|
redirectMedia(url: string): string;
|
|
23
23
|
}
|
|
24
24
|
export interface RtcAudio {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Start playing audio.
|
|
27
27
|
*/
|
|
28
28
|
play(): void;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Pause audio playback, and the current playback time of the audio remains unchanged.
|
|
31
31
|
*/
|
|
32
32
|
pause(): void;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* When the audio object is no longer in use, it is called.
|
|
35
35
|
*/
|
|
36
36
|
destroy(): void;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Set volume, parameter value range 0 ~ 1.
|
|
39
39
|
*/
|
|
40
40
|
volume(value: number): void;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Get the current playing time of the audio, in seconds.
|
|
43
43
|
*/
|
|
44
44
|
get currentTime(): number;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* Set the current playback time of the audio, in seconds. Please note that whether the audio is playing or not, it needs to be ensured that the setting is successful.
|
|
47
|
+
* If the audio is in a paused state, set this value to ensure that the next time playback resumes, it starts playing from this position.
|
|
48
48
|
*/
|
|
49
49
|
set currentTime(time: number);
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Return whether the audio is in a paused state.
|
|
52
52
|
*/
|
|
53
53
|
get isPaused(): boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Return audio duration.
|
|
56
56
|
*/
|
|
57
57
|
get duration(): number;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* When the audio is loaded, for example: when the audio meta data is loaded and the actual duration of the audio is known,
|
|
60
|
+
* this event needs to be triggered. It is necessary to ensure that this event is triggered when
|
|
61
|
+
* You can obtain the updated audio duration through the duration attribute.
|
|
61
62
|
* @param event
|
|
62
63
|
* @param listener
|
|
63
64
|
*/
|
|
64
65
|
on(event: "load", listener: () => void): this;
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
+
* Trigger when the audio is paused.
|
|
67
68
|
* @param event
|
|
68
69
|
* @param listener
|
|
69
70
|
*/
|
|
70
71
|
on(event: "pause", listener: () => void): this;
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
+
* Trigger when the audio is beginning.
|
|
73
74
|
* @param event
|
|
74
75
|
* @param listener
|
|
75
76
|
*/
|
|
76
77
|
on(event: "play", listener: () => void): this;
|
|
77
78
|
/**
|
|
78
|
-
*
|
|
79
|
+
* Remove all listeners for the specified event.
|
|
79
80
|
*/
|
|
80
81
|
removeAllListeners(event: string): void;
|
|
81
82
|
}
|
|
82
83
|
export interface RtcAudioClazz {
|
|
83
84
|
/**
|
|
84
|
-
*
|
|
85
|
+
* Create an RTC player, with the URL as the audio address.
|
|
85
86
|
* @param url
|
|
86
87
|
*/
|
|
87
88
|
new (url: string): RtcAudio;
|
|
@@ -94,152 +95,161 @@ interface ILogger {
|
|
|
94
95
|
warn?(msg: string): void;
|
|
95
96
|
}
|
|
96
97
|
export declare const SLIDE_EVENTS: {
|
|
97
|
-
/**
|
|
98
|
+
/** Synchronous event dispatch. */
|
|
98
99
|
readonly syncDispatch: "syncDispatch";
|
|
99
|
-
/**
|
|
100
|
+
/** Synchronous event reception */
|
|
100
101
|
readonly syncReceive: "syncReceive";
|
|
101
102
|
/**
|
|
102
|
-
*
|
|
103
|
+
* This event is only triggered in synchronous mode, indicating that synchronous messages are delayed and require full synchronization.
|
|
103
104
|
*/
|
|
104
105
|
readonly syncEventLag: "syncEventLag";
|
|
105
|
-
/**
|
|
106
|
+
/** The current slide rendering starts triggering. */
|
|
106
107
|
readonly renderStart: "renderStart";
|
|
107
|
-
/**
|
|
108
|
+
/** The current slide rendering is complete. */
|
|
108
109
|
readonly renderEnd: "renderEnd";
|
|
109
|
-
/**
|
|
110
|
+
/** Current slide rendering error triggered. */
|
|
110
111
|
readonly renderError: "renderError";
|
|
111
|
-
/**
|
|
112
|
+
/** Page number change triggers */
|
|
112
113
|
readonly slideChange: "slideChange";
|
|
113
|
-
/**
|
|
114
|
+
/** Trigger at the beginning of the main sequence animation. */
|
|
114
115
|
readonly mainSeqStepStart: "mainSeqStepStart";
|
|
115
|
-
/**
|
|
116
|
+
/** Triggered at the end of the main sequence animation. */
|
|
116
117
|
readonly mainSeqStepEnd: "mainSeqStepEnd";
|
|
117
118
|
/**
|
|
118
|
-
*
|
|
119
|
+
* Trigger at the start of any animation.
|
|
119
120
|
*/
|
|
120
121
|
readonly animateStart: "animateStart";
|
|
121
122
|
/**
|
|
122
|
-
*
|
|
123
|
+
* Trigger at the end of any animation.
|
|
123
124
|
*/
|
|
124
125
|
readonly animateEnd: "animateEnd";
|
|
125
|
-
/** slide
|
|
126
|
+
/** slide State change trigger */
|
|
126
127
|
readonly stateChange: "stateChange";
|
|
127
|
-
/** ppt
|
|
128
|
+
/** ppt There is no next action trigger. **/
|
|
128
129
|
readonly slideStepEnd: "slideEnd";
|
|
129
|
-
/** ppt
|
|
130
|
+
/** ppt There is no previous action triggered. **/
|
|
130
131
|
readonly slideStepStart: "slideStart";
|
|
131
132
|
};
|
|
132
133
|
export interface ISlideRenderOptions {
|
|
133
|
-
/**
|
|
134
|
+
/** Minimum expected rendering fps, default is 40 */
|
|
134
135
|
minFPS?: number;
|
|
135
|
-
/**
|
|
136
|
+
/** Expected maximum rendering fps, default is 50 */
|
|
136
137
|
maxFPS?: number;
|
|
137
|
-
/** 渲染分辨倍率, 整数,
|
|
138
|
+
/** 渲染分辨倍率, 整数, default is window.devicePixelRatio */
|
|
138
139
|
resolution?: number;
|
|
139
|
-
/**
|
|
140
|
+
/** Whether to automatically adjust the resolution based on fps., default is false */
|
|
140
141
|
autoResolution?: boolean;
|
|
141
|
-
/**
|
|
142
|
+
/** Automatically reduce rendering. fps */
|
|
142
143
|
autoFPS?: boolean;
|
|
143
|
-
/**
|
|
144
|
+
/** Background color when playing page transition animation, accepts CSS color strings or hexadecimal color values ("#ffffff", 0xffffff) */
|
|
144
145
|
transactionBgColor?: string | number;
|
|
145
146
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* [1]
|
|
149
|
-
* [2]
|
|
150
|
-
* [3]
|
|
151
|
-
* [4] 3K 3200 × 1800,
|
|
152
|
-
*
|
|
147
|
+
* Used to set the maximum display resolution. This value not only affects the canvas rendering resolution, but also affects the texture quality.
|
|
148
|
+
* On low-end devices, reducing this value can greatly improve memory usage and image black screen phenomenon.
|
|
149
|
+
* [1] Minimum 960 * 540, less than 1 is calculated as 1;
|
|
150
|
+
* [2] Normal 1280 * 720; --- default setting for mobile devices.
|
|
151
|
+
* [3] HD 1920 * 1080;
|
|
152
|
+
* [4] 3K 3200 × 1800, greater than 4 is calculated as 4; --- default setting for PC devices.
|
|
153
|
+
* By default, PC devices are set to 3K, and mobile devices are set to 720P.
|
|
153
154
|
*/
|
|
154
155
|
maxResolutionLevel?: number;
|
|
155
156
|
/**
|
|
156
|
-
*
|
|
157
|
+
* Whether to force the use of 2D rendering, forcing the use of 2D rendering will lose some 3D, filters, and effects.
|
|
157
158
|
*/
|
|
158
159
|
forceCanvas?: boolean;
|
|
159
160
|
/**
|
|
160
|
-
* @deprecated
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* 使用不同的逻辑播放切页动画, 不会花屏, 但是切页响应会慢 200 ~ 1000 ms
|
|
161
|
+
* @deprecated The current version has fixed the screen flickering issue, so there is no need to enable this parameter.
|
|
162
|
+
* Should NVIDIA graphics card detection be enabled, Windows 11 with NVIDIA graphics card may experience screen flickering when playing certain page transition animations.
|
|
163
|
+
* Enabling this option will automatically detect whether it is an NVIDIA graphics card. If it is,
|
|
164
|
+
* it will use different logic to play page transition animations without screen flickering, but the response time for page transitions will be slower by 200 to 1000 ms.
|
|
165
165
|
*/
|
|
166
166
|
enableNvidiaDetect?: boolean;
|
|
167
167
|
}
|
|
168
168
|
export interface INavigatorDelegate {
|
|
169
|
-
gotoPage(index: number)
|
|
169
|
+
gotoPage?: (index: number) => void;
|
|
170
|
+
openUrl?: (url: string) => void;
|
|
170
171
|
}
|
|
171
172
|
export interface ISlideConfig {
|
|
172
|
-
/** canvas
|
|
173
|
+
/** canvas mount dom */
|
|
173
174
|
anchor: HTMLDivElement;
|
|
174
|
-
/**
|
|
175
|
+
/** can it interact */
|
|
175
176
|
interactive: boolean;
|
|
176
|
-
/**
|
|
177
|
+
/** render options, Optional */
|
|
177
178
|
renderOptions?: ISlideRenderOptions;
|
|
178
|
-
/**
|
|
179
|
+
/** Whether to display the control bar and stats */
|
|
179
180
|
controller?: boolean;
|
|
180
|
-
/**
|
|
181
|
+
/** Whether to automatically adjust the resolution according to the window size */
|
|
181
182
|
resize?: boolean;
|
|
182
|
-
/**
|
|
183
|
+
/** Get room time */
|
|
183
184
|
timestamp?: () => number;
|
|
184
185
|
/**
|
|
185
|
-
*
|
|
186
|
+
* Operating mode
|
|
186
187
|
*
|
|
187
|
-
* "interactive"
|
|
188
|
-
* "sync"
|
|
189
|
-
* "local"
|
|
188
|
+
* "interactive" Interactive mode, everyone can operate ppt
|
|
189
|
+
* "sync" Synchronization mode, only one person can operate ppt
|
|
190
|
+
* "local" Local mode, no synchronization events will be triggered
|
|
190
191
|
*/
|
|
191
192
|
mode: "interactive" | "sync" | "local";
|
|
192
193
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
194
|
+
* Whether to enable global clicking, after turning on, as long as you click within the ppt viewport range,
|
|
195
|
+
* and do not trigger interactive elements inside ppt, it will trigger the next action.
|
|
196
|
+
* Default is false
|
|
196
197
|
*/
|
|
197
198
|
enableGlobalClick?: boolean;
|
|
198
199
|
/**
|
|
199
|
-
*
|
|
200
|
+
* The provided audio player class, used for rtc mixing
|
|
200
201
|
*/
|
|
201
202
|
rtcAudio?: RtcAudioClazz;
|
|
202
203
|
/**
|
|
203
|
-
*
|
|
204
|
+
* Provide logger object for recording operation logs
|
|
204
205
|
*/
|
|
205
206
|
logger?: ILogger;
|
|
206
207
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
208
|
+
* Whether to enable local caching, after enabling, ppt remote resources will be cached in indexDB
|
|
209
|
+
* Default is true
|
|
209
210
|
*/
|
|
210
211
|
useLocalCache?: boolean;
|
|
211
212
|
/**
|
|
212
|
-
*
|
|
213
|
+
* Resource loading timeout, default 15 seconds
|
|
213
214
|
*/
|
|
214
215
|
resourceTimeout?: number;
|
|
215
216
|
/**
|
|
216
|
-
*
|
|
217
|
+
* Remote resource proxy, for detailed use refer to README
|
|
217
218
|
*/
|
|
218
219
|
loaderDelegate?: ILoaderDelegate;
|
|
219
220
|
/**
|
|
220
|
-
*
|
|
221
|
+
* PPT page navigation proxy, after adding this property,
|
|
222
|
+
* the page number changes caused by actions within the ppt,
|
|
223
|
+
* all go through the proxy logic.
|
|
224
|
+
* PPT opens the webpage, needs to open through the openUrl method,
|
|
225
|
+
* PPT page turning, needs to turn pages through the gotoPage method.
|
|
221
226
|
*/
|
|
222
227
|
navigatorDelegate?: INavigatorDelegate;
|
|
223
228
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* width
|
|
229
|
+
* Set a fixed height and width for ppt, after setting, ppt will not change automatically with the size of the parent element
|
|
230
|
+
* If there is a need for scaling, you need to call the updateFixedFrameSize method
|
|
231
|
+
* The units of width and height attributes are px
|
|
227
232
|
*/
|
|
228
233
|
fixedFrameSize?: {
|
|
229
234
|
width: number;
|
|
230
235
|
height: number;
|
|
231
236
|
};
|
|
232
237
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
238
|
+
* Client id, in synchronization and interactive scenarios, it needs to be able to distinguish each different client.
|
|
239
|
+
* For the end that receives the synchronization message, this needs to be used
|
|
240
|
+
* ClientId distinguishes whether the message sent by oneself is received by oneself.
|
|
241
|
+
* If in the synchronization and interactive scenarios,
|
|
242
|
+
* not giving this value will cause the status to be out of sync in some cases,
|
|
243
|
+
* the known scenarios are:
|
|
244
|
+
* 1. A certain page of ppt has automatic animation, the next action performed during the animation,
|
|
245
|
+
* on other clients may appear as the next page (i.e. page turning)
|
|
237
246
|
*/
|
|
238
247
|
clientId?: string;
|
|
239
248
|
urlInterrupter?: UrlInterrupter;
|
|
240
249
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
250
|
+
* Whether to enable log tracking, after enabling,
|
|
251
|
+
* local logs will be regularly and quantitatively uploaded to the sdk remote server
|
|
252
|
+
* default is true
|
|
243
253
|
*/
|
|
244
254
|
enableTracking?: boolean;
|
|
245
255
|
}
|
|
@@ -436,16 +446,16 @@ export declare class Slide extends Slide_base {
|
|
|
436
446
|
private setMedianControllerAttribute;
|
|
437
447
|
private frameResizeHandler;
|
|
438
448
|
/**
|
|
439
|
-
*
|
|
440
|
-
* @param width
|
|
441
|
-
* @param height
|
|
449
|
+
* Update ppt fixed height and width, this method only takes effect when the fixedFrameSize configuration item is set.
|
|
450
|
+
* @param width Width value that needs to be updated, unit px.
|
|
451
|
+
* @param height Height value that needs to be updated, unit px.
|
|
442
452
|
*/
|
|
443
453
|
updateFixedFrameSize(width: number, height: number, callback?: () => void): void;
|
|
444
454
|
private resizeView;
|
|
445
455
|
private receiveSyncHandler;
|
|
446
456
|
/**
|
|
447
|
-
*
|
|
448
|
-
*
|
|
457
|
+
* Set the state of the entire slide, the slide will update the screen with the incoming state.
|
|
458
|
+
* It is called when synchronizing the whole.
|
|
449
459
|
* @param state ISlideState
|
|
450
460
|
*/
|
|
451
461
|
setSlideState(state: Partial<ISlideState>): Promise<void>;
|
|
@@ -456,71 +466,72 @@ export declare class Slide extends Slide_base {
|
|
|
456
466
|
*/
|
|
457
467
|
get slideCount(): number;
|
|
458
468
|
/**
|
|
459
|
-
*
|
|
460
|
-
*
|
|
469
|
+
* Get the width and height of the slide in pixels,
|
|
470
|
+
* return the array in the form [width, height].
|
|
471
|
+
* Can be called before rendering the slide.
|
|
461
472
|
*/
|
|
462
473
|
getSizeAsync(): Promise<[number, number]>;
|
|
463
474
|
/**
|
|
464
|
-
*
|
|
475
|
+
* Get the total number of slides, you can call it before renderSlide.
|
|
465
476
|
*/
|
|
466
477
|
getSlideCountAsync(): Promise<number>;
|
|
467
478
|
/**
|
|
468
|
-
*
|
|
469
|
-
*
|
|
479
|
+
* The state of the entire slide, pass the obtained value to another client,
|
|
480
|
+
* and call setSlideState to achieve overall synchronization. Read-only property.
|
|
470
481
|
* @readonly
|
|
471
482
|
*/
|
|
472
483
|
get slideState(): ISlideState;
|
|
473
484
|
/**
|
|
474
|
-
*
|
|
485
|
+
* Main sequence animation steps, read-only property.
|
|
475
486
|
* @readonly
|
|
476
487
|
*/
|
|
477
488
|
get mainSeqLength(): number;
|
|
478
489
|
/**
|
|
479
|
-
*
|
|
490
|
+
* Main sequence animation, current step, read-only property.
|
|
480
491
|
* @readonly
|
|
481
492
|
*/
|
|
482
493
|
get mainSeqStep(): number;
|
|
483
494
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
495
|
+
* Main sequence animation, current state, read-only property
|
|
496
|
+
* "idle": Animation has not started
|
|
497
|
+
* "running": Animation is in progress
|
|
498
|
+
* "end": Animation has ended
|
|
499
|
+
* null: The current slide does not have a main sequence animation
|
|
489
500
|
* @readonly
|
|
490
501
|
*/
|
|
491
502
|
get mainSeqState(): "idle" | "running" | "end" | null;
|
|
492
503
|
/**
|
|
493
|
-
*
|
|
504
|
+
* Real-time rendering properties, read-only properties.
|
|
494
505
|
* @readonly
|
|
495
506
|
*/
|
|
496
507
|
get renderOptions(): ISlideRenderOptions | null;
|
|
497
508
|
/**
|
|
498
|
-
* drawCall
|
|
509
|
+
* drawCall count, which means the number of times gpu drawElements is called per frame, read-only property.
|
|
499
510
|
* @readonly
|
|
500
511
|
*/
|
|
501
512
|
get drawCall(): number;
|
|
502
513
|
/**
|
|
503
|
-
*
|
|
514
|
+
* Rendering fps, read-only property.
|
|
504
515
|
* @readonly
|
|
505
516
|
*/
|
|
506
517
|
get renderFps(): number;
|
|
507
518
|
/**
|
|
508
|
-
* js
|
|
519
|
+
* js runtime fps, read-only.
|
|
509
520
|
* @readonly
|
|
510
521
|
*/
|
|
511
522
|
get runtimeFps(): number;
|
|
512
523
|
/**
|
|
513
|
-
*
|
|
524
|
+
* Render the canvas element of the Slide.
|
|
514
525
|
* @readonly
|
|
515
526
|
*/
|
|
516
527
|
get view(): HTMLCanvasElement | null;
|
|
517
528
|
/**
|
|
518
|
-
* Slide
|
|
529
|
+
* Slide width. This width is the design width determined by ppt. Read-only property.
|
|
519
530
|
* @readonly
|
|
520
531
|
*/
|
|
521
532
|
get width(): number;
|
|
522
533
|
/**
|
|
523
|
-
* Slide
|
|
534
|
+
* Slide height. This height is the design height determined by ppt. Read-only property.
|
|
524
535
|
* @readonly
|
|
525
536
|
*/
|
|
526
537
|
get height(): number;
|
|
@@ -530,9 +541,9 @@ export declare class Slide extends Slide_base {
|
|
|
530
541
|
*/
|
|
531
542
|
updateRenderOption(renderOptions: ISlideRenderOptions): void;
|
|
532
543
|
/**
|
|
533
|
-
*
|
|
534
|
-
* @param taskId
|
|
535
|
-
* @param url
|
|
544
|
+
* Set resources after converting ppt
|
|
545
|
+
* @param taskId task id
|
|
546
|
+
* @param url Resource URL prefix
|
|
536
547
|
*/
|
|
537
548
|
setResource(taskId: string, url: string): void;
|
|
538
549
|
private _renderSlide;
|
|
@@ -540,17 +551,18 @@ export declare class Slide extends Slide_base {
|
|
|
540
551
|
private handleNextSlide;
|
|
541
552
|
private handleGotoSlide;
|
|
542
553
|
/**
|
|
543
|
-
*
|
|
544
|
-
* @param index
|
|
554
|
+
* Render the ppt page corresponding to the index parameter.
|
|
555
|
+
* @param index Page number to display, starting from 1.
|
|
545
556
|
*/
|
|
546
557
|
renderSlide(index: number, isForward?: boolean): void;
|
|
547
558
|
private needCreateNewPlayer;
|
|
548
559
|
private poseRenderSlide;
|
|
549
560
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
* @param
|
|
561
|
+
* Render the page specified by the index directly,
|
|
562
|
+
* regardless of whether the current mode is sync or interactive.
|
|
563
|
+
* Calling this method will not trigger the syncDispatch event.
|
|
564
|
+
* @param index Page number to render
|
|
565
|
+
* @param isForward Whether to flip forward or backward, affecting the page transition animation.
|
|
554
566
|
*/
|
|
555
567
|
doRenderSlide(index: number, isForward?: boolean): Promise<void>;
|
|
556
568
|
getSnapshot(): string | null;
|
|
@@ -560,7 +572,7 @@ export declare class Slide extends Slide_base {
|
|
|
560
572
|
nextStep(): void;
|
|
561
573
|
private doNextStep;
|
|
562
574
|
/**
|
|
563
|
-
*
|
|
575
|
+
* Execute the previous main sequence animation.
|
|
564
576
|
*/
|
|
565
577
|
prevStep(): void;
|
|
566
578
|
private doPrevStep;
|
|
@@ -568,75 +580,76 @@ export declare class Slide extends Slide_base {
|
|
|
568
580
|
private emitStateChange;
|
|
569
581
|
private emitSyncDispatch;
|
|
570
582
|
/**
|
|
571
|
-
*
|
|
572
|
-
* @param index
|
|
573
|
-
* @param status
|
|
583
|
+
* Reset main sequence animation.
|
|
584
|
+
* @param index Number of steps to reset to.
|
|
585
|
+
* @param status The state to be reset to, "start" resets to the beginning of the animation, "end" resets to the end of the animation.
|
|
574
586
|
*/
|
|
575
587
|
setMainSeqStep(index: number, status: "start" | "end"): void;
|
|
576
588
|
/**
|
|
577
|
-
*
|
|
589
|
+
* Set whether interaction is allowed.
|
|
578
590
|
* @param val boolean
|
|
579
591
|
*/
|
|
580
592
|
setInteractive(val: boolean): void;
|
|
581
593
|
/**
|
|
582
|
-
*
|
|
594
|
+
* Pause playback, asynchronous operation.
|
|
583
595
|
*/
|
|
584
596
|
pause(): void;
|
|
585
597
|
/**
|
|
586
|
-
*
|
|
598
|
+
* Resume playback state, asynchronous operation.
|
|
587
599
|
*/
|
|
588
600
|
resume(): void;
|
|
589
601
|
private _doFrozen;
|
|
590
602
|
/**
|
|
591
|
-
*
|
|
603
|
+
* Enter freeze state, cache the ppt screen as an image, and release the WebGL context.
|
|
592
604
|
*/
|
|
593
605
|
frozen(): void;
|
|
594
606
|
private _doRelease;
|
|
595
607
|
/**
|
|
596
|
-
*
|
|
608
|
+
* Recover from frozen state.
|
|
597
609
|
*/
|
|
598
610
|
release(): void;
|
|
599
611
|
private _doDestroy;
|
|
600
612
|
private waitLoadEnd;
|
|
601
613
|
preload(index: number): Promise<void>;
|
|
602
614
|
/**
|
|
603
|
-
*
|
|
615
|
+
* Destruction method.
|
|
604
616
|
*/
|
|
605
617
|
destroy(): void;
|
|
606
618
|
/**
|
|
607
|
-
*
|
|
619
|
+
* Destroy the local cache of the current Slide instance, need to be called before destroy.
|
|
608
620
|
*/
|
|
609
621
|
clearSlideCache(): void;
|
|
610
622
|
/**
|
|
611
|
-
*
|
|
623
|
+
* Return whether there is a next action in the ppt.
|
|
612
624
|
*/
|
|
613
625
|
hasNextStep(): boolean;
|
|
614
626
|
/**
|
|
615
|
-
*
|
|
627
|
+
* Return whether there is a previous action in the ppt.
|
|
616
628
|
*/
|
|
617
629
|
hasPrevStep(): boolean;
|
|
618
630
|
/**
|
|
619
|
-
*
|
|
620
|
-
* @return 图片 dataUrl,
|
|
631
|
+
* Capture a screenshot of the current state.
|
|
632
|
+
* @return 图片 dataUrl, if failed return null
|
|
621
633
|
*/
|
|
622
634
|
snapshot(): Promise<string | null>;
|
|
623
635
|
/**
|
|
624
|
-
*
|
|
625
|
-
* @param index
|
|
626
|
-
* @return 图片 dataUrl,
|
|
636
|
+
* Capture a screenshot of the final step of the animation.
|
|
637
|
+
* @param index The index of the slide to be captured.
|
|
638
|
+
* @return 图片 dataUrl, if failed return null
|
|
627
639
|
*/
|
|
628
640
|
snapshotWithTimingEnd(index: number): Promise<string | null>;
|
|
629
641
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
642
|
+
* Set the global volume of this Slide instance, asynchronous operation,
|
|
643
|
+
* only modify the local volume, will not trigger synchronous events.
|
|
644
|
+
* @param v Value range 0 ~ 1
|
|
632
645
|
*/
|
|
633
646
|
updateGlobalVolume(v: number): void;
|
|
634
647
|
/**
|
|
635
|
-
*
|
|
648
|
+
* Get the global volume of this Slide instance.
|
|
636
649
|
*/
|
|
637
650
|
getGlobalVolume(): number;
|
|
638
651
|
/**
|
|
639
|
-
*
|
|
652
|
+
* Destroy all local cache of historical records.
|
|
640
653
|
*/
|
|
641
654
|
static clearLocalCache(): void;
|
|
642
655
|
/**
|