@netless/window-manager 1.0.0-canary.9 → 1.0.1
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/LICENSE.txt +21 -0
- package/README.md +90 -64
- package/README.zh-cn.md +224 -0
- package/dist/index.d.ts +1133 -40
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +7954 -5445
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/docs/advanced.md +55 -55
- package/docs/api.md +126 -113
- package/docs/app-context.md +248 -209
- package/docs/basic.md +25 -26
- package/docs/camera.md +21 -21
- package/docs/cn/advanced.md +137 -0
- package/docs/cn/api.md +311 -0
- package/docs/cn/app-context.md +369 -0
- package/docs/cn/basic.md +64 -0
- package/docs/cn/camera.md +53 -0
- package/docs/cn/concept.md +9 -0
- package/docs/cn/custom-max-bar.md +31 -0
- package/docs/cn/develop-app.md +94 -0
- package/docs/cn/export-pdf.md +48 -0
- package/docs/cn/migrate.md +60 -0
- package/docs/cn/replay.md +40 -0
- package/docs/concept.md +6 -5
- package/docs/custom-max-bar.md +31 -0
- package/docs/develop-app.md +22 -19
- package/docs/export-pdf.md +48 -0
- package/docs/migrate.md +25 -27
- package/docs/quickstart.md +50 -0
- package/docs/replay.md +20 -20
- package/package.json +32 -22
- package/src/App/AppContext.ts +105 -73
- package/src/App/AppPageStateImpl.ts +6 -25
- package/src/App/AppProxy.ts +41 -166
- package/src/App/MagixEvent/index.ts +38 -38
- package/src/App/Storage/StorageEvent.ts +13 -13
- package/src/App/Storage/index.ts +269 -245
- package/src/App/Storage/typings.ts +4 -2
- package/src/App/Storage/utils.ts +3 -3
- package/src/App/index.ts +0 -1
- package/src/AppListener.ts +8 -8
- package/src/AppManager.ts +88 -77
- package/src/AttributesDelegate.ts +42 -22
- package/src/BoxEmitter.ts +12 -6
- package/src/BoxManager.ts +128 -108
- package/src/ContainerResizeObserver.ts +75 -0
- package/src/Cursor/Cursor.svelte +16 -5
- package/src/Cursor/Cursor.svelte.d.ts +21 -0
- package/src/Cursor/Cursor.ts +77 -13
- package/src/Cursor/icons.ts +6 -0
- package/src/Cursor/icons2.ts +66 -0
- package/src/Cursor/index.ts +127 -26
- package/src/Helper.ts +94 -14
- package/src/InternalEmitter.ts +2 -7
- package/src/Page/index.ts +1 -1
- package/src/PageState.ts +6 -5
- package/src/ReconnectRefresher.ts +9 -4
- package/src/RedoUndo.ts +3 -3
- package/src/Register/index.ts +22 -17
- package/src/Register/loader.ts +26 -22
- package/src/Register/storage.ts +13 -13
- package/src/Utils/Common.ts +18 -14
- package/src/Utils/Reactive.ts +26 -25
- package/src/Utils/RoomHacker.ts +4 -4
- package/src/Utils/error.ts +0 -1
- package/src/View/IframeBridge.ts +680 -0
- package/src/View/MainView.ts +127 -53
- package/src/callback.ts +21 -1
- package/src/constants.ts +0 -2
- package/src/image/pencil-eraser-1.svg +3 -0
- package/src/image/pencil-eraser-2.svg +3 -0
- package/src/image/pencil-eraser-3.svg +3 -0
- package/src/index.ts +220 -83
- package/src/style.css +27 -10
- package/src/typings.ts +20 -10
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -9
- package/CHANGELOG.md +0 -196
- package/__mocks__/white-web-sdk.ts +0 -50
- package/dist/App/AppContext.d.ts +0 -76
- package/dist/App/AppPageStateImpl.d.ts +0 -21
- package/dist/App/AppProxy.d.ts +0 -86
- package/dist/App/AppViewSync.d.ts +0 -11
- package/dist/App/MagixEvent/index.d.ts +0 -29
- package/dist/App/Storage/StorageEvent.d.ts +0 -8
- package/dist/App/Storage/index.d.ts +0 -39
- package/dist/App/Storage/typings.d.ts +0 -22
- package/dist/App/Storage/utils.d.ts +0 -5
- package/dist/App/WhiteboardView.d.ts +0 -22
- package/dist/App/index.d.ts +0 -3
- package/dist/AppListener.d.ts +0 -21
- package/dist/AppManager.d.ts +0 -107
- package/dist/AttributesDelegate.d.ts +0 -80
- package/dist/BoxEmitter.d.ts +0 -34
- package/dist/BoxManager.d.ts +0 -99
- package/dist/BuiltinApps.d.ts +0 -5
- package/dist/Cursor/Cursor.d.ts +0 -39
- package/dist/Cursor/icons.d.ts +0 -3
- package/dist/Cursor/index.d.ts +0 -46
- package/dist/Helper.d.ts +0 -17
- package/dist/InternalEmitter.d.ts +0 -39
- package/dist/Page/PageController.d.ts +0 -21
- package/dist/Page/index.d.ts +0 -3
- package/dist/PageState.d.ts +0 -9
- package/dist/ReconnectRefresher.d.ts +0 -24
- package/dist/RedoUndo.d.ts +0 -18
- package/dist/Register/index.d.ts +0 -28
- package/dist/Register/loader.d.ts +0 -4
- package/dist/Register/storage.d.ts +0 -8
- package/dist/Utils/AppCreateQueue.d.ts +0 -15
- package/dist/Utils/Common.d.ts +0 -23
- package/dist/Utils/Reactive.d.ts +0 -6
- package/dist/Utils/RoomHacker.d.ts +0 -3
- package/dist/Utils/error.d.ts +0 -27
- package/dist/Utils/log.d.ts +0 -1
- package/dist/View/CameraSynchronizer.d.ts +0 -16
- package/dist/View/MainView.d.ts +0 -47
- package/dist/View/ViewManager.d.ts +0 -13
- package/dist/callback.d.ts +0 -24
- package/dist/constants.d.ts +0 -49
- package/dist/index.cjs.js +0 -46
- package/dist/index.umd.js +0 -46
- package/dist/typings.d.ts +0 -82
- package/jest.config.js +0 -27
- package/pnpm-lock.yaml +0 -6302
- package/src/App/AppViewSync.ts +0 -68
- package/src/App/WhiteboardView.ts +0 -83
- package/src/View/CameraSynchronizer.ts +0 -56
- package/vite.config.js +0 -51
- /package/docs/{qickstart.md → cn/quickstart.md} +0 -0
package/docs/api.md
CHANGED
@@ -1,82 +1,85 @@
|
|
1
1
|
# API
|
2
2
|
|
3
|
-
##
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
3
|
+
## Table of contents
|
4
|
+
- [Static methods](#static-methods)
|
5
|
+
- [`mount`](#mount)
|
6
|
+
- [`register`](#register)
|
7
|
+
- [`registered`](#registered)
|
8
|
+
- [`setContainer`](#set-container)
|
9
|
+
- [`setCollectorContainer`](#set-collector-container)
|
10
|
+
- [instance methods](#instance-methods)
|
11
|
+
- [`addApp`](#addApp)
|
12
|
+
- [`closeApp`](#closeApp)
|
13
|
+
- [`focusApp`](#focusApp)
|
14
|
+
- [`setMainViewSceneIndex`](#setMainViewSceneIndex)
|
15
|
+
- [`setBoxState`](#setBoxState)
|
16
|
+
- [`cleanCurrentScene`](#cleanCurrentScene)
|
17
|
+
- [`redo`](#redo)
|
18
|
+
- [`undo`](#undo)
|
19
|
+
- [`copy`](#copy)
|
20
|
+
- [`paste`](#paste)
|
21
|
+
- [`delete`](#delete)
|
22
|
+
- [`duplicate`](#duplicate)
|
23
|
+
- [`insertText`](#insertText)
|
24
|
+
- [`insertImage`](#insertImage)
|
25
|
+
- [`completeImageUpload`](#completeImageUpload)
|
26
|
+
- [`lockImage`](#lockImage)
|
27
|
+
- [`lockImages`](#lockImages)
|
28
|
+
- [`nextPage`](#nextPage)
|
29
|
+
- [`prevPage`](#prevPage)
|
30
|
+
- [`addPage`](#addPage)
|
31
|
+
- [`removePage`](#removePage)
|
32
|
+
- [`refresh`](#refresh)
|
33
|
+
- [`setContainerSizeRatio`](#setContainerSizeRatio)
|
34
|
+
- [instance properties](#prototypes)
|
35
|
+
- [event callback](#events)
|
35
36
|
|
36
37
|
<br>
|
37
38
|
|
38
|
-
<h2 id="static-methods"
|
39
|
+
<h2 id="static-methods">Static methods</h2>
|
39
40
|
|
40
41
|
<h3 id="mount">WindowManager.mount</h3>
|
41
42
|
|
42
|
-
>
|
43
|
+
> mount WindowManager
|
43
44
|
|
44
45
|
```typescript
|
45
|
-
const manager = await WindowManager.mount(
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
const manager = await WindowManager. mount(
|
47
|
+
room: room,
|
48
|
+
container: document. getElementById("container")
|
49
|
+
// full configuration see below
|
49
50
|
);
|
50
51
|
```
|
51
52
|
|
52
|
-
|
53
|
+
parameter
|
54
|
+
|
53
55
|
|
54
56
|
| name | type | default | desc |
|
55
57
|
| ---------------------- | --------------------------------------- | ------- | ---------------------------- |
|
56
|
-
| room | [require] Room | |
|
57
|
-
| container | [require] HTMLElement | |
|
58
|
-
| containerSizeRatio | [optional] number | 9 / 16 |
|
59
|
-
| chessboard | [optional] boolean | true |
|
60
|
-
| collectorContainer | [optional] HTMLElement | |
|
61
|
-
| collectorStyles | [optional] Partial{CSSStyleDeclaration} | |
|
62
|
-
| overwriteStyles | [optional] string | |
|
63
|
-
| cursor | [optional] boolean | false |
|
64
|
-
| disableCameraTransform | [optional] boolean | |
|
58
|
+
| room | [require] Room | | room instance |
|
59
|
+
| container | [require] HTMLElement | | room mount container |
|
60
|
+
| containerSizeRatio | [optional] number | 9 / 16 | The aspect ratio of the multi-window area, the default is 9 : 16 |
|
61
|
+
| chessboard | [optional] boolean | true | The space outside the multi-window area displays PS checkerboard background, default true |
|
62
|
+
| collectorContainer | [optional] HTMLElement | | dom for multi-window minimize icon mount |
|
63
|
+
| collectorStyles | [optional] Partial{CSSStyleDeclaration} | | Configure collector style |
|
64
|
+
| overwriteStyles | [optional] string | | The style to use for the overlay window |
|
65
|
+
| cursor | [optional] boolean | false | Turn on cursor sync |
|
66
|
+
| disableCameraTransform | [optional] boolean | | Disable camera movement for the main whiteboard |
|
65
67
|
| prefersColorScheme | [optional] string | light | auto, light, dark |
|
66
|
-
| debug | [optional] boolean | false |
|
67
|
-
| applianceIcons | [optional] {ApplianceNames, string} | |
|
68
|
+
| debug | [optional] boolean | false | print log information |
|
69
|
+
| applianceIcons | [optional] {ApplianceNames, string} | | Configure the teaching aid picture used by the cursor |
|
70
|
+
|
68
71
|
|
69
|
-
<h3 id="register">WindowManager.register</h3>
|
72
|
+
<h3 id="register">WindowManager. register</h3>
|
70
73
|
|
71
|
-
>
|
74
|
+
> Register `APP` to `WindowManager`
|
72
75
|
|
73
76
|
```typescript
|
74
|
-
WindowManager.register({
|
75
|
-
kind: "
|
77
|
+
WindowManager. register({
|
78
|
+
kind: "hello World",
|
76
79
|
src: NetlessApp,
|
77
80
|
appOptions: () => "appOptions",
|
78
81
|
addHooks: (emitter) => {
|
79
|
-
|
82
|
+
emitter.on("created", result => {
|
80
83
|
console.log("HelloWordResult", result);
|
81
84
|
});
|
82
85
|
emitter.on("focus", result => {
|
@@ -93,7 +96,7 @@ WindowManager.register({
|
|
93
96
|
|
94
97
|
<h3 id="registered">WindowManager.registered</h3>
|
95
98
|
|
96
|
-
>
|
99
|
+
> Get the registered `App`
|
97
100
|
|
98
101
|
```ts
|
99
102
|
WindowManager.registered
|
@@ -103,7 +106,7 @@ WindowManager.registered
|
|
103
106
|
|
104
107
|
<h3 id="set-container">setContainer</h3>
|
105
108
|
|
106
|
-
>
|
109
|
+
> Set whiteboard mount container
|
107
110
|
|
108
111
|
```typescript
|
109
112
|
WindowManager.setContainer(document.getElementById("container"));
|
@@ -111,7 +114,7 @@ WindowManager.setContainer(document.getElementById("container"));
|
|
111
114
|
|
112
115
|
<h3 id="set-container">setCollectorContainer</h3>
|
113
116
|
|
114
|
-
>
|
117
|
+
> Set container mounted by `Collector`
|
115
118
|
|
116
119
|
```typescript
|
117
120
|
WindowManager.setCollectorContainer(document.getElementById("collector-container"));
|
@@ -119,33 +122,41 @@ WindowManager.setCollectorContainer(document.getElementById("collector-container
|
|
119
122
|
|
120
123
|
<br>
|
121
124
|
|
122
|
-
<h2 id="instance-methods"
|
125
|
+
<h2 id="instance-methods">Instance methods</h2>
|
123
126
|
|
124
127
|
<h3 id="addApp">addApp</h3>
|
125
128
|
|
126
|
-
>
|
129
|
+
> add `app` to whiteboard
|
127
130
|
|
128
131
|
```typescript
|
129
132
|
const appId = await manager.addApp({
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
133
|
+
kind: "hello World"
|
134
|
+
options: { // optional configuration
|
135
|
+
scenePath: "/hello-world"
|
136
|
+
}
|
134
137
|
})
|
135
138
|
```
|
136
|
-
|
139
|
+
For specific parameters, please refer to the requirements of `APP` itself
|
137
140
|
|
138
141
|
<h3 id="closeApp">closeApp</h3>
|
139
142
|
|
140
|
-
>
|
143
|
+
> Close any open `APP`
|
141
144
|
|
142
145
|
```typescript
|
143
146
|
manager.closeApp(appId)
|
144
147
|
```
|
145
148
|
|
149
|
+
<h3 id="focusApp">focusApp</h3>
|
150
|
+
|
151
|
+
> Switch the `app` of the current `focus`, and set this `app` to the front
|
152
|
+
|
153
|
+
```typescript
|
154
|
+
manager.focusApp(appId)
|
155
|
+
```
|
156
|
+
|
146
157
|
<h3 id="setMainViewSceneIndex">setMainViewSceneIndex</h3>
|
147
158
|
|
148
|
-
>
|
159
|
+
> Set the `SceneIndex` of the main whiteboard
|
149
160
|
|
150
161
|
```ts
|
151
162
|
manager.setMainViewSceneIndex(1)
|
@@ -153,7 +164,7 @@ manager.setMainViewSceneIndex(1)
|
|
153
164
|
|
154
165
|
<h3 id="setBoxState">setBoxState</h3>
|
155
166
|
|
156
|
-
>
|
167
|
+
> Set the current `boxState`
|
157
168
|
|
158
169
|
```ts
|
159
170
|
manager.setBoxState("normal") // boxState: normal | maximized | minimized
|
@@ -161,7 +172,7 @@ manager.setBoxState("normal") // boxState: normal | maximized | minimized
|
|
161
172
|
|
162
173
|
<h3 id="cleanCurrentScene">cleanCurrentScene</h3>
|
163
174
|
|
164
|
-
>
|
175
|
+
> Clear the handwriting of the currently focused view
|
165
176
|
|
166
177
|
```ts
|
167
178
|
manager.cleanCurrentScene()
|
@@ -169,7 +180,7 @@ manager.cleanCurrentScene()
|
|
169
180
|
|
170
181
|
<h3 id="redo">redo</h3>
|
171
182
|
|
172
|
-
>
|
183
|
+
> Redo the last operation on the currently focused view
|
173
184
|
|
174
185
|
```ts
|
175
186
|
manager.redo()
|
@@ -177,7 +188,7 @@ manager.redo()
|
|
177
188
|
|
178
189
|
<h3 id="undo">undo</h3>
|
179
190
|
|
180
|
-
>
|
191
|
+
> Undo the last action on the currently focused view
|
181
192
|
|
182
193
|
```ts
|
183
194
|
manager.undo()
|
@@ -185,49 +196,49 @@ manager.undo()
|
|
185
196
|
|
186
197
|
<h3 id="nextPage">nextPage</h3>
|
187
198
|
|
188
|
-
>
|
199
|
+
> Switch main whiteboard to next page
|
189
200
|
|
190
201
|
```ts
|
191
202
|
const success = await manager.nextPage()
|
192
203
|
if (!success) {
|
193
|
-
|
204
|
+
// reached the last page
|
194
205
|
}
|
195
206
|
```
|
196
207
|
|
197
208
|
<h3 id="prevPage">prevPage</h3>
|
198
209
|
|
199
|
-
>
|
210
|
+
> Switch main whiteboard to previous page
|
200
211
|
|
201
212
|
```ts
|
202
213
|
const success = await manager.prevPage()
|
203
214
|
if (!success) {
|
204
|
-
|
215
|
+
// have reached the first page
|
205
216
|
}
|
206
217
|
```
|
207
218
|
|
208
219
|
<h3 id="addPage">addPage</h3>
|
209
220
|
|
210
|
-
>
|
221
|
+
> Add a page to the main whiteboard
|
211
222
|
|
212
223
|
```ts
|
213
|
-
manager.addPage() //
|
214
|
-
manager.addPage({ after: true }) //
|
215
|
-
manager.addPage({ scene: { name: "page2" } }) //
|
224
|
+
manager.addPage() // add a page at the end by default
|
225
|
+
manager.addPage({ after: true }) // add a page after the current page
|
226
|
+
manager.addPage({ scene: { name: "page2" } }) // pass in page information
|
216
227
|
```
|
217
228
|
|
218
229
|
<h3 id="removePage">removePage</h3>
|
219
230
|
|
220
|
-
>
|
221
|
-
>
|
231
|
+
> remove a page
|
232
|
+
> When there is only one page left, the last page is not allowed to be deleted
|
222
233
|
|
223
234
|
```ts
|
224
|
-
const success = await manager.removePage() //
|
225
|
-
const success = await manager.removePage(1) //
|
235
|
+
const success = await manager.removePage() // delete the current page by default
|
236
|
+
const success = await manager.removePage(1) // can delete the specified index
|
226
237
|
```
|
227
238
|
|
228
239
|
<h3 id="refresh">refresh</h3>
|
229
240
|
|
230
|
-
>
|
241
|
+
> Refreshes `manager` internal state for `copy` `attributes` from other rooms
|
231
242
|
|
232
243
|
```ts
|
233
244
|
manager.refresh()
|
@@ -235,7 +246,7 @@ manager.refresh()
|
|
235
246
|
|
236
247
|
<h3 id="setContainerSizeRatio">setContainerSizeRatio</h3>
|
237
248
|
|
238
|
-
>
|
249
|
+
> Set the aspect ratio of the whiteboard synchronization area
|
239
250
|
|
240
251
|
```ts
|
241
252
|
manager.setContainerSizeRatio(10 / 16)
|
@@ -243,28 +254,28 @@ manager.setContainerSizeRatio(10 / 16)
|
|
243
254
|
|
244
255
|
<br>
|
245
256
|
|
246
|
-
<h2 id="prototypes"
|
257
|
+
<h2 id="prototypes">Instance attributes</h2>
|
247
258
|
|
248
259
|
| name | type | default | desc |
|
249
260
|
| ------------------ | ------- | ------- | ----------------- |
|
250
|
-
| mainView | View | |
|
251
|
-
| mainViewSceneIndex | number | |
|
252
|
-
| mainViewScenesLength | number | | mainView
|
253
|
-
| boxState | string | |
|
254
|
-
| darkMode | boolean | |
|
255
|
-
| prefersColorScheme | string | |
|
256
|
-
| focused | string | | focus
|
257
|
-
| canRedoSteps | number | |
|
258
|
-
| canRedoSteps | number | |
|
259
|
-
| sceneState | SceneState | |
|
260
|
-
| pageState | PageState | |
|
261
|
+
| mainView | View | | main whiteboard |
|
262
|
+
| mainViewSceneIndex | number | | The SceneIndex of the current main whiteboard |
|
263
|
+
| mainViewScenesLength | number | | mainView's scenes length |
|
264
|
+
| boxState | string | | current window status |
|
265
|
+
| darkMode | boolean | | dark mode |
|
266
|
+
| prefersColorScheme | string | | color theme |
|
267
|
+
| focused | string | | focus app |
|
268
|
+
| canRedoSteps | number | | The number of steps that the currently focused view can redo |
|
269
|
+
| canRedoSteps | number | | The number of steps that the currently focused view can undo |
|
270
|
+
| sceneState | SceneState | | Compatible with the sceneState property of the original SDK, only valid for mainView |
|
271
|
+
| pageState | PageState | | Combine the index and scenes modification of mainView |
|
261
272
|
|
262
273
|
<br>
|
263
274
|
|
264
|
-
<h2 id="events"
|
275
|
+
<h2 id="events">event callback</h2>
|
265
276
|
|
266
277
|
```typescript
|
267
|
-
manager.
|
278
|
+
manager.emitter.on(events, listener)
|
268
279
|
```
|
269
280
|
|
270
281
|
| name | type | default | desc |
|
@@ -275,26 +286,28 @@ manager.callbacks.on(events, listener)
|
|
275
286
|
| darkModeChange | boolean | | |
|
276
287
|
| prefersColorSchemeChange | string | | auto,light,dark |
|
277
288
|
| cameraStateChange | CameraState | | |
|
278
|
-
| focusedChange | string, undefined | |
|
279
|
-
| mainViewScenesLengthChange | number | | mainView scenes
|
280
|
-
| canRedoStepsChange | number | |
|
281
|
-
| canUndoStepsChange | number | |
|
282
|
-
| loadApp | LoadAppEvent | |
|
283
|
-
| ready | undefined | |
|
284
|
-
| sceneStateChange | SceneState | |
|
285
|
-
| pageStateChange | PageState | |
|
289
|
+
| focusedChange | string, undefined | | The appId of the current focus, undefined for the main whiteboard |
|
290
|
+
| mainViewScenesLengthChange | number | | fires when mainView scenes are added or removed |
|
291
|
+
| canRedoStepsChange | number | | The view of the current focus can redo the number of steps to change |
|
292
|
+
| canUndoStepsChange | number | | The current focus view can undo the step change |
|
293
|
+
| loadApp | LoadAppEvent | | Load remote APP event |
|
294
|
+
| ready | undefined | | Triggered when all apps are created |
|
295
|
+
| sceneStateChange | SceneState | | Fired when sceneState is modified |
|
296
|
+
| pageStateChange | PageState | | |
|
297
|
+
| fullscreenChange | boolean | | Triggered when the full-screen status changes |
|
298
|
+
| appsChange | string[] | | Triggered when the list of opened apps changes |
|
286
299
|
|
287
300
|
```ts
|
288
301
|
type LoadAppEvent = {
|
289
|
-
|
290
|
-
|
291
|
-
|
302
|
+
kind: string;
|
303
|
+
status: "start" | "success" | "failed";
|
304
|
+
reason?: string;
|
292
305
|
}
|
293
306
|
```
|
294
307
|
|
295
308
|
```ts
|
296
309
|
type PageState = {
|
297
|
-
|
298
|
-
|
310
|
+
index: number;
|
311
|
+
length: number;
|
299
312
|
}
|
300
|
-
```
|
313
|
+
```
|