Skip to content

Commit

Permalink
docs: update docs about appliance-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hqer927 committed Dec 4, 2024
1 parent f79c79c commit 8aa4b89
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 10 deletions.
60 changes: 56 additions & 4 deletions docs/en/appliance-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ The following interfaces are involved:
- 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

#### New features
1. Minimap function
1. Minimap function (Version >=1.1.6)
```js
/** Create a minimap
* @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
Expand All @@ -200,7 +200,7 @@ The following interfaces are involved:
/** Destroy minimap */
destroyMiniMap(viewId: string): Promise<void>;
```
2. Filter Elements
2. Filter Elements (Version >=1.1.6)
```js
/** Filter Elements
* @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
Expand All @@ -217,13 +217,65 @@ The following interfaces are involved:
*/
cancelFilterRender(viewId: string, isSync?:boolean): void;
```
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board'
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board' (Version >=1.1.3)

4. laserPen teaching aids
4. laserPen teaching aids (Version >=1.1.1)
```js
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
```
5. Extended Teaching AIDS (Version >=1.1.1)
```js
export enum EStrokeType {
/** Solid line */
Normal = 'Normal',
/** Line with pen edge */
Stroke = 'Stroke',
/** Dotted line */
Dotted = 'Dotted',
/** Long dotted line */
LongDotted = 'LongDotted'
};
export type ExtendMemberState = {
/** The teaching AIDS selected by the current user */
currentApplianceName: ApplianceNames;
/** Whether to open the pen tip */
strokeType? : EStrokeType;
/** Whether to delete the entire line segment */
isLine? : boolean;
/** Wireframe transparency */
strokeOpacity? : number;
/** Whether to turn on laser pointer */
useLaserPen? : boolean;
/** Laser pointer holding time, second */
duration? : number;
/** Fill style */
fillColor? : Color;
/** Fill transparency */
fillOpacity? : number;
/** The specific type of graph to draw when using shape */
shapeType? : ShapeType;
/** Number of polygon vertices */
vertices? :number;
/** Length of the inner vertex of the polygon */
innerVerticeStep? :number;
/** Ratio of the radius of the inner vertex of the polygon to the outer vertex */
innerRatio? : number;
/** Text transparency */
textOpacity? : number;
/** Text background color */
textBgColor? : Color;
/** Text background color transparency */
textBgOpacity? : number;
/** Location */
placement? : SpeechBalloonPlacement;
};
import { ExtendMemberState, ApplianceNames } from '@netless/appliance-plugin';
/** Set the state of teaching AIDS */
room.setMemberState({ ... } as ExtendMemberState);
manager.mainView.setMemberState({ ... } as ExtendMemberState);
appliance.setMemberState({ ... } as ExtendMemberState);
```

### Configure parameters
``getInstance(wm: WindowManager, adaptor: ApplianceAdaptor)``
Expand Down
64 changes: 58 additions & 6 deletions docs/zh/appliance-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module: {
- 服务端截图, appliance-plugin开启后, 笔记不能通过调用服务端截图方式获取截图,而需要改用`screenshotToCanvasAsync`获取

#### 新功能
1. 小地图功能
1. 小地图功能 (Version >=1.1.6)
```js
/** 创建小地图
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
Expand All @@ -203,7 +203,7 @@ module: {
/** 销毁小地图 */
destroyMiniMap(viewId: string): Promise<boolean>;
```
2. 过滤笔记
2. 过滤笔记 (Version >=1.1.6)
```js
/** 过滤笔记
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
Expand All @@ -220,12 +220,64 @@ module: {
*/
cancelFilterRender(viewId: string, isSync?:boolean): void;
```
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board`
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board` (Version >=1.1.3)

4. 激光铅笔教具
4. 激光铅笔教具 (Version >=1.1.1)
```js
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
```
5. 扩展教具 (Version >=1.1.1)
```js
export enum EStrokeType {
/** 实心线条 */
Normal = 'Normal',
/** 带笔锋线条 */
Stroke = 'Stroke',
/** 虚线线条 */
Dotted = 'Dotted',
/** 长虚线线条 */
LongDotted = 'LongDotted'
};
export type ExtendMemberState = {
/** 当前用户所选择的教具 */
currentApplianceName: ApplianceNames;
/** 是否开启笔锋 */
strokeType?: EStrokeType;
/** 是否删除整条线段 */
isLine?: boolean;
/** 线框透明度 */
strokeOpacity?: number;
/** 是否开启激光笔 */
useLaserPen?: boolean;
/** 激光笔保持时间, second */
duration?: number;
/** 填充样式 */
fillColor?: Color;
/** 填充透明度 */
fillOpacity?: number;
/** 使用 ``shape`` 教具时,绘制图形的具体类型 */
shapeType?: ShapeType;
/** 多边形顶点数 */
vertices?:number;
/** 多边形向内顶点步长 */
innerVerticeStep?:number;
/** 多边形向内顶点与外顶点半径比率 */
innerRatio?: number;
/** 文字透明度 */
textOpacity?: number;
/** 文字背景颜色 */
textBgColor?: Color;
/** 文字背景颜色透明度 */
textBgOpacity?: number;
/** 位置 */
placement?: SpeechBalloonPlacement;
};
import { ExtendMemberState, ApplianceNames } from '@netless/appliance-plugin';
/** 设置教具状态 */
room.setMemberState({ ... } as ExtendMemberState);
manager.mainView.setMemberState({ ... } as ExtendMemberState);
appliance.setMemberState({ ... } as ExtendMemberState);
```

### 配置参数
Expand Down

0 comments on commit 8aa4b89

Please sign in to comment.