0.1.0 • Published 4 years ago

capacitor-apple-pencil v0.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

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(eventName: 'applePencilDidTap', listenerFunc: (params: { action: UIPencilPreferredAction; }) => void) => any
ParamType
eventName"applePencilDidTap"
listenerFunc(params: { action: UIPencilPreferredAction; }) => void

Returns: any


addListener(...)

addListener(eventName: 'applePencilDrawText', listenerFunc: (params: { text: string; }) => void) => any
ParamType
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

PropType
remove() => any

Enums

UIPencilPreferredAction

MembersValue
Ignore0
SwitchEraser1
SwitchPrevious2
ShowColorPalette3