@netless/fastboard-core 0.3.3 → 0.3.4-canary.0
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/package.json +2 -2
- package/src/impl/FastboardApp.ts +13 -10
- package/src/impl/FastboardPlayer.ts +4 -4
- package/src/impl/index.ts +0 -1
- package/src/index.ts +1 -0
- package/dist/index.d.ts +0 -386
- package/dist/index.js +0 -666
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -644
- package/dist/index.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4-canary.0",
|
|
4
4
|
"description": "A tiny wrapper of white-web-sdk and @netless/window-manager.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"repository": "netless-io/fastboard",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@netless/app-slide": "^0.2.
|
|
12
|
+
"@netless/app-slide": "^0.2.1"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@netless/window-manager": ">=0.4.0",
|
package/src/impl/FastboardApp.ts
CHANGED
|
@@ -176,8 +176,8 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
176
176
|
readonly writable = writable(
|
|
177
177
|
this.room.isWritable,
|
|
178
178
|
set => {
|
|
179
|
-
this._addRoomListener("onEnableWriteNowChanged", () => set(this.room.isWritable));
|
|
180
179
|
set(this.room.isWritable);
|
|
180
|
+
return this._addRoomListener("onEnableWriteNowChanged", () => set(this.room.isWritable));
|
|
181
181
|
},
|
|
182
182
|
this.room.setWritable.bind(this.room)
|
|
183
183
|
);
|
|
@@ -186,16 +186,16 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
186
186
|
* Is current room online?
|
|
187
187
|
*/
|
|
188
188
|
readonly phase = readable<RoomPhase>(this.room.phase, set => {
|
|
189
|
-
this._addRoomListener("onPhaseChanged", set);
|
|
190
189
|
set(this.room.phase);
|
|
190
|
+
return this._addRoomListener("onPhaseChanged", set);
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
194
|
* Current window-manager's windows' state (is it maximized?).
|
|
195
195
|
*/
|
|
196
196
|
readonly boxState = readable(this.manager.boxState, set => {
|
|
197
|
-
this._addManagerListener("boxStateChange", set);
|
|
198
197
|
set(this.manager.boxState);
|
|
198
|
+
return this._addManagerListener("boxStateChange", set);
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
/**
|
|
@@ -203,24 +203,24 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
203
203
|
* @example "HelloWorld-1A2b3C4d"
|
|
204
204
|
*/
|
|
205
205
|
readonly focusedApp = readable(this.manager.focused, set => {
|
|
206
|
-
this._addManagerListener("focusedChange", set);
|
|
207
206
|
set(this.manager.focused);
|
|
207
|
+
return this._addManagerListener("focusedChange", set);
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* How many times can I call `app.redo()`?
|
|
212
212
|
*/
|
|
213
213
|
readonly canRedoSteps = readable(this.manager.canRedoSteps, set => {
|
|
214
|
-
this._addManagerListener("canRedoStepsChange", set);
|
|
215
214
|
set(this.manager.canRedoSteps);
|
|
215
|
+
return this._addManagerListener("canRedoStepsChange", set);
|
|
216
216
|
});
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* How many times can I call `app.undo()`?
|
|
220
220
|
*/
|
|
221
221
|
readonly canUndoSteps = readable(this.manager.canUndoSteps, set => {
|
|
222
|
-
this._addManagerListener("canUndoStepsChange", set);
|
|
223
222
|
set(this.manager.canUndoSteps);
|
|
223
|
+
return this._addManagerListener("canUndoStepsChange", set);
|
|
224
224
|
});
|
|
225
225
|
|
|
226
226
|
/**
|
|
@@ -229,8 +229,8 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
229
229
|
* Change the camera position by `app.moveCamera()`.
|
|
230
230
|
*/
|
|
231
231
|
readonly camera = readable(this.manager.camera, set => {
|
|
232
|
-
this._addMainViewListener("onCameraUpdated", set);
|
|
233
232
|
set(this.manager.camera);
|
|
233
|
+
return this._addMainViewListener("onCameraUpdated", set);
|
|
234
234
|
});
|
|
235
235
|
|
|
236
236
|
/**
|
|
@@ -239,8 +239,8 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
239
239
|
* Change the tool by `app.setAppliance()`.
|
|
240
240
|
*/
|
|
241
241
|
readonly memberState = readable(this.room.state.memberState, set => {
|
|
242
|
-
this._addRoomListener("onRoomStateChanged", ({ memberState: m }) => m && set(m));
|
|
243
242
|
set(this.room.state.memberState);
|
|
243
|
+
return this._addRoomListener("onRoomStateChanged", ({ memberState: m }) => m && set(m));
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
/**
|
|
@@ -249,8 +249,8 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
249
249
|
readonly sceneIndex = writable(
|
|
250
250
|
this.manager.mainViewSceneIndex,
|
|
251
251
|
set => {
|
|
252
|
-
this._addManagerListener("mainViewSceneIndexChange", set);
|
|
253
252
|
set(this.manager.mainViewSceneIndex);
|
|
253
|
+
return this._addManagerListener("mainViewSceneIndexChange", set);
|
|
254
254
|
},
|
|
255
255
|
this.manager.setMainViewSceneIndex.bind(this.manager)
|
|
256
256
|
);
|
|
@@ -259,8 +259,8 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
259
259
|
* How many pages are in the main view?
|
|
260
260
|
*/
|
|
261
261
|
readonly sceneLength = readable(this.manager.mainViewScenesLength, set => {
|
|
262
|
-
this._addManagerListener("mainViewScenesLengthChange", set);
|
|
263
262
|
set(this.manager.mainViewScenesLength);
|
|
263
|
+
return this._addManagerListener("mainViewScenesLengthChange", set);
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
private _appsStatus: AppsStatus = {};
|
|
@@ -494,6 +494,7 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* Insert the Monaco Code Editor app.
|
|
497
|
+
* @deprecated Use `app.manager.addApp({ kind: 'Monaco' })` instead.
|
|
497
498
|
*/
|
|
498
499
|
insertCodeEditor() {
|
|
499
500
|
this._assertNotDestroyed();
|
|
@@ -505,6 +506,7 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
505
506
|
|
|
506
507
|
/**
|
|
507
508
|
* Insert the Countdown app.
|
|
509
|
+
* @deprecated Use `app.manager.addApp({ kind: 'Countdown' })` instead.
|
|
508
510
|
*/
|
|
509
511
|
insertCountdown() {
|
|
510
512
|
this._assertNotDestroyed();
|
|
@@ -516,6 +518,7 @@ export class FastboardApp extends FastboardAppBase {
|
|
|
516
518
|
|
|
517
519
|
/**
|
|
518
520
|
* Insert the GeoGebra app.
|
|
521
|
+
* @deprecated Use `app.manager.addApp({ kind: 'GeoGebra' })` instead.
|
|
519
522
|
*/
|
|
520
523
|
insertGeoGebra() {
|
|
521
524
|
this._assertNotDestroyed();
|
|
@@ -80,8 +80,8 @@ export class FastboardPlayer extends FastboardPlayerBase {
|
|
|
80
80
|
readonly currentTime = writable(
|
|
81
81
|
this.player.progressTime,
|
|
82
82
|
set => {
|
|
83
|
-
this._addPlayerListener("onProgressTimeChanged", set);
|
|
84
83
|
set(this.player.progressTime);
|
|
84
|
+
return this._addPlayerListener("onProgressTimeChanged", set);
|
|
85
85
|
},
|
|
86
86
|
this.player.seekToProgressTime.bind(this.player)
|
|
87
87
|
);
|
|
@@ -90,16 +90,16 @@ export class FastboardPlayer extends FastboardPlayerBase {
|
|
|
90
90
|
* Player state, like "is it playing?".
|
|
91
91
|
*/
|
|
92
92
|
readonly phase = readable<PlayerPhase>(this.player.phase, set => {
|
|
93
|
-
this._addPlayerListener("onPhaseChanged", set);
|
|
94
93
|
set(this.player.phase);
|
|
94
|
+
return this._addPlayerListener("onPhaseChanged", set);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Will become true after buffering.
|
|
99
99
|
*/
|
|
100
100
|
readonly canplay = readable(this.player.isPlayable, set => {
|
|
101
|
-
this._addPlayerListener("onIsPlayableChanged", set);
|
|
102
101
|
set(this.player.isPlayable);
|
|
102
|
+
return this._addPlayerListener("onIsPlayableChanged", set);
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
private _setPlaybackRate!: (value: number) => void;
|
|
@@ -129,8 +129,8 @@ export class FastboardPlayer extends FastboardPlayerBase {
|
|
|
129
129
|
* Get state of room at that time, like "who was in the room?".
|
|
130
130
|
*/
|
|
131
131
|
readonly state = readable<PlayerState>(this.player.state, set => {
|
|
132
|
-
this._addPlayerListener("onPlayerStateChanged", () => set(this.player.state));
|
|
133
132
|
set(this.player.state);
|
|
133
|
+
return this._addPlayerListener("onPlayerStateChanged", () => set(this.player.state));
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
/**
|
package/src/impl/index.ts
CHANGED
package/src/index.ts
CHANGED
package/dist/index.d.ts
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
import { Size, SceneDefinition, ConvertedFile, RoomPhase as RoomPhase$1, ApplianceNames, ShapeType, MemberState, RoomState, Camera, AnimationMode, Rectangle, Color, ConversionResponse, WhiteWebSdkConfiguration, JoinRoomParams, RoomCallbacks, WhiteWebSdk, Room, HotKeys, ViewCallbacks, PlayerPhase as PlayerPhase$1, PlayerState, PlayerSeekingResult, ReplayRoomParams, PlayerCallbacks, Player } from 'white-web-sdk';
|
|
2
|
-
export { AnimationMode, ApplianceNames, Camera, Color, ConversionResponse, HotKey, HotKeys, JoinRoomParams, MemberState, PlayerSeekingResult, Rectangle, Room, RoomCallbacks, RoomState, SceneDefinition, ShapeType, ViewCallbacks, WhiteWebSdk, WhiteWebSdkConfiguration } from 'white-web-sdk';
|
|
3
|
-
import { AddPageParams, MountParams, WindowManager, PublicEvent, RegisterParams } from '@netless/window-manager';
|
|
4
|
-
export { AddPageParams, MountParams, PublicEvent, WindowManager } from '@netless/window-manager';
|
|
5
|
-
export { PreviewParams, default as SlideApp, Controller as SlideController, AppOptions as SlideOptions, SlidePreviewer, addHooks as addSlideHooks, previewSlide, apps as slideApps } from '@netless/app-slide';
|
|
6
|
-
|
|
7
|
-
declare type Subscriber<T> = (value: T) => void;
|
|
8
|
-
declare type Unsubscriber = () => void;
|
|
9
|
-
declare type Updater<T> = (value: T) => T;
|
|
10
|
-
declare type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;
|
|
11
|
-
interface Readable<T> {
|
|
12
|
-
readonly value: T;
|
|
13
|
-
subscribe(this: void, run: Subscriber<T>): Unsubscriber;
|
|
14
|
-
reaction(this: void, run: Subscriber<T>): Unsubscriber;
|
|
15
|
-
}
|
|
16
|
-
interface Writable<T> extends Readable<T> {
|
|
17
|
-
set(this: void, value: T): void;
|
|
18
|
-
update(this: void, updater: Updater<T>): void;
|
|
19
|
-
}
|
|
20
|
-
declare function readable<T>(value: T, start?: StartStopNotifier<T>): Readable<T>;
|
|
21
|
-
declare function writable<T>(value: T, start: StartStopNotifier<T> | undefined, set: Subscriber<T>): Writable<T>;
|
|
22
|
-
|
|
23
|
-
declare function getImageSize(url: string, fallback: Size): Promise<Size>;
|
|
24
|
-
declare function makeSlideParams(scenes: SceneDefinition[]): {
|
|
25
|
-
scenes: SceneDefinition[];
|
|
26
|
-
taskId: string;
|
|
27
|
-
url: string;
|
|
28
|
-
};
|
|
29
|
-
declare function convertedFileToScene(f: ConvertedFile, i: number): SceneDefinition;
|
|
30
|
-
|
|
31
|
-
declare function genUID(): string;
|
|
32
|
-
|
|
33
|
-
declare const warnings: {
|
|
34
|
-
readonly "no-ppt-in-scenes": "You're probably inserting the slide app in a wrong way, there shouldn't exist `scenes[0].ppt`.";
|
|
35
|
-
};
|
|
36
|
-
declare function warn(id: keyof typeof warnings): void;
|
|
37
|
-
|
|
38
|
-
declare class FastboardAppBase {
|
|
39
|
-
readonly sdk: WhiteWebSdk;
|
|
40
|
-
readonly room: Room;
|
|
41
|
-
readonly manager: WindowManager;
|
|
42
|
-
readonly hotKeys: Partial<HotKeys>;
|
|
43
|
-
constructor(sdk: WhiteWebSdk, room: Room, manager: WindowManager, hotKeys: Partial<HotKeys>);
|
|
44
|
-
protected _destroyed: boolean;
|
|
45
|
-
protected _assertNotDestroyed(): void;
|
|
46
|
-
protected _addRoomListener<K extends keyof RoomCallbacks>(name: K, listener: RoomCallbacks[K]): () => void;
|
|
47
|
-
protected _addManagerListener<K extends keyof PublicEvent>(name: K, listener: (value: PublicEvent[K]) => void): () => void;
|
|
48
|
-
protected _addMainViewListener<K extends keyof ViewCallbacks>(name: K, listener: ViewCallbacks[K]): () => void;
|
|
49
|
-
/**
|
|
50
|
-
* Destroy fastboard (disconnect from the whiteboard room).
|
|
51
|
-
*/
|
|
52
|
-
destroy(): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
declare type RoomPhase = `${RoomPhase$1}`;
|
|
55
|
-
|
|
56
|
-
/** pencil, eraser, rectangle... */
|
|
57
|
-
declare type Appliance = `${ApplianceNames}`;
|
|
58
|
-
/** triangle, star... */
|
|
59
|
-
declare type Shape = `${ShapeType}`;
|
|
60
|
-
/** Params for static docs, they are rendered as many images. */
|
|
61
|
-
interface InsertDocsStatic {
|
|
62
|
-
readonly fileType: "pdf";
|
|
63
|
-
/** Unique string for binding whiteboard view to the doc. Must start with `/`. */
|
|
64
|
-
readonly scenePath: string;
|
|
65
|
-
/** @example [{ name: '1', ppt: { src: 'url/to/ppt/1.png' } }] */
|
|
66
|
-
readonly scenes: SceneDefinition[];
|
|
67
|
-
/** Window title. */
|
|
68
|
-
readonly title?: string;
|
|
69
|
-
}
|
|
70
|
-
/** Params for slides, they are rendered in @netless/app-slide with animations. */
|
|
71
|
-
interface InsertDocsDynamic {
|
|
72
|
-
readonly fileType: "pptx";
|
|
73
|
-
/** Unique string for binding whiteboard view to the doc. Must start with `/`. */
|
|
74
|
-
readonly scenePath: string;
|
|
75
|
-
/** Conversion task id, see https://developer.netless.link/server-en/home/server-conversion#get-query-task-conversion-progress. */
|
|
76
|
-
readonly taskId: string;
|
|
77
|
-
/** Window title. */
|
|
78
|
-
readonly title?: string;
|
|
79
|
-
/** Where the slide resource placed. @default `https://convertcdn.netless.link/dynamicConvert` */
|
|
80
|
-
readonly url?: string;
|
|
81
|
-
/** @example [{ name: '1' }, { name: '2' }, { name: '3' }] */
|
|
82
|
-
readonly scenes?: SceneDefinition[];
|
|
83
|
-
}
|
|
84
|
-
declare type InsertDocsParams = InsertDocsStatic | InsertDocsDynamic;
|
|
85
|
-
declare type SetMemberStateFn = (partialMemberState: Partial<MemberState>) => void;
|
|
86
|
-
declare type RoomStateChanged = (diff: Partial<RoomState>) => void;
|
|
87
|
-
/** App download progress. */
|
|
88
|
-
interface AppsStatus {
|
|
89
|
-
[kind: string]: {
|
|
90
|
-
status: "idle" | "loading" | "failed";
|
|
91
|
-
/** Exist if status is `failed`. */
|
|
92
|
-
reason?: string;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
declare class FastboardApp extends FastboardAppBase {
|
|
96
|
-
/**
|
|
97
|
-
* Render this app to some DOM.
|
|
98
|
-
*/
|
|
99
|
-
bindContainer(container: HTMLElement): void;
|
|
100
|
-
/**
|
|
101
|
-
* Move window-manager's collector to some place.
|
|
102
|
-
*/
|
|
103
|
-
bindCollector(container: HTMLElement): void;
|
|
104
|
-
/**
|
|
105
|
-
* Is current room writable?
|
|
106
|
-
*/
|
|
107
|
-
readonly writable: Writable<boolean>;
|
|
108
|
-
/**
|
|
109
|
-
* Is current room online?
|
|
110
|
-
*/
|
|
111
|
-
readonly phase: Readable<"connecting" | "connected" | "reconnecting" | "disconnecting" | "disconnected">;
|
|
112
|
-
/**
|
|
113
|
-
* Current window-manager's windows' state (is it maximized?).
|
|
114
|
-
*/
|
|
115
|
-
readonly boxState: Readable<"normal" | "minimized" | "maximized" | undefined>;
|
|
116
|
-
/**
|
|
117
|
-
* Current window-manager's focused app's id.
|
|
118
|
-
* @example "HelloWorld-1A2b3C4d"
|
|
119
|
-
*/
|
|
120
|
-
readonly focusedApp: Readable<string | undefined>;
|
|
121
|
-
/**
|
|
122
|
-
* How many times can I call `app.redo()`?
|
|
123
|
-
*/
|
|
124
|
-
readonly canRedoSteps: Readable<number>;
|
|
125
|
-
/**
|
|
126
|
-
* How many times can I call `app.undo()`?
|
|
127
|
-
*/
|
|
128
|
-
readonly canUndoSteps: Readable<number>;
|
|
129
|
-
/**
|
|
130
|
-
* Current camera information of main view.
|
|
131
|
-
*
|
|
132
|
-
* Change the camera position by `app.moveCamera()`.
|
|
133
|
-
*/
|
|
134
|
-
readonly camera: Readable<Camera>;
|
|
135
|
-
/**
|
|
136
|
-
* Current tool's info, like "is using pencil?", "what color?".
|
|
137
|
-
*
|
|
138
|
-
* Change the tool by `app.setAppliance()`.
|
|
139
|
-
*/
|
|
140
|
-
readonly memberState: Readable<MemberState>;
|
|
141
|
-
/**
|
|
142
|
-
* 0..n-1, current index of main view scenes.
|
|
143
|
-
*/
|
|
144
|
-
readonly sceneIndex: Writable<number>;
|
|
145
|
-
/**
|
|
146
|
-
* How many pages are in the main view?
|
|
147
|
-
*/
|
|
148
|
-
readonly sceneLength: Readable<number>;
|
|
149
|
-
private _appsStatus;
|
|
150
|
-
/**
|
|
151
|
-
* Apps status.
|
|
152
|
-
*/
|
|
153
|
-
readonly appsStatus: Readable<AppsStatus>;
|
|
154
|
-
/**
|
|
155
|
-
* Undo a step on main view.
|
|
156
|
-
*/
|
|
157
|
-
undo(): void;
|
|
158
|
-
/**
|
|
159
|
-
* Redo a step on main view.
|
|
160
|
-
*/
|
|
161
|
-
redo(): void;
|
|
162
|
-
/**
|
|
163
|
-
* Move current main view's camera position.
|
|
164
|
-
*/
|
|
165
|
-
moveCamera(camera: Partial<Camera> & {
|
|
166
|
-
animationMode?: AnimationMode | undefined;
|
|
167
|
-
}): void;
|
|
168
|
-
/**
|
|
169
|
-
* Move current main view's camera to include a rectangle.
|
|
170
|
-
*/
|
|
171
|
-
moveCameraToContain(rectangle: Rectangle & {
|
|
172
|
-
animationMode?: AnimationMode;
|
|
173
|
-
}): void;
|
|
174
|
-
/**
|
|
175
|
-
* Delete all things on the main view.
|
|
176
|
-
*/
|
|
177
|
-
cleanCurrentScene(): void;
|
|
178
|
-
/**
|
|
179
|
-
* Set current tool, like "pencil".
|
|
180
|
-
*/
|
|
181
|
-
setAppliance(appliance: ApplianceNames | Appliance, shape?: ShapeType | Shape): void;
|
|
182
|
-
/**
|
|
183
|
-
* Set pencil and shape's thickness.
|
|
184
|
-
*/
|
|
185
|
-
setStrokeWidth(strokeWidth: number): void;
|
|
186
|
-
/**
|
|
187
|
-
* Set pencil and shape's color.
|
|
188
|
-
*/
|
|
189
|
-
setStrokeColor(strokeColor: Color): void;
|
|
190
|
-
/**
|
|
191
|
-
* Set text size. Default is 16.
|
|
192
|
-
*/
|
|
193
|
-
setTextSize(textSize: number): void;
|
|
194
|
-
/**
|
|
195
|
-
* Set text color.
|
|
196
|
-
*
|
|
197
|
-
* @example
|
|
198
|
-
* setTextColor([0x66, 0xcc, 0xff])
|
|
199
|
-
*/
|
|
200
|
-
setTextColor(textColor: Color): void;
|
|
201
|
-
/**
|
|
202
|
-
* Goto previous page (the main whiteboard view).
|
|
203
|
-
*/
|
|
204
|
-
prevPage(): Promise<boolean>;
|
|
205
|
-
/**
|
|
206
|
-
* Goto next page (the main whiteboard view).
|
|
207
|
-
*/
|
|
208
|
-
nextPage(): Promise<boolean>;
|
|
209
|
-
/**
|
|
210
|
-
* Add one page to the main whiteboard view.
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* addPage({ after: true }) // add one page right after current one.
|
|
214
|
-
* nextPage() // then, goto that page.
|
|
215
|
-
*/
|
|
216
|
-
addPage(params?: AddPageParams): Promise<void>;
|
|
217
|
-
/**
|
|
218
|
-
* Insert an image to the main view.
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* insertImage("https://i.imgur.com/CzXTtJV.jpg")
|
|
222
|
-
*/
|
|
223
|
-
insertImage(url: string): Promise<void>;
|
|
224
|
-
/**
|
|
225
|
-
* Insert PDF/PPTX from conversion result.
|
|
226
|
-
* @param status https://developer.netless.link/server-en/home/server-conversion#get-query-task-conversion-progress
|
|
227
|
-
*/
|
|
228
|
-
insertDocs(filename: string, status: ConversionResponse): Promise<string | undefined>;
|
|
229
|
-
/**
|
|
230
|
-
* Manual way.
|
|
231
|
-
* @example
|
|
232
|
-
* app.insertDocs({
|
|
233
|
-
* fileType: 'pptx',
|
|
234
|
-
* scenePath: `/pptx/${conversion.taskId}`,
|
|
235
|
-
* taskId: conversion.taskId,
|
|
236
|
-
* title: 'Title',
|
|
237
|
-
* })
|
|
238
|
-
*/
|
|
239
|
-
insertDocs(params: InsertDocsParams): Promise<string | undefined>;
|
|
240
|
-
private _insertDocsImpl;
|
|
241
|
-
/**
|
|
242
|
-
* Insert the Media Player app.
|
|
243
|
-
*/
|
|
244
|
-
insertMedia(title: string, src: string): Promise<string | undefined>;
|
|
245
|
-
/**
|
|
246
|
-
* Insert the Monaco Code Editor app.
|
|
247
|
-
*/
|
|
248
|
-
insertCodeEditor(): Promise<string | undefined>;
|
|
249
|
-
/**
|
|
250
|
-
* Insert the Countdown app.
|
|
251
|
-
*/
|
|
252
|
-
insertCountdown(): Promise<string | undefined>;
|
|
253
|
-
/**
|
|
254
|
-
* Insert the GeoGebra app.
|
|
255
|
-
*/
|
|
256
|
-
insertGeoGebra(): Promise<string | undefined>;
|
|
257
|
-
}
|
|
258
|
-
interface FastboardOptions {
|
|
259
|
-
sdkConfig: Omit<WhiteWebSdkConfiguration, "useMobXState"> & {
|
|
260
|
-
region: NonNullable<WhiteWebSdkConfiguration["region"]>;
|
|
261
|
-
};
|
|
262
|
-
joinRoom: Omit<JoinRoomParams, "useMultiViews" | "disableNewPencil" | "disableMagixEventDispatchLimit"> & {
|
|
263
|
-
callbacks?: Partial<RoomCallbacks>;
|
|
264
|
-
};
|
|
265
|
-
managerConfig?: Omit<MountParams, "room">;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Create a FastboardApp instance.
|
|
269
|
-
* @example
|
|
270
|
-
* let app = await createFastboard({
|
|
271
|
-
* sdkConfig: {
|
|
272
|
-
* appIdentifier: import.meta.env.VITE_APPID,
|
|
273
|
-
* region: 'cn-hz',
|
|
274
|
-
* },
|
|
275
|
-
* joinRoom: {
|
|
276
|
-
* uid: unique_id,
|
|
277
|
-
* uuid: import.meta.env.VITE_ROOM_UUID,
|
|
278
|
-
* roomToken: import.meta.env.VITE_ROOM_TOKEN,
|
|
279
|
-
* },
|
|
280
|
-
* })
|
|
281
|
-
*/
|
|
282
|
-
declare function createFastboard({ sdkConfig, joinRoom: { callbacks, ...joinRoomParams }, managerConfig, }: FastboardOptions): Promise<FastboardApp>;
|
|
283
|
-
|
|
284
|
-
declare class FastboardPlayerBase {
|
|
285
|
-
readonly sdk: WhiteWebSdk;
|
|
286
|
-
readonly player: Player;
|
|
287
|
-
readonly manager: WindowManager;
|
|
288
|
-
constructor(sdk: WhiteWebSdk, player: Player, manager: WindowManager);
|
|
289
|
-
protected _destroyed: boolean;
|
|
290
|
-
protected _assertNotDestroyed(): void;
|
|
291
|
-
protected _addPlayerListener<K extends keyof PlayerCallbacks>(name: K, listener: PlayerCallbacks[K]): () => void;
|
|
292
|
-
protected _addManagerListener<K extends keyof PublicEvent>(name: K, listener: (value: PublicEvent[K]) => void): () => void;
|
|
293
|
-
protected _addMainViewListener<K extends keyof ViewCallbacks>(name: K, listener: ViewCallbacks[K]): () => void;
|
|
294
|
-
destroy(): void;
|
|
295
|
-
}
|
|
296
|
-
declare type PlayerPhase = `${PlayerPhase$1}`;
|
|
297
|
-
|
|
298
|
-
declare class FastboardPlayer extends FastboardPlayerBase {
|
|
299
|
-
/**
|
|
300
|
-
* Render this player to some DOM.
|
|
301
|
-
*/
|
|
302
|
-
bindContainer(container: HTMLElement): void;
|
|
303
|
-
/**
|
|
304
|
-
* Move window-manager's collector to some place.
|
|
305
|
-
*/
|
|
306
|
-
bindCollector(container: HTMLElement): void;
|
|
307
|
-
/**
|
|
308
|
-
* Player current time in milliseconds.
|
|
309
|
-
*/
|
|
310
|
-
readonly currentTime: Writable<number>;
|
|
311
|
-
/**
|
|
312
|
-
* Player state, like "is it playing?".
|
|
313
|
-
*/
|
|
314
|
-
readonly phase: Readable<"waitingFirstFrame" | "playing" | "pause" | "stop" | "ended" | "buffering">;
|
|
315
|
-
/**
|
|
316
|
-
* Will become true after buffering.
|
|
317
|
-
*/
|
|
318
|
-
readonly canplay: Readable<boolean>;
|
|
319
|
-
private _setPlaybackRate;
|
|
320
|
-
/**
|
|
321
|
-
* Playback speed, default `1`.
|
|
322
|
-
*/
|
|
323
|
-
readonly playbackRate: Writable<number>;
|
|
324
|
-
/**
|
|
325
|
-
* Playback duration in milliseconds.
|
|
326
|
-
*/
|
|
327
|
-
readonly duration: Readable<number>;
|
|
328
|
-
/**
|
|
329
|
-
* Get state of room at that time, like "who was in the room?".
|
|
330
|
-
*/
|
|
331
|
-
readonly state: Readable<PlayerState>;
|
|
332
|
-
/**
|
|
333
|
-
* Seek to some time in milliseconds.
|
|
334
|
-
*/
|
|
335
|
-
seek(timestamp: number): Promise<PlayerSeekingResult>;
|
|
336
|
-
/**
|
|
337
|
-
* Change player state to playing.
|
|
338
|
-
*/
|
|
339
|
-
play(): void;
|
|
340
|
-
/**
|
|
341
|
-
* Change player state to paused.
|
|
342
|
-
*/
|
|
343
|
-
pause(): void;
|
|
344
|
-
/**
|
|
345
|
-
* Change player state to stopped.
|
|
346
|
-
*/
|
|
347
|
-
stop(): void;
|
|
348
|
-
/**
|
|
349
|
-
* Set playback speed, a shortcut for `speed.set(x)`.
|
|
350
|
-
*/
|
|
351
|
-
setPlaybackRate(value: number): void;
|
|
352
|
-
}
|
|
353
|
-
interface FastboardReplayOptions {
|
|
354
|
-
sdkConfig: Omit<WhiteWebSdkConfiguration, "useMobXState"> & {
|
|
355
|
-
region: NonNullable<WhiteWebSdkConfiguration["region"]>;
|
|
356
|
-
};
|
|
357
|
-
replayRoom: Omit<ReplayRoomParams, "useMultiViews"> & {
|
|
358
|
-
callbacks?: Partial<PlayerCallbacks>;
|
|
359
|
-
};
|
|
360
|
-
managerConfig?: Omit<MountParams, "room">;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Create a FastboardPlayer instance.
|
|
364
|
-
* @example
|
|
365
|
-
* let player = await replayFastboard({
|
|
366
|
-
* sdkConfig: {
|
|
367
|
-
* appIdentifier: import.meta.env.VITE_APPID,
|
|
368
|
-
* region: 'cn-hz',
|
|
369
|
-
* },
|
|
370
|
-
* replayRoom: {
|
|
371
|
-
* room: "room uuid",
|
|
372
|
-
* roomToken: "NETLESSROOM_...",
|
|
373
|
-
* beginTimestamp: 1646619090394,
|
|
374
|
-
* duration: 70448,
|
|
375
|
-
* },
|
|
376
|
-
* })
|
|
377
|
-
*/
|
|
378
|
-
declare function replayFastboard({ sdkConfig, replayRoom: { callbacks, ...replayRoomParams }, managerConfig, }: FastboardReplayOptions): Promise<FastboardPlayer>;
|
|
379
|
-
|
|
380
|
-
interface AppsConfig {
|
|
381
|
-
[kind: string]: Omit<RegisterParams, "kind">;
|
|
382
|
-
}
|
|
383
|
-
declare const register: typeof WindowManager.register;
|
|
384
|
-
declare const version: string;
|
|
385
|
-
|
|
386
|
-
export { Appliance, AppsConfig, AppsStatus, FastboardApp, FastboardOptions, FastboardPlayer, FastboardReplayOptions, InsertDocsDynamic, InsertDocsParams, InsertDocsStatic, PlayerPhase, Readable, RoomPhase, RoomStateChanged, SetMemberStateFn, Shape, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable, convertedFileToScene, createFastboard, genUID, getImageSize, makeSlideParams, readable, register, replayFastboard, version, warn, writable };
|