fcr-core 3.8.2 → 3.9.0-alpha
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/chat-connector/type.d.ts +40 -0
- package/lib/{chat-connection → chat-connector}/type.js +1 -1
- package/lib/engine/index.d.ts +10 -11
- package/lib/engine/index.js +63 -72
- package/lib/engine/type.d.ts +96 -0
- package/lib/engine/type.js +5 -0
- package/lib/imports.d.ts +7 -4
- package/lib/imports.js +30 -4
- package/lib/index.d.ts +3 -2
- package/lib/index.js +21 -2
- package/lib/media-control/desktop.js +12 -12
- package/lib/media-control/mobile.js +4 -0
- package/lib/media-control/type.d.ts +32 -33
- package/lib/monitor-control/index.js +3 -3
- package/lib/peer-session/index.js +14 -14
- package/lib/peer-session/type.d.ts +1 -1
- package/lib/plugins/chat/chatroom.js +417 -0
- package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
- package/lib/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib/plugins/chat/connector.d.ts +38 -0
- package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
- package/lib/room-control/ability-control/index.js +5 -4
- package/lib/room-control/ability-control/type.d.ts +5 -1
- package/lib/room-control/ability-control/type.js +4 -0
- package/lib/room-control/chatroom-control/type.d.ts +44 -35
- package/lib/room-control/group-control/index.js +9 -9
- package/lib/room-control/index.js +37 -22
- package/lib/room-control/interpreter-control/index.js +7 -4
- package/lib/room-control/interpreter-control/room.js +3 -3
- package/lib/room-control/interpreter-control/types.d.ts +2 -2
- package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/index.js +39 -24
- package/lib/room-control/privilege-control/type.d.ts +15 -15
- package/lib/room-control/room-connector-control/index.js +7 -5
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.d.ts +3 -3
- package/lib/room-control/room-control-factory.js +7 -7
- package/lib/room-control/room-session/index.js +17 -15
- package/lib/room-control/room-session/type.d.ts +3 -3
- package/lib/room-control/sharing-control/index.js +13 -7
- package/lib/room-control/stream-control/index.js +18 -16
- package/lib/room-control/stream-control/type.d.ts +5 -5
- package/lib/room-control/stt-control/index.js +38 -31
- package/lib/room-control/type.d.ts +19 -19
- package/lib/room-control/user-control/index.js +20 -22
- package/lib/room-control/user-control/type.d.ts +1 -1
- package/lib/room-control/waitingroom-control/index.js +11 -11
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
- package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib/room-control/whiteboard-control-v1/index.js +26 -18
- package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
- package/lib/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
- package/lib/room-router/index.js +10 -7
- package/lib/room-router/type.d.ts +1 -1
- package/lib/schema.d.ts +24 -46
- package/lib/schema.js +1 -2
- package/lib/service/api.d.ts +5 -3
- package/lib/service/api.js +17 -12
- package/lib/type.d.ts +64 -45
- package/lib/type.js +76 -11
- package/lib/utilities/abortable-retry.d.ts +38 -0
- package/lib/utilities/abortable-retry.js +61 -0
- package/lib/utilities/dual-video-stream-config.d.ts +6 -0
- package/lib/utilities/dual-video-stream-config.js +25 -0
- package/lib/utilities/error-helpers.d.ts +10 -9
- package/lib/utilities/error-helpers.js +12 -11
- package/lib/utilities/error.d.ts +4 -40
- package/lib/utilities/error.js +20 -77
- package/lib/utilities/join-helper.js +2 -2
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/logger.js +6 -25
- package/lib/utilities/package-info.d.ts +1 -2
- package/lib/utilities/package-info.js +4 -8
- package/lib/utilities/parameters.js +88 -15
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.d.ts +9 -0
- package/lib/utilities/video-encoder-config.js +109 -0
- package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
- package/lib-es/engine/index.js +46 -56
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +5 -3
- package/lib-es/index.js +2 -1
- package/lib-es/media-control/desktop.js +12 -12
- package/lib-es/media-control/mobile.js +4 -0
- package/lib-es/monitor-control/index.js +3 -3
- package/lib-es/peer-session/index.js +16 -15
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
- package/lib-es/room-control/ability-control/index.js +5 -4
- package/lib-es/room-control/ability-control/type.js +4 -0
- package/lib-es/room-control/group-control/index.js +11 -10
- package/lib-es/room-control/index.js +40 -26
- package/lib-es/room-control/interpreter-control/index.js +10 -5
- package/lib-es/room-control/interpreter-control/room.js +3 -3
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
- package/lib-es/room-control/mainroom-control/index.js +16 -17
- package/lib-es/room-control/privilege-control/index.js +43 -29
- package/lib-es/room-control/room-connector-control/index.js +9 -6
- package/lib-es/room-control/room-control-factory.js +6 -6
- package/lib-es/room-control/room-session/index.js +21 -22
- package/lib-es/room-control/sharing-control/index.js +13 -7
- package/lib-es/room-control/stream-control/index.js +21 -18
- package/lib-es/room-control/stt-control/index.js +23 -15
- package/lib-es/room-control/user-control/index.js +23 -23
- package/lib-es/room-control/waitingroom-control/index.js +10 -9
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
- package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib-es/room-router/index.js +10 -6
- package/lib-es/schema.js +1 -2
- package/lib-es/service/api.js +17 -12
- package/lib-es/type.js +70 -18
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +13 -12
- package/lib-es/utilities/error.js +9 -75
- package/lib-es/utilities/join-helper.js +4 -3
- package/lib-es/utilities/logger.js +7 -23
- package/lib-es/utilities/package-info.js +4 -6
- package/lib-es/utilities/parameters.js +88 -15
- package/lib-es/utilities/validate-params.js +3 -2
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +7 -7
- package/lib/chat-connection/index.d.ts +0 -24
- package/lib/chat-connection/type.d.ts +0 -17
- package/lib/plugins/chatroom.js +0 -454
- package/lib/room-control/chatroom-control/config.d.ts +0 -51
- package/lib/room-control/chatroom-control/config.js +0 -105
- package/lib/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- package/lib-es/plugins/chatroom.js +0 -446
- package/lib-es/room-control/chatroom-control/config.js +0 -100
- package/lib-es/utilities/storage.js +0 -27
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
|
@@ -4,26 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FcrStandaloneAnnotationControlImpl = exports.FcrAnnotationControlImpl = void 0;
|
|
7
|
+
var _error = require("../../../utilities/error");
|
|
7
8
|
var _logger = require("../../../utilities/logger");
|
|
8
9
|
var _base = require("../base");
|
|
9
10
|
var _constant = require("../constant");
|
|
11
|
+
var _type = require("../../whiteboard-control/type");
|
|
10
12
|
class FcrAnnotationControlImpl extends _base.FcrBaseWhiteboardControlImpl {
|
|
11
13
|
logger = (0, _logger.createLogger)({
|
|
12
14
|
prefix: 'FcrAnnotationControlImpl'
|
|
13
15
|
});
|
|
14
|
-
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher) {
|
|
16
|
+
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher, _sceneConfig, _api) {
|
|
15
17
|
super(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher);
|
|
16
18
|
this.rtmClient = rtmClient;
|
|
17
19
|
this.config = config;
|
|
20
|
+
this._sceneConfig = _sceneConfig;
|
|
21
|
+
this._api = _api;
|
|
18
22
|
this.logger.info(`initialized, hasOperationPrivilege: ${hasOperationPrivilege}`);
|
|
19
23
|
}
|
|
24
|
+
async syncScreenShareOwnerAnnotationOpenDone() {
|
|
25
|
+
try {
|
|
26
|
+
await this._api.syncScreenShareOwnerAnnotationOpenDone(this._sceneConfig.sceneId);
|
|
27
|
+
return 0;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
const error = e;
|
|
30
|
+
const errorMessage = error.message;
|
|
31
|
+
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.FCR_ROOM_WHITEBOARD, _error.FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED, `sync screen share owner annotation open done failed: ${errorMessage}`, error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async open() {
|
|
35
|
+
const state = this._sceneConfig.getAnnotationState();
|
|
36
|
+
if (state === _type.FcrBoardPropertiesState.INACTIVE) {
|
|
37
|
+
return await super.internalOpen(true);
|
|
38
|
+
} else {
|
|
39
|
+
return await super.internalOpen(false);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
20
42
|
getApplicationId() {
|
|
21
43
|
return _constant.ANNOTATION_APP_ID;
|
|
22
44
|
}
|
|
23
45
|
getWhiteboardOption() {
|
|
24
46
|
return {
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
47
|
+
width: this.config.size.width,
|
|
48
|
+
height: this.config.size.height,
|
|
27
49
|
defaultToolbarStyle: {
|
|
28
50
|
tool: 'laser'
|
|
29
51
|
},
|
|
@@ -33,13 +55,25 @@ class FcrAnnotationControlImpl extends _base.FcrBaseWhiteboardControlImpl {
|
|
|
33
55
|
}
|
|
34
56
|
exports.FcrAnnotationControlImpl = FcrAnnotationControlImpl;
|
|
35
57
|
class FcrStandaloneAnnotationControlImpl extends _base.FcrBaseWhiteboardControlImpl {
|
|
58
|
+
logger = (0, _logger.createLogger)({
|
|
59
|
+
prefix: 'FcrStandaloneAnnotationControlImpl'
|
|
60
|
+
});
|
|
61
|
+
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher) {
|
|
62
|
+
super(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher);
|
|
63
|
+
this.rtmClient = rtmClient;
|
|
64
|
+
this.config = config;
|
|
65
|
+
this.logger.info(`initialized, hasOperationPrivilege: ${hasOperationPrivilege}`);
|
|
66
|
+
}
|
|
67
|
+
async open() {
|
|
68
|
+
return await super.internalOpen(true);
|
|
69
|
+
}
|
|
36
70
|
getApplicationId() {
|
|
37
71
|
return _constant.ANNOTATION_APP_ID;
|
|
38
72
|
}
|
|
39
73
|
getWhiteboardOption() {
|
|
40
74
|
return {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
75
|
+
width: this.config.size.width,
|
|
76
|
+
height: this.config.size.height,
|
|
43
77
|
defaultToolbarStyle: {
|
|
44
78
|
tool: 'laser'
|
|
45
79
|
},
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { FcrAnnotationConfig, FcrAnnotationControl, FcrAnnotationControlFactory } from './type';
|
|
2
|
-
import { FcrAnnotationControlImpl } from './control';
|
|
1
|
+
import { FcrAnnotationConfig, FcrAnnotationControl, FcrAnnotationControlFactory, FcrAnnotationSceneConfig, FcrStandaloneAnnotationControl } from './type';
|
|
3
2
|
import { FcrCoreServiceApi } from '../../../service/api';
|
|
4
3
|
import type { RTMClient } from 'agora-rtm';
|
|
5
4
|
export declare class FcrAnnotationControlFactoryImpl implements FcrAnnotationControlFactory {
|
|
6
|
-
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
7
|
-
createForSubProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig):
|
|
8
|
-
createForMainProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig, api: FcrCoreServiceApi):
|
|
5
|
+
protected logger: import("agora-foundation/lib/logger/type").Logger;
|
|
6
|
+
createForSubProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig): FcrStandaloneAnnotationControl;
|
|
7
|
+
createForMainProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig, annotationSceneConfig: FcrAnnotationSceneConfig, api: FcrCoreServiceApi): FcrAnnotationControl;
|
|
9
8
|
private _createForgeInitConfigFetcher;
|
|
10
9
|
}
|
|
@@ -9,22 +9,23 @@ var _control = require("./control");
|
|
|
9
9
|
var _logger = require("../../../utilities/logger");
|
|
10
10
|
var _error = require("../../../utilities/error");
|
|
11
11
|
var _sharedStorage = require("../../../utilities/shared-storage");
|
|
12
|
+
var _imports = require("../../../imports");
|
|
12
13
|
class FcrAnnotationControlFactoryImpl {
|
|
13
14
|
logger = (0, _logger.createLogger)({
|
|
14
15
|
prefix: 'FcrAnnotationControlFactory'
|
|
15
16
|
});
|
|
16
17
|
createForSubProcess(rtmClient, hasOperationPrivilege, config) {
|
|
17
|
-
this.logger.info(`
|
|
18
|
+
this.logger.info(`create for sub process with config: ${JSON.stringify(config)}`);
|
|
18
19
|
return new _control.FcrStandaloneAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, () => {
|
|
19
20
|
const forgeInitConfig = (0, _sharedStorage.getAnnotationBoardOptions)();
|
|
20
21
|
if (!forgeInitConfig) {
|
|
21
|
-
throw (0, _error.generateFcrCoreClientError)(
|
|
22
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, _imports.DetailErrorCode.UNDEFINED_ERROR, `whiteboard init config is not exist`, new Error(`whiteboard init config is not exist`));
|
|
22
23
|
}
|
|
23
24
|
return Promise.resolve(forgeInitConfig);
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
createForMainProcess(rtmClient, hasOperationPrivilege, config, api) {
|
|
27
|
-
const control = new _control.FcrAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, this._createForgeInitConfigFetcher(api, config.roomId, config.userId));
|
|
27
|
+
createForMainProcess(rtmClient, hasOperationPrivilege, config, annotationSceneConfig, api) {
|
|
28
|
+
const control = new _control.FcrAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, this._createForgeInitConfigFetcher(api, config.roomId, config.userId), annotationSceneConfig, api);
|
|
28
29
|
return control;
|
|
29
30
|
}
|
|
30
31
|
_createForgeInitConfigFetcher(api, roomId, userId) {
|
|
@@ -32,7 +33,7 @@ class FcrAnnotationControlFactoryImpl {
|
|
|
32
33
|
return await (0, _error.handleRequestError)(() => api.getAnnotationToken({
|
|
33
34
|
roomId,
|
|
34
35
|
userId
|
|
35
|
-
}),
|
|
36
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get annotation token failed');
|
|
36
37
|
};
|
|
37
38
|
return async () => {
|
|
38
39
|
const response = await getObjectInitConfig(roomId, userId);
|
|
@@ -2,9 +2,11 @@ import { FcrBaseWhiteboardControl, FcrBaseWhiteboardObserver } from '../type';
|
|
|
2
2
|
import { FcrBoardConfig } from '../whiteboard-control/type';
|
|
3
3
|
import { FcrCoreServiceApi } from '../../../service/api';
|
|
4
4
|
import type { RTMClient } from 'agora-rtm';
|
|
5
|
+
import { FcrBoardPropertiesState } from '../../whiteboard-control/type';
|
|
5
6
|
export interface FcrStandaloneAnnotationControl extends FcrBaseWhiteboardControl<FcrBaseWhiteboardObserver> {
|
|
6
7
|
}
|
|
7
8
|
export interface FcrAnnotationControl extends FcrBaseWhiteboardControl<FcrBaseWhiteboardObserver> {
|
|
9
|
+
syncScreenShareOwnerAnnotationOpenDone(): Promise<number>;
|
|
8
10
|
}
|
|
9
11
|
export interface FcrAnnotationControObserver extends FcrBaseWhiteboardObserver {
|
|
10
12
|
}
|
|
@@ -31,7 +33,11 @@ export type FcrAnnotationConfig = FcrBoardConfig & {
|
|
|
31
33
|
height: number;
|
|
32
34
|
};
|
|
33
35
|
};
|
|
36
|
+
export type FcrAnnotationSceneConfig = {
|
|
37
|
+
sceneId: string;
|
|
38
|
+
getAnnotationState: () => FcrBoardPropertiesState;
|
|
39
|
+
};
|
|
34
40
|
export interface FcrAnnotationControlFactory {
|
|
35
41
|
createForSubProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig): FcrStandaloneAnnotationControl;
|
|
36
|
-
createForMainProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig, api: FcrCoreServiceApi): FcrAnnotationControl;
|
|
42
|
+
createForMainProcess(rtmClient: RTMClient, hasOperationPrivilege: boolean, config: FcrAnnotationConfig, annotationSceneConfig: FcrAnnotationSceneConfig, api: FcrCoreServiceApi): FcrAnnotationControl;
|
|
37
43
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Room } from '@netless/forge-room';
|
|
2
|
+
import { Whiteboard, WhiteboardOption } from '@netless/forge-whiteboard';
|
|
2
3
|
import { AgoraRteConnectionState } from 'agora-rte-sdk';
|
|
3
4
|
import type { RTMClient } from 'agora-rtm';
|
|
4
5
|
import { AgoraObservable, AgoraScheduler } from '../../../imports';
|
|
5
|
-
import { FcrBoardConfig } from '../whiteboard-control/type';
|
|
6
|
-
import { Room } from '@netless/forge-room';
|
|
7
|
-
import { Whiteboard, WhiteboardOption } from '@netless/forge-whiteboard';
|
|
8
6
|
import { FcrConnectionState } from '../../../type';
|
|
7
|
+
import { FcrBaseWhiteboardControl, FcrBaseWhiteboardObserver, FcrBoardMainWindow, FcrObjectForgeInitConfig } from '../type';
|
|
8
|
+
import { FcrBoardConfig } from '../whiteboard-control/type';
|
|
9
9
|
export declare class FcrBaseWhiteboardControlImpl<T extends FcrBaseWhiteboardObserver> implements FcrBaseWhiteboardControl<T> {
|
|
10
10
|
protected rtmClient: RTMClient;
|
|
11
11
|
protected config: FcrBoardConfig;
|
|
@@ -22,17 +22,18 @@ export declare class FcrBaseWhiteboardControlImpl<T extends FcrBaseWhiteboardObs
|
|
|
22
22
|
private _waitPromiseResolve;
|
|
23
23
|
private _waitPromiseReject;
|
|
24
24
|
private _openAbortController;
|
|
25
|
-
private
|
|
25
|
+
private _openState;
|
|
26
26
|
constructor(rtmClient: RTMClient, config: FcrBoardConfig, hasOperationPrivilege: boolean, forgeInitConfigFetcher: () => Promise<FcrObjectForgeInitConfig>);
|
|
27
|
-
setOperationPrivilege(hasOperationPrivilege: boolean):
|
|
27
|
+
setOperationPrivilege(hasOperationPrivilege: boolean): number;
|
|
28
28
|
open(): Promise<FcrBoardMainWindow>;
|
|
29
|
-
close(): Promise<
|
|
29
|
+
close(): Promise<number>;
|
|
30
30
|
getConnectionState(): AgoraRteConnectionState;
|
|
31
31
|
getMainWindow(): FcrBoardMainWindow | null;
|
|
32
32
|
addObserver(observer: T): void;
|
|
33
33
|
removeObserver(observer: T): void;
|
|
34
|
+
protected internalOpen(isNeedLaunch: boolean): Promise<FcrBoardMainWindow>;
|
|
34
35
|
protected updateConnectionState(state: FcrConnectionState): void;
|
|
35
|
-
protected connect(): Promise<FcrBoardMainWindow>;
|
|
36
|
+
protected connect(isNeedLaunch: boolean): Promise<FcrBoardMainWindow>;
|
|
36
37
|
protected getApplicationId(): string;
|
|
37
38
|
protected getWhiteboardOption(): WhiteboardOption;
|
|
38
39
|
protected getBackgroundColor(): string;
|
|
@@ -22,26 +22,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
22
22
|
});
|
|
23
23
|
exports.FcrBaseWhiteboardControlImpl = void 0;
|
|
24
24
|
require("core-js/modules/es.json.stringify.js");
|
|
25
|
-
var _forgeRtm = require("@netless/forge-rtm");
|
|
26
|
-
var _imports = require("../../../imports");
|
|
27
|
-
var _constant = require("../constant");
|
|
28
25
|
var _forgeRoom = require("@netless/forge-room");
|
|
29
|
-
var
|
|
26
|
+
var _forgeRtm = require("@netless/forge-rtm");
|
|
30
27
|
var _forgeWhiteboard = require("@netless/forge-whiteboard");
|
|
28
|
+
var _imports = require("../../../imports");
|
|
29
|
+
var _type = require("../../../type");
|
|
31
30
|
var _error = require("../../../utilities/error");
|
|
31
|
+
var _logger = require("../../../utilities/logger");
|
|
32
|
+
var _constant = require("../constant");
|
|
32
33
|
var _mainWindow = require("./main-window");
|
|
33
|
-
|
|
34
|
-
let _initProto;
|
|
34
|
+
let _initProto, _setOperationPrivilegeDecs;
|
|
35
35
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
36
36
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
37
37
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
38
38
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
39
39
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
40
|
+
/** @param isNeedLaunch 是否需要调用白板 luanch 函数 */
|
|
41
|
+
|
|
42
|
+
const WHITEBOARD_ROOM_JOIN_TIMEOUT = 20000;
|
|
40
43
|
class FcrBaseWhiteboardControlImpl {
|
|
41
44
|
static {
|
|
42
|
-
[_initProto] = _applyDecs(this, [[
|
|
45
|
+
[_initProto] = _applyDecs(this, [[_setOperationPrivilegeDecs, 2, "setOperationPrivilege"], [_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getConnectionState"], [_imports.trace, 2, "getMainWindow"]], []).e;
|
|
43
46
|
}
|
|
44
|
-
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
47
|
+
[(_setOperationPrivilegeDecs = (0, _imports.trace)(['hasOperationPrivilege']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
45
48
|
prefix: 'FcrBaseWhiteboardControl'
|
|
46
49
|
}));
|
|
47
50
|
observable = new _imports.AgoraObservable();
|
|
@@ -55,7 +58,10 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
55
58
|
_waitPromiseResolve = null;
|
|
56
59
|
_waitPromiseReject = null;
|
|
57
60
|
_openAbortController = null;
|
|
58
|
-
|
|
61
|
+
_openState = {
|
|
62
|
+
isOpen: false,
|
|
63
|
+
isNeedLaunch: undefined
|
|
64
|
+
};
|
|
59
65
|
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher) {
|
|
60
66
|
this.rtmClient = rtmClient;
|
|
61
67
|
this.config = config;
|
|
@@ -65,8 +71,8 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
65
71
|
this.forgeInitConfig = forgeInitConfig;
|
|
66
72
|
this.logger.info(`fetch forge init config success, config: ${(0, _imports.jsonstring)(forgeInitConfig)}`);
|
|
67
73
|
this.forgeInitConfigTask.stop();
|
|
68
|
-
if (this.
|
|
69
|
-
this.connect();
|
|
74
|
+
if (this._openState.isOpen) {
|
|
75
|
+
this.connect(this._openState.isNeedLaunch);
|
|
70
76
|
}
|
|
71
77
|
}, _constant.INIT_CONFIG_FETCH_INTERVAL);
|
|
72
78
|
this.addLogObserver();
|
|
@@ -74,17 +80,17 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
74
80
|
setOperationPrivilege(hasOperationPrivilege) {
|
|
75
81
|
if (this.hasOperationPrivilege !== hasOperationPrivilege) {
|
|
76
82
|
this.hasOperationPrivilege = hasOperationPrivilege;
|
|
77
|
-
const
|
|
83
|
+
const boardRoom = this.boardRoom;
|
|
78
84
|
const boardView = this.boardView;
|
|
79
|
-
if (
|
|
85
|
+
if (boardRoom) {
|
|
80
86
|
if (hasOperationPrivilege) {
|
|
81
|
-
|
|
87
|
+
boardRoom.setWritable(true);
|
|
82
88
|
if (boardView) {
|
|
83
89
|
// @ts-expect-error
|
|
84
90
|
boardView._observable.notifyObservers('onWritable', true);
|
|
85
91
|
}
|
|
86
92
|
} else {
|
|
87
|
-
|
|
93
|
+
boardRoom.setWritable(false);
|
|
88
94
|
if (boardView) {
|
|
89
95
|
// @ts-expect-error
|
|
90
96
|
boardView._observable.notifyObservers('onWritable', false);
|
|
@@ -92,24 +98,17 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
}
|
|
101
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
95
102
|
}
|
|
96
103
|
async open() {
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
if (isReadyToConnect) {
|
|
100
|
-
return this.connect();
|
|
101
|
-
}
|
|
102
|
-
if (!this._waitPromise) {
|
|
103
|
-
this._waitPromise = new Promise((resolve, reject) => {
|
|
104
|
-
this._waitPromiseResolve = resolve;
|
|
105
|
-
this._waitPromiseReject = reject;
|
|
106
|
-
this.logger.info('waiting for forge config to be ready');
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return this._waitPromise;
|
|
104
|
+
this.logger.error('subclass must implement open method, not call base class method');
|
|
105
|
+
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.FCR_ROOM_WHITEBOARD, _error.FcrErrorCode.UNDEFINED_ERROR, 'subclass must implement open method, not call base class method', new Error('subclass must implement open method, not call base class method'));
|
|
110
106
|
}
|
|
111
107
|
async close() {
|
|
112
|
-
this.
|
|
108
|
+
this._openState = {
|
|
109
|
+
isOpen: false,
|
|
110
|
+
isNeedLaunch: undefined
|
|
111
|
+
};
|
|
113
112
|
if (!this.forgeInitConfigTask.isStopped) {
|
|
114
113
|
this.forgeInitConfigTask.stop();
|
|
115
114
|
}
|
|
@@ -128,7 +127,6 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
128
127
|
this.whiteboard = null;
|
|
129
128
|
if (boardRoom) {
|
|
130
129
|
boardRoom.applicationManager.removeAllListeners();
|
|
131
|
-
boardRoom.applicationManager.terminateApplication(this.getApplicationId());
|
|
132
130
|
await boardRoom.leaveRoom();
|
|
133
131
|
}
|
|
134
132
|
} catch (e) {
|
|
@@ -136,6 +134,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
136
134
|
} finally {
|
|
137
135
|
this.updateConnectionState(_type.FcrConnectionState.DISCONNECTED);
|
|
138
136
|
}
|
|
137
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
139
138
|
}
|
|
140
139
|
getConnectionState() {
|
|
141
140
|
return this.connectState;
|
|
@@ -149,6 +148,24 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
149
148
|
removeObserver(observer) {
|
|
150
149
|
this.observable.removeObserver(observer);
|
|
151
150
|
}
|
|
151
|
+
internalOpen(isNeedLaunch) {
|
|
152
|
+
this._openState = {
|
|
153
|
+
isOpen: true,
|
|
154
|
+
isNeedLaunch: isNeedLaunch
|
|
155
|
+
};
|
|
156
|
+
const isReadyToConnect = this._checkForConnect();
|
|
157
|
+
if (isReadyToConnect) {
|
|
158
|
+
return this.connect(isNeedLaunch);
|
|
159
|
+
}
|
|
160
|
+
if (!this._waitPromise) {
|
|
161
|
+
this._waitPromise = new Promise((resolve, reject) => {
|
|
162
|
+
this._waitPromiseResolve = resolve;
|
|
163
|
+
this._waitPromiseReject = reject;
|
|
164
|
+
this.logger.info('waiting for forge config to be ready');
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return this._waitPromise;
|
|
168
|
+
}
|
|
152
169
|
updateConnectionState(state) {
|
|
153
170
|
if (this.connectState === state) {
|
|
154
171
|
return;
|
|
@@ -158,7 +175,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
158
175
|
this.logger.info(`Connection state updated: ${_type.FcrConnectionState[oldState]} -> ${_type.FcrConnectionState[state]}`);
|
|
159
176
|
this.observable.notifyObservers('onConnectionStateUpdated', state);
|
|
160
177
|
}
|
|
161
|
-
async connect() {
|
|
178
|
+
async connect(isNeedLaunch) {
|
|
162
179
|
if (this.boardView) {
|
|
163
180
|
this.logger.info('board already connected, returning existing board view');
|
|
164
181
|
return this.boardView;
|
|
@@ -181,13 +198,13 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
181
198
|
boardToken
|
|
182
199
|
} = this.forgeInitConfig || {};
|
|
183
200
|
if (!boardAppId) {
|
|
184
|
-
throw (0, _error.generateFcrCoreClientError)(
|
|
201
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, _imports.DetailErrorCode.UNDEFINED_ERROR, 'boardAppId is required', new Error('boardAppId is required'));
|
|
185
202
|
}
|
|
186
203
|
if (!boardId) {
|
|
187
|
-
throw (0, _error.generateFcrCoreClientError)(
|
|
204
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, _imports.DetailErrorCode.UNDEFINED_ERROR, 'boardId is required', new Error('boardId is required'));
|
|
188
205
|
}
|
|
189
206
|
if (!boardToken) {
|
|
190
|
-
throw (0, _error.generateFcrCoreClientError)(
|
|
207
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, _imports.DetailErrorCode.UNDEFINED_ERROR, 'boardToken is required', new Error('boardToken is required'));
|
|
191
208
|
}
|
|
192
209
|
const whiteboardOption = this.getWhiteboardOption();
|
|
193
210
|
let width = whiteboardOption.width;
|
|
@@ -200,7 +217,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
200
217
|
this.logger.warn(`board height is a invalid value: ${height}, using default value 600`);
|
|
201
218
|
whiteboardOption.height = 600;
|
|
202
219
|
}
|
|
203
|
-
this.logger.info(`open board with boardId: ${boardId}, boardToken: ${boardToken}, region: ${boardRegion}, whiteboardOption: ${(0, _imports.jsonstring)(whiteboardOption)}`);
|
|
220
|
+
this.logger.info(`open board with boardId: ${boardId}, boardToken: ${boardToken}, region: ${boardRegion}, appIdentifier: ${boardAppId} whiteboardOption: ${(0, _imports.jsonstring)(whiteboardOption)}`);
|
|
204
221
|
const rtmProvider = new _forgeRtm.RTMProvider_2_2(this.rtmClient);
|
|
205
222
|
const wbRoom = new _forgeRoom.Room(boardId, rtmProvider);
|
|
206
223
|
wbRoom.applicationManager.registerApplication(_forgeWhiteboard.WhiteboardApplication);
|
|
@@ -211,6 +228,23 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
211
228
|
let whiteboard = null;
|
|
212
229
|
let boardRoom = wbRoom;
|
|
213
230
|
const appId = this.getApplicationId();
|
|
231
|
+
let getWhiteboard;
|
|
232
|
+
|
|
233
|
+
// 第一个开启白板的人需要调用 launch 方法, 其他人监听 launch 事件获取白板实例
|
|
234
|
+
if (isNeedLaunch) {
|
|
235
|
+
getWhiteboard = () => {
|
|
236
|
+
return wbRoom.applicationManager.launchApplication(_forgeWhiteboard.WhiteboardApplication, whiteboardOption, appId);
|
|
237
|
+
};
|
|
238
|
+
} else {
|
|
239
|
+
const launchPromise = new Promise((launchPromseResolve, launchPromseReject) => {
|
|
240
|
+
wbRoom.applicationManager.once('launch', (appId, app) => {
|
|
241
|
+
launchPromseResolve(app);
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
getWhiteboard = () => {
|
|
245
|
+
return launchPromise;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
214
248
|
[error] = await (0, _imports.to)((0, _imports.retryAttempt)(async () => {
|
|
215
249
|
const joinRoomParams = {
|
|
216
250
|
userId,
|
|
@@ -219,15 +253,23 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
219
253
|
sdkConfig: {
|
|
220
254
|
region: boardRegion,
|
|
221
255
|
appIdentifier: boardAppId
|
|
222
|
-
}
|
|
256
|
+
},
|
|
257
|
+
writable: true
|
|
223
258
|
// verboseLog: true,
|
|
224
259
|
};
|
|
225
260
|
this.logger.info(`join params: ${(0, _imports.jsonstring)(joinRoomParams)}`);
|
|
226
|
-
|
|
261
|
+
|
|
262
|
+
// 20 秒超时
|
|
263
|
+
await wbRoom.joinRoom(joinRoomParams, WHITEBOARD_ROOM_JOIN_TIMEOUT);
|
|
227
264
|
boardRoom = wbRoom;
|
|
228
|
-
whiteboard = await
|
|
265
|
+
whiteboard = await getWhiteboard();
|
|
266
|
+
if (isNeedLaunch) {
|
|
267
|
+
// 在同一个房间内只有第一次调用 launchApplication 时传入的宽高参数会生效, 后续的调用不会生效, 所以需要在这里更新宽高
|
|
268
|
+
// 只有 launch 的用户需要更新宽、高, 白板会自动同步给后加入的用户
|
|
269
|
+
whiteboard.updateViewport(width, height);
|
|
270
|
+
}
|
|
229
271
|
}, [], {
|
|
230
|
-
retriesMax:
|
|
272
|
+
retriesMax: 0
|
|
231
273
|
}).fail(async ({
|
|
232
274
|
error,
|
|
233
275
|
timeFn,
|
|
@@ -256,9 +298,9 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
256
298
|
this.boardView = boardView;
|
|
257
299
|
this.boardRoom = boardRoom;
|
|
258
300
|
if (this.hasOperationPrivilege) {
|
|
259
|
-
|
|
301
|
+
this.boardRoom.setWritable(true);
|
|
260
302
|
} else {
|
|
261
|
-
|
|
303
|
+
this.boardRoom.setWritable(false);
|
|
262
304
|
}
|
|
263
305
|
this.updateConnectionState(_type.FcrConnectionState.CONNECTED);
|
|
264
306
|
resolve(boardView);
|
|
@@ -296,7 +338,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
296
338
|
return 'rgba(0, 0, 0, 0)';
|
|
297
339
|
}
|
|
298
340
|
addLogObserver() {
|
|
299
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onConnectionStateUpdated']));
|
|
341
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onConnectionStateUpdated', ['state']]]));
|
|
300
342
|
}
|
|
301
343
|
_checkForConnect() {
|
|
302
344
|
return !!this.forgeInitConfig;
|
|
@@ -4,6 +4,7 @@ import { Whiteboard } from '@netless/forge-whiteboard';
|
|
|
4
4
|
import { Room } from '@netless/forge-room';
|
|
5
5
|
import { FcrSize } from '../../stream-control/type';
|
|
6
6
|
import { FcrBoardPageInfo, FcrColor } from '../../whiteboard-control/type';
|
|
7
|
+
import { FcrReturnCode } from '../../../type';
|
|
7
8
|
export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow {
|
|
8
9
|
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
9
10
|
private _whiteboard;
|
|
@@ -13,27 +14,27 @@ export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow {
|
|
|
13
14
|
private _background;
|
|
14
15
|
private _isAutoCancelEnabled;
|
|
15
16
|
constructor(whiteboard: Whiteboard, boardRoom: Room, appId: string);
|
|
16
|
-
addPage(): Promise<
|
|
17
|
-
removePage(): Promise<
|
|
18
|
-
undo(): Promise<
|
|
19
|
-
redo(): Promise<
|
|
20
|
-
clean(): Promise<
|
|
17
|
+
addPage(): Promise<FcrReturnCode>;
|
|
18
|
+
removePage(): Promise<FcrReturnCode>;
|
|
19
|
+
undo(): Promise<FcrReturnCode>;
|
|
20
|
+
redo(): Promise<FcrReturnCode>;
|
|
21
|
+
clean(): Promise<FcrReturnCode>;
|
|
21
22
|
getSnapshotImage(): Promise<ImageData>;
|
|
22
|
-
setBackgroundColor(color: string): Promise<
|
|
23
|
+
setBackgroundColor(color: string): Promise<FcrReturnCode>;
|
|
23
24
|
getPageInfo(): FcrBoardPageInfo;
|
|
24
|
-
prevPage(): Promise<
|
|
25
|
-
nextPage(): Promise<
|
|
26
|
-
setToolType(type: FcrBoardToolType): Promise<
|
|
27
|
-
setStrokeWidth(strokeWidth: number): Promise<
|
|
28
|
-
setStrokeColor(color: FcrColor | string): Promise<
|
|
29
|
-
setTextColor(color: FcrColor): Promise<
|
|
30
|
-
setTextSize(textSize: number): Promise<
|
|
25
|
+
prevPage(): Promise<FcrReturnCode>;
|
|
26
|
+
nextPage(): Promise<FcrReturnCode>;
|
|
27
|
+
setToolType(type: FcrBoardToolType): Promise<FcrReturnCode>;
|
|
28
|
+
setStrokeWidth(strokeWidth: number): Promise<FcrReturnCode>;
|
|
29
|
+
setStrokeColor(color: FcrColor | string): Promise<FcrReturnCode>;
|
|
30
|
+
setTextColor(color: FcrColor): Promise<FcrReturnCode>;
|
|
31
|
+
setTextSize(textSize: number): Promise<FcrReturnCode>;
|
|
31
32
|
insertImage(resourceUrl: string, x: number, y: number, width: number, height: number): Promise<void>;
|
|
32
33
|
getContentView(): HTMLElement;
|
|
33
34
|
setContainerSizeRatio(ratio: number): Promise<void>;
|
|
34
35
|
setBoardTransparent(isTransparent: boolean): Promise<void>;
|
|
35
|
-
updateWindowSize(size: FcrSize):
|
|
36
|
-
setAutoCancelDraw(enable: boolean):
|
|
36
|
+
updateWindowSize(size: FcrSize): FcrReturnCode;
|
|
37
|
+
setAutoCancelDraw(enable: boolean): FcrReturnCode;
|
|
37
38
|
getWritable(): boolean;
|
|
38
39
|
addObserver(observer: FcrBoardMainWindowObserver): void;
|
|
39
40
|
removeObserver(observer: FcrBoardMainWindowObserver): void;
|