0.1.0 • Published 4 years ago
capacitor-apple-pencil v0.1.0
capacitor-apple-pencil
Enable Apple pencil features for capacitor
Install
npm install capacitor-apple-pencil
npx cap sync
Usage
Only support Capacitor 3+ IOS >= 12.1
import { ApplePencil } from 'capacitor-apple-pencil'
ApplePencil.registerApplePencilTap().then(res => {
if (res.register) {
ApplePencil.addListener('applePencilDidTap', (params: {action: UIPencilPreferredAction}) => {
console.log(params)
})
}
})
API
addListener(...)
addListener(...)
registerApplePencilTap()
unregisterApplePencilTap()
registerApplePencilDrawText()
unregisterApplePencilDrawText()
- Interfaces
- Enums
addListener(...)
addListener(eventName: 'applePencilDidTap', listenerFunc: (params: { action: UIPencilPreferredAction; }) => void) => any
Param | Type |
---|---|
eventName | "applePencilDidTap" |
listenerFunc | (params: { action: UIPencilPreferredAction; }) => void |
Returns: any
addListener(...)
addListener(eventName: 'applePencilDrawText', listenerFunc: (params: { text: string; }) => void) => any
Param | Type |
---|---|
eventName | "applePencilDrawText" |
listenerFunc | (params: { text: string; }) => void |
Returns: any
registerApplePencilTap()
registerApplePencilTap() => any
Returns: any
unregisterApplePencilTap()
unregisterApplePencilTap() => any
Returns: any
registerApplePencilDrawText()
registerApplePencilDrawText() => any
Returns: any
unregisterApplePencilDrawText()
unregisterApplePencilDrawText() => any
Returns: any
Interfaces
PluginListenerHandle
Prop | Type |
---|---|
remove | () => any |
Enums
UIPencilPreferredAction
Members | Value |
---|---|
Ignore | 0 |
SwitchEraser | 1 |
SwitchPrevious | 2 |
ShowColorPalette | 3 |