docs: support document internationalization #222
* docs: add English docuemnt #213 * docs: support document internationalization #222 --------- Co-authored-by: Hufe921 <huangyunfeihufe@hotmail.com>
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
# Event Listening(eventBus)
|
||||
|
||||
## How to Use
|
||||
|
||||
```javascript
|
||||
import Editor from "@hufe921/canvas-editor"
|
||||
|
||||
const instance = new Editor(container, <IElement[]>data, options)
|
||||
|
||||
// register
|
||||
instance.eventBus.on<K keyof EventMap>(
|
||||
eventName: K,
|
||||
callback: EventMap[K]
|
||||
)
|
||||
|
||||
// remove
|
||||
instance.eventBus.off<K keyof EventMap>(
|
||||
eventName: K,
|
||||
callback: EventMap[K]
|
||||
)
|
||||
```
|
||||
|
||||
## rangeStyleChange
|
||||
|
||||
Feature: The selection style changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('rangeStyleChange', (payload: IRangeStyle) => void)
|
||||
```
|
||||
|
||||
## visiblePageNoListChange
|
||||
|
||||
Feature: The visible page changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('visiblePageNoListChange', (payload: number[]) => void)
|
||||
```
|
||||
|
||||
## intersectionPageNoChange
|
||||
|
||||
Feature: The current page changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('intersectionPageNoChange', (payload: number) => void)
|
||||
```
|
||||
|
||||
## pageSizeChange
|
||||
|
||||
Feature: The current number of pages has changed
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('pageSizeChange', (payload: number) => void)
|
||||
```
|
||||
|
||||
## pageScaleChange
|
||||
|
||||
Feature: The current page scaling has changed
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('pageScaleChange', (payload: number) => void)
|
||||
```
|
||||
|
||||
## contentChange
|
||||
|
||||
Feature: The current content has changed
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('contentChange', () => void)
|
||||
```
|
||||
|
||||
## controlChange
|
||||
|
||||
Feature: The control where the current cursor is located changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('controlChange', (payload: IControl | null) => void)
|
||||
```
|
||||
|
||||
## pageModeChange
|
||||
|
||||
Feature: The page mode changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('pageModeChange', (payload: PageMode) => void)
|
||||
```
|
||||
|
||||
## saved
|
||||
|
||||
Feature: Document saved
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('saved', (payload: IEditorResult) => void)
|
||||
```
|
||||
|
||||
## zoneChange
|
||||
|
||||
Feature: The zone changes
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.eventBus.on('zoneChange', (payload: EditorZone) => void)
|
||||
```
|
||||
Reference in New Issue
Block a user