Skip to content

Commit 7dfd943

Browse files
committed
docs: update api.md
1 parent 050b991 commit 7dfd943

File tree

1 file changed

+90
-1
lines changed

1 file changed

+90
-1
lines changed

docs/zh/api.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [顶层方法](#top-level-functions)
66
- [`createFastboard`](#createfastboard)
7+
- [`createUI`](#createUI)
78
- [`replayFastboard`](#replayfastboard)
89
- [Fastboard 组件相关](#react-hooks)
910
- [`apps`](#apps)
@@ -35,6 +36,11 @@
3536
- [`sceneIndex`](#sceneindex)
3637
- [`sceneLength`](#scenelength)
3738
- [`appsStatus`](#appsstatus)
39+
- [FastboardApp UI组件相关API](#ui-methods)
40+
- [`toolbar`](#toolbar)
41+
- [`redoUndo`](#redoUndo)
42+
- [`zoom`](#zoom)
43+
- [`page`](#page)
3844

3945
<h2 id="top-level-functions">顶层方法</h2>
4046

@@ -82,7 +88,6 @@ ui.destroy();
8288
| ---- | ----------------------- | ---------------------------------- |
8389
| app | [required] FastboardApp | 从 createFastboard 获取的 app 对象 |
8490
| dom | [required] HTMLElement | 挂载的 DOM 元素 |
85-
| opts | [optional] MountOptions | UI 配置 |
8691

8792
```ts
8893
type MountOptions = {
@@ -648,3 +653,87 @@ type AppsStatus = {
648653
};
649654
};
650655
```
656+
657+
<h2 id="ui-methods">FastboardApp UI组件相关API</h2>
658+
659+
### toolbar
660+
661+
> 参数配置 [`ToolbarConfig`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/typings.ts#L39)
662+
>
663+
> 是否强制显示配置[`force_show_toolbar`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L16)
664+
665+
```ts
666+
ui.update({confog: {toolbar: {...}}, force_show_toolbar:...})
667+
```
668+
> 强制显示
669+
```ts
670+
ui.forceShowToolbar()
671+
```
672+
> 强制隐藏
673+
```ts
674+
ui.forceHideToolbar()
675+
```
676+
> 恢复默认
677+
```ts
678+
ui.recoverToolbar()
679+
```
680+
681+
### redoUndo
682+
683+
> 是否强制显示配置[`force_show_redo_undo`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L18C3-L18C23)
684+
685+
```ts
686+
ui.update({confog: {toolbar: {...}}, force_show_redo_undo:...})
687+
```
688+
> 强制显示
689+
```ts
690+
ui.forceShowRedoUndo()
691+
```
692+
> 强制隐藏
693+
```ts
694+
ui.forceHideRedoUndo()
695+
```
696+
> 恢复默认
697+
```ts
698+
ui.recoverRedoUndo()
699+
```
700+
701+
### zoom
702+
703+
> 是否强制显示配置[`force_show_zoom_control`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L20C3-L20C26)
704+
705+
```ts
706+
ui.update({confog: {toolbar: {...}}, force_show_zoom_control:...})
707+
```
708+
> 强制显示
709+
```ts
710+
ui.forceShowZoomControl()
711+
```
712+
> 强制隐藏
713+
```ts
714+
ui.forceHideZoomControl()
715+
```
716+
> 恢复默认
717+
```ts
718+
ui.recoverZoomControl()
719+
```
720+
721+
### page
722+
723+
> 是否强制显示配置[`force_show_page_control`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L22C3-L22C26)
724+
725+
```ts
726+
ui.update({confog: {toolbar: {...}}, force_show_page_control:...})
727+
```
728+
> 强制显示
729+
```ts
730+
ui.forceShowPageControl()
731+
```
732+
> 强制隐藏
733+
```ts
734+
ui.forceHidePageControl()
735+
```
736+
> 恢复默认
737+
```ts
738+
ui.recoverPageControl()
739+
```

0 commit comments

Comments
 (0)