Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet Plugins #58

Open
kingsword09 opened this issue Dec 14, 2022 · 2 comments
Open

Wallet Plugins #58

kingsword09 opened this issue Dec 14, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@kingsword09
Copy link
Contributor

kingsword09 commented Dec 14, 2022

Wallet Plugins

目前实现使用的Capacitor Plugins
带问号?的参数为可选参数

app

- exitApp(android only)
    描述: 退出应用
    参数: 无
    返回: void

- getBackButtonEvt (android only)
    描述: 监听物理后退按钮 https://github.com/ionic-team/capacitor-plugins/blob/main/app/src/definitions.ts#L266
    参数: 无
    返回: boolean

barcode-scanner

- prepare (unrealized)
    描述: 准备扫描
    参数: 2 
        描述文本类型: https://github.com/capacitor-community/barcode-scanner/blob/main/src/definitions.ts#L24
        摄像头位置:   https://github.com/capacitor-community/barcode-scanner/blob/main/src/definitions.ts#L94
    返回: void

- startScan
    描述: 开始扫描
    参数: 2 
        描述文本类型: https://github.com/capacitor-community/barcode-scanner/blob/main/src/definitions.ts#L24
        摄像头位置:   https://github.com/capacitor-community/barcode-scanner/blob/main/src/definitions.ts#L94
    返回: string | undefined

- pauseScanning(unrealized)
    描述: 暂停扫描
    参数: 无
    返回: void

- resumeScanning (unrealized)
    描述: 恢复扫描
    参数: 无
    返回: void

- stopScan
    描述: 停止扫描
    参数: 1
        是否强制停止扫描?:boolean
    返回: void

- checkCameraPermission
    描述: 检查是否有摄像头权限,如果没有或者被拒绝,那么会强制请求打开权限(设置)
    参数: 2
        是否强制检查?: boolean
        打开权限设置前的操作?:function
    返回: boolean 

- toggleTorch
    描述: 打开/关闭手电筒
    参数: 无
    返回: void

- getTorchState
    描述: 手电筒状态
    参数: 无
    返回: boolean

- hideBackground (unrealized)
    描述: 隐藏webview背景
    参数: 无
    返回: void

- showBackground (unrealized)
    描述: 显示webview背景
    参数: 无
    返回: void

browser

- open
    描述: 根据指定参数打开一个页面
    参数: 1
        指定option: https://github.com/ionic-team/capacitor-plugins/blob/c884c38cb2d24105e4667e32ffb6bbe59c97b9b4/browser/src/definitions.ts#L56
    返回: void

camera

- takePhoto
    描述: 拍摄照片
    参数: 1
        相片选项: https://github.com/ionic-team/capacitor-plugins/tree/main/camera
            重点关注参数:quality、resultType、saveToGallery、direction
    返回: photo: https://github.com/ionic-team/capacitor-plugins/blob/main/camera/src/definitions.ts#L185

- pickPhoto
    描述: 从图库选取单张相片
    参数: 1
        图片质量: number
    返回: photo

- pickPhotos
    描述: 从图库选取多张相片
    参数: 1
        图片质量: number
    返回: GalleryPhotos: https://github.com/ionic-team/capacitor-plugins/blob/main/camera/src/definitions.ts#L185

clipboard

- readText
    描述: 读取剪切板文本
    参数: 无
    返回: string | undefined

- writeText
    描述: 写入剪切板文本
    参数: 1
        文本内容: string
    返回: void

filesystem

- checkPermissions
    描述: 检查权限
    参数: 无
    返回: PermissionStatus: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L3

- requestPermissions (android only)
    描述: 请求权限
    参数: 无
    返回: PermissionStatus

- checkAndRequestPermissions (android only)
    描述: 检查并请求文件系统权限
    参数: 无
    返回: boolean

- readPhotoFile
    描述: 读取相片
    参数: 2
        路径?: string
        文件目录?: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L7
    返回: ReadFileResult: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L350

- readDocumentFile
    描述: 读取文件
    参数: 1
        options: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L105
    返回: ReadFileResult

- writePhotoFile
    描述: 保存相片
    参数: 4
        图片数据?: stirng
        路径?: string
        文件目录?: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L7
        是否检查权限?: boolean
- 增加option 参数, enum = {local = "local",system="system"}

- writeDocumentFile
    描述: 写入文件
    参数: 2
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L105
        是否检查权限: boolean
    返回: WriteFileResult(https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L105) | undefined

- deleteFile
    描述: 删除文件
    参数: 2
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L105
        是否检查权限: boolean
    返回: WriteFileResult | undefined

- appendDocumentFile
    描述: 追加文件数据
    参数: 1
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L105
    返回: void

- stat
    描述: 获取文件信息
    参数: 1
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L301
    返回: StatResult: https://github.com/ionic-team/capacitor-plugins/blob/main/filesystem/src/definitions.ts#L429

haptics

- impactLight
    描述: 触碰轻质量物体
    参数: 无
    返回: void

- notificationWarning
    描述: 警告分隔的振动通知
    参数: 无
    返回: void

- vibrateClick 
    描述: 单击手势的反馈振动
    参数: 无
    返回: void

- vibrateDisabled
    描述: 禁用手势的反馈振动,与headShak特效一致
    参数: 无
    返回: void

- vibrateDoubleClick
    描述: 双击手势的反馈振动
    参数: 无
    返回: void

- vibrateHeavyClick
    描述: 重击手势的反馈振动,比如菜单键/长按/3DTouch
    参数: 无
    返回: void

- vibrateTick
    描述: 滴答
    参数: 无
    返回: void

keyboard

- getKeyboardInfo$ 
    描述: 键盘信息监听集合
    参数: 无
    返回: KeyboardInfo
        {
            status: KEYWORD_STATUS,
            height: number
        }
        
        enum KEYWORD_STATUS {
            WILL_SHOW,
            DID_SHOW,
            WILL_HIDE,
            DID_HIDE
        }


- show (android only)
    描述: 显示键盘
    参数: 无
    返回: void

- hide 
    描述: 隐藏键盘
    参数: 无
    返回: void

network

- getNetworkStatus$
    描述: 获取网络状态变化的管理器
    参数: 无
    返回: 
        {
            online: boolean,
            connectionType: "wifi" | "cellular" | "none" | "unknown"
        }

safe-area

- getSafeAreaInsets
    描述: 获取env-safe-area-insets
    参数: 无
    返回: SafeArea: https://github.com/AlwaysLoveme/capacitor-plugin-safe-area/blob/main/src/definitions.ts#L6

share

- share
    描述: 分享
    参数: 1
        shareOption: 
            参考: https://github.com/ionic-team/capacitor-plugins/blob/main/share/src/definitions.ts#L1
            比上面链接参数多一个 imageData?: string 属性 
    返回: ShareResult: https://github.com/ionic-team/capacitor-plugins/blob/main/share/src/definitions.ts#L1

status-bar

- setBackgroundColor
    描述: 设置状态栏背景色
    参数: 4
        r: number (0~255)
        g: number (0~255)
        b: number (0~255)
        a: number (0~1)
    返回: void

- setStyle
    描述: 设置状态栏风格
    参数: 1
        style: https://github.com/ionic-team/capacitor-plugins/blob/main/status-bar/src/definitions.ts#L10
    返回: void

- getStyle
    描述: 获取状态栏风格
    参数: 无
    返回: style

- setOverlaysWebView
    描述: 设置状态栏是否覆盖webview
    参数: 1
        overlay: boolean
    返回: void
@kingsword09 kingsword09 added the documentation Improvements or additions to documentation label Dec 14, 2022
@kingsword09
Copy link
Contributor Author

新增plugins

file-opener

- open
    描述: 打开文件
    参数: 1
        文件路径: string
    返回: void

splash-screen

- show
    描述: 显示启动页
    参数: 1
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/splash-screen/src/definitions.ts#L170
    返回: void

- hide
    描述: 隐藏启动页
    参数: 1
        参数信息: https://github.com/ionic-team/capacitor-plugins/blob/main/splash-screen/src/definitions.ts#L200
    返回: void

toast

- show
    描述: toast信息显示
    参数: 2
        消息: string
        时长: "long" | "short"
    返回: void

@kingsword09
Copy link
Contributor Author

navigation-bar

基于下面两个导出得到的三个方法
NavigationBar
NavigationBarPluginEvents

- getNavigationBarColorChange$
    描述: 获取导航栏背景色变化管理器
    参数: 无
    返回: string

- getNavigationBarColor
    描述: 获取当前导航栏背景色
    参数: 无
    返回: string

- setNavigationBarColor
    描述: 设置导航栏背景色透明(或者恢复原本背景色)
    参数: 1
        背景色: string
    返回: void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants