Skip to content

Commit 9af4c17

Browse files
committed
docs: update docs about appliance-plugin
1 parent f79c79c commit 9af4c17

File tree

2 files changed

+122
-10
lines changed

2 files changed

+122
-10
lines changed

docs/en/appliance-plugin.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ The following interfaces are involved:
190190
- Server-side screenshot, after the appliance-plugin is turned on, notes cannot be obtained by calling server-side screenshot, but need to use `screenshotToCanvasAsync` to obtain the screenshot
191191

192192
#### New features
193-
1. Minimap function
193+
1. Minimap function (Version >=1.1.6)
194194
```js
195195
/** Create a minimap
196196
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
@@ -200,7 +200,7 @@ The following interfaces are involved:
200200
/** Destroy minimap */
201201
destroyMiniMap(viewId: string): Promise<void>;
202202
```
203-
2. Filter Elements
203+
2. Filter Elements (Version >=1.1.6)
204204
```js
205205
/** Filter Elements
206206
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
@@ -217,13 +217,69 @@ The following interfaces are involved:
217217
*/
218218
cancelFilterRender(viewId: string, isSync?:boolean): void;
219219
```
220-
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board'
220+
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board' (Version >=1.1.3)
221221

222-
4. laserPen teaching aids
222+
4. laserPen teaching aids (Version >=1.1.1)
223223
```js
224224
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
225225
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
226226
```
227+
5. Extended Teaching AIDS (Version >=1.1.1)
228+
```js
229+
export enum EStrokeType {
230+
/** Solid line */
231+
Normal = 'Normal',
232+
/** Line with pen edge */
233+
Stroke = 'Stroke',
234+
/** Dotted line */
235+
Dotted = 'Dotted',
236+
/** Long dotted line */
237+
LongDotted = 'LongDotted'
238+
};
239+
export type ExtendMemberState = {
240+
/** The teaching AIDS selected by the current user */
241+
currentApplianceName: ApplianceNames;
242+
/** Whether to open the pen tip */
243+
strokeType? : EStrokeType;
244+
/** Whether to delete the entire line segment */
245+
isLine? : boolean;
246+
/** Wireframe transparency */
247+
strokeOpacity? : number;
248+
/** Whether to turn on laser pointer */
249+
useLaserPen? : boolean;
250+
/** Laser pointer holding time, second */
251+
duration? : number;
252+
/** Fill style */
253+
fillColor? : Color;
254+
/** Fill transparency */
255+
fillOpacity? : number;
256+
/** The specific type of graph to draw when using shape */
257+
shapeType? : ShapeType;
258+
/** Number of polygon vertices */
259+
vertices? :number;
260+
/** Length of the inner vertex of the polygon */
261+
innerVerticeStep? :number;
262+
/** Ratio of the radius of the inner vertex of the polygon to the outer vertex */
263+
innerRatio? : number;
264+
/** Text transparency */
265+
textOpacity? : number;
266+
/** Text background color */
267+
textBgColor? : Color;
268+
/** Text background color transparency */
269+
textBgOpacity? : number;
270+
/** Horizontal alignment */
271+
textAlign? : "left" | "center" | "right";
272+
/** Vertical alignment */
273+
verticalAlign? : "top" | "middle" | "bottom";
274+
/** Location */
275+
placement? : SpeechBalloonPlacement;
276+
};
277+
import { ExtendMemberState, ApplianceNames } from '@netless/appliance-plugin';
278+
/** Set the state of teaching AIDS */
279+
room.setMemberState({ ... } as ExtendMemberState);
280+
manager.mainView.setMemberState({ ... } as ExtendMemberState);
281+
appliance.setMemberState({ ... } as ExtendMemberState);
282+
```
227283

228284
### Configure parameters
229285
``getInstance(wm: WindowManager, adaptor: ApplianceAdaptor)``

docs/zh/appliance-plugin.md

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ module: {
193193
- 服务端截图, appliance-plugin开启后, 笔记不能通过调用服务端截图方式获取截图,而需要改用`screenshotToCanvasAsync`获取
194194

195195
#### 新功能
196-
1. 小地图功能
196+
1. 小地图功能 (Version >=1.1.6)
197197
```js
198198
/** 创建小地图
199199
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
@@ -203,7 +203,7 @@ module: {
203203
/** 销毁小地图 */
204204
destroyMiniMap(viewId: string): Promise<boolean>;
205205
```
206-
2. 过滤笔记
206+
2. 过滤笔记 (Version >=1.1.6)
207207
```js
208208
/** 过滤笔记
209209
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
@@ -220,12 +220,68 @@ module: {
220220
*/
221221
cancelFilterRender(viewId: string, isSync?:boolean): void;
222222
```
223-
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board`
223+
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board` (Version >=1.1.3)
224224

225-
4. 激光铅笔教具
225+
4. 激光铅笔教具 (Version >=1.1.1)
226226
```js
227-
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
228-
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
227+
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
228+
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
229+
```
230+
5. 扩展教具 (Version >=1.1.1)
231+
```js
232+
export enum EStrokeType {
233+
/** 实心线条 */
234+
Normal = 'Normal',
235+
/** 带笔锋线条 */
236+
Stroke = 'Stroke',
237+
/** 虚线线条 */
238+
Dotted = 'Dotted',
239+
/** 长虚线线条 */
240+
LongDotted = 'LongDotted'
241+
};
242+
export type ExtendMemberState = {
243+
/** 当前用户所选择的教具 */
244+
currentApplianceName: ApplianceNames;
245+
/** 是否开启笔锋 */
246+
strokeType?: EStrokeType;
247+
/** 是否删除整条线段 */
248+
isLine?: boolean;
249+
/** 线框透明度 */
250+
strokeOpacity?: number;
251+
/** 是否开启激光笔 */
252+
useLaserPen?: boolean;
253+
/** 激光笔保持时间, second */
254+
duration?: number;
255+
/** 填充样式 */
256+
fillColor?: Color;
257+
/** 填充透明度 */
258+
fillOpacity?: number;
259+
/** 使用 ``shape`` 教具时,绘制图形的具体类型 */
260+
shapeType?: ShapeType;
261+
/** 多边形顶点数 */
262+
vertices?:number;
263+
/** 多边形向内顶点步长 */
264+
innerVerticeStep?:number;
265+
/** 多边形向内顶点与外顶点半径比率 */
266+
innerRatio?: number;
267+
/** 文字透明度 */
268+
textOpacity?: number;
269+
/** 文字背景颜色 */
270+
textBgColor?: Color;
271+
/** 文字背景颜色透明度 */
272+
textBgOpacity?: number;
273+
/** 水平对齐方式 */
274+
textAlign?: "left" | "center" | "right";
275+
/** 垂直对齐方式 */
276+
verticalAlign?: "top" | "middle" | "bottom";
277+
/** 位置 */
278+
placement?: SpeechBalloonPlacement;
279+
};
280+
import { ExtendMemberState, ApplianceNames } from '@netless/appliance-plugin';
281+
/** 设置教具状态 */
282+
room.setMemberState({ ... } as ExtendMemberState);
283+
manager.mainView.setMemberState({ ... } as ExtendMemberState);
284+
appliance.setMemberState({ ... } as ExtendMemberState);
229285
```
230286

231287
### 配置参数

0 commit comments

Comments
 (0)