Skip to content

Commit 5501fe4

Browse files
committed
docs: update api.md
1 parent 050b991 commit 5501fe4

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

docs/zh/api.md

Lines changed: 89 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,86 @@ 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+
> 是否强制显示配置[`force_show_toolbar`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L16)
663+
664+
```ts
665+
ui.update({confog: {toolbar: {...}}, force_show_toolbar:...})
666+
```
667+
> 强制显示
668+
```ts
669+
ui.forceShowToolbar()
670+
```
671+
> 强制隐藏
672+
```ts
673+
ui.forceHideToolbar()
674+
```
675+
> 恢复默认
676+
```ts
677+
ui.recoverToolbar()
678+
```
679+
680+
### redoUndo
681+
682+
> 是否强制显示配置[`force_show_redo_undo`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L18C3-L18C23)
683+
684+
```ts
685+
ui.update({confog: {toolbar: {...}}, force_show_redo_undo:...})
686+
```
687+
> 强制显示
688+
```ts
689+
ui.forceShowRedoUndo()
690+
```
691+
> 强制隐藏
692+
```ts
693+
ui.forceHideRedoUndo()
694+
```
695+
> 恢复默认
696+
```ts
697+
ui.recoverRedoUndo()
698+
```
699+
700+
### zoom
701+
702+
> 是否强制显示配置[`force_show_zoom_control`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L20C3-L20C26)
703+
704+
```ts
705+
ui.update({confog: {toolbar: {...}}, force_show_zoom_control:...})
706+
```
707+
> 强制显示
708+
```ts
709+
ui.forceShowZoomControl()
710+
```
711+
> 强制隐藏
712+
```ts
713+
ui.forceHideZoomControl()
714+
```
715+
> 恢复默认
716+
```ts
717+
ui.recoverZoomControl()
718+
```
719+
720+
### page
721+
722+
> 是否强制显示配置[`force_show_page_control`](https://github.com/netless-io/fastboard/blob/050b991e6aa61034b06cf8f5a1ebd596e63381cf/packages/fastboard-ui/src/components/Fastboard/Fastboard.svelte.d.ts#L22C3-L22C26)
723+
724+
```ts
725+
ui.update({confog: {toolbar: {...}}, force_show_page_control:...})
726+
```
727+
> 强制显示
728+
```ts
729+
ui.forceShowPageControl()
730+
```
731+
> 强制隐藏
732+
```ts
733+
ui.forceHidePageControl()
734+
```
735+
> 恢复默认
736+
```ts
737+
ui.recoverPageControl()
738+
```

0 commit comments

Comments
 (0)