npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

light-sdk

v3.0.8

Published

> light-sdk 用于开发者开发 LightApp 时调用原生 API,实现与原生系统的交互。

Downloads

90

Readme

light-sdk 用于开发者开发 LightApp 时调用原生 API,实现与原生系统的交互。

安装

对 lib 目录下的 package.json 文件进行设置,引入依赖:

{
  "dependencies": {
    "light-sdk": "*"
  }
}

然后在 lib 目录下执行 npm install 完成安装。

npm install 

使用

在需要使用 light-sdk 的 js 或者 vue 文件中调用:

import LightSDK from "light-sdk";
//获取客户端基本信息
LightSDK.native.getSystemInfo(null,function(res){
    console.log(res);
});

文档

了解更多 light-sdk 模块的信息,请点击这里

native 接口

|功能描述| 调用方式| |--|--| |通过js添加导航栏按钮,目前允许在左右两边各加一个扩展按钮|LightSDK.native.addButton(params, cb)| |通过js调用web返回事件|LightSDK.native.back(params, cb)| |打开外部链接 ( 如电话,邮箱,短信 )|LightSDK.native.openURL(params,cb)| |通过js调用关闭web页面|LightSDK.native.close()| |通过js接口在网页中删除存储在native的属性|LightSDK.native.deleteData(params, cb)| |文件预览|LightSDK.native.filePreview(params,cb)| |文件保存|LightSDK.native.fileSave(params,cb)| |返回指定字符串的二维码编码结果的base64编码字符串|LightSDK.native.genCode(params, cb)| |获取剪切板信息|LightSDK.native.getClipBoardContent(params, cb)| |通过网页js手机通讯录|LightSDK.native.getContactInfo(params, cb)| |通过js接口获得当前框架页面堆栈信息|LightSDK.native.getCurrentPages({},cb)| |获取定位状态|LightSDK.native.getLocation(params, cb)| |获取当前是否可获取定位状态|LightSDK.native.getLocationStatus(params, cb)| |通过js接口获取当前网络状态|LightSDK.native.getNetworkStatus(params, cb)| |获取RegistrationID|LightSDK.native.pushGetRegistrationID(params, cb)| |通过js接口获取APP状态栏高度|LightSDK.native.getStatusBarHeight({},cb)| |通过网页js获取客户端基本信息|LightSDK.native.getSystemInfo(params, cb)| |获取设备唯一标识码|LightSDK.native.getUDID(params, cb)| |获取客户端版本号|LightSDK.native.getVersion(null,cb)| |设置导航栏透明度|LightSDK.native.headSetAlpha(params,cb)| |通过JS调起苹果内购接口(只适用于iOS)|LightSDK.native.iapPurchase(params,cb)| |图片预览功能|LightSDK.native.imagePreview(params,cb)| |通过js接口获取日志信息|LightSDK.native.log(params,cb)| |获取是否含有手势或指纹验证信息|LightSDK.native.preVerifyOperation(params,cb)| |通过JS获取推送消息|LightSDK.native.pushAddEventListener(null,cb)| |当前用户添加标签|LightSDK.native.pushAddTags(params,cb)| |当前用户删除标签|LightSDK.native.pushDeleteTags(params,cb)| |获取当前用户的所有标签|LightSDK.native.pushGetTags(params,cb)| |向客户端传递推送alias|LightSDK.native.pushSetAlias(params,cb)| |js接口在网页中查询存储在native的属性|LightSDK.native.readData(params, cb)| |通过js删除已添加的导航栏按钮|LightSDK.native.removeButton(params, cb)| |关闭安全键盘|LightSDK.native.safekeyboardHide(null,cb)| |展现安全键盘|LightSDK.native.safekeyboardShow(null,cb)| |通过js对web页或JSNative页面上的图片进行本地化处理,保存至本地相册|LightSDK.native.saveImage(params,cb)| |通过js接口打开本地二维码扫描页面,扫码成功后在网页中返回扫码结果信息|LightSDK.native.scanCode(params, cb)| |通过js修改导航栏背景色|LightSDK.native.setBackgroundColor(params, cb)| |通过js接口在web或者JSNative页面中复制内容到剪贴板|LightSDK.native.setClipBoardContent(params, cb)| |设置导航栏上下标题样式|LightSDK.native.setSubtitle(params,cb)| |设置屏幕方向|LightSDK.native.setScreenOrientation(params, cb)| |设置屏幕可旋转方向|LightSDK.native.setSupportScreenOrientation(params, cb)| |通过js控制是否隐藏状态栏|LightSDK.native.setSystemStatusBar(params, cb)| |设置标题栏标题接口|LightSDK.native.setTitle(params, cb)| |设置首页tab小红点|LightSDK.native.setTabBarBadge(params, cb)| |通过js判断各个平台app在设备上是否已安装|LightSDK.native.socialAppInstalled(params, cb)| |通过js分享内容到各平台|LightSDK.native.socialShare(params, cb)| |通过js登录到各平台|LightSDK.native.socialLogin(params,cb)| |开始音频采集|LightSDK.native.startRecord(cb, maxTime)| |结束音频采集|LightSDK.native.stopRecord()| |关闭定位服务|LightSDK.native.stopLocation(params,cb)| |用于实现网络请求|LightSDK.native.streamFetch(params,cb)| |通过js接口在网页或JsNative页面中切换底部tab|LightSDK.native.switchTab(params, cb)| |关闭交易键盘|LightSDK.native.tradekeyboardHide(params,cb)| |展现交易键盘|LightSDK.native.tradekeyboardShow(params,cb)| |通过js传入经服务器加签后的订单信息(orderInfo)并调用相应支付渠道SDK的支付接口|LightSDK.native.tradePay(params,cb)| |通过js登录用户|LightSDK.native.userLogin(params,cb)| |通过JS获取登录用户信息|LightSDK.native.userGetInfo(null,cb)| |通过js设置登录用户信息|LightSDK.native.userSetInfo(params,cb)| |通过JS退出用户登录|LightSDK.native.userlogout(cb)| |用手势或指纹验证|LightSDK.native.verifyOperation(params,cb)| |通过js接口在网页中向native保存数据|LightSDK.native.writeData(params, cb)|

使用 lightview 扫描调试 LightSDK 接口的方法:

  1. 将 lightview 和电脑连接到同一网络,可以通过猎豹 wifi 助手等工具在电脑上开启 wifi,手机连接此 wifi;
  2. lightview 扫描电脑本地的开发地址,本地的开发地址必须以当前虚拟 wifi 的 ip 为准
  3. lightview 开启调试按钮,扫描电脑的本地地址后打开点击右上角菜单,并点击调试会自动跳转到具有native接口执行特性的webview然后就可以直接进行调试了,此时就是真实的运行环境。

更新记录

v2.0.9

  1. #S2103310071 新增接口image.compress图片压缩
  2. #S2103310098 新增接口image.getImageInfo获取图片信息
  3. #S2103310073 新增接口video.choose视频选择
  4. #S2103310072 新增接口video.compress视频压缩

v1.0.69

  1. #193223 新增SDK接口getNotificationStatus:获取app通知是否开启

v1.0.68

  1. #193223 新增SDK接口setStatusBarStyle:修改导航栏样式、是否隐藏状态栏、修改状态栏字体样式

v1.0.63

  1. #177531 light-sdk 将mock接口的功能分离,不要和原有功能产生耦合

v1.0.62

  1. #173009 lightsdk储取数据的时候保持存取的数据格式不变,可以存储string、object、Array、bool、number类型的数据

v1.0.61

  1. #170271 light-sdk新增接口overlay.show

v1.0.60

  1. #166257 新增sdk接口res.getBase64
  2. #165453 sdk接口新增image.picker

v1.0.59

  1. #160221 light-sdk 编译light4g是引起构建流程异常的问题处理
  2. light-sdk接口在最新版本[email protected]环境下使用可支持在.js文件中调用,升级light-sdk时建议同时升级最新版本[email protected]

v1.0.58

  1. #153919 light-sdk rpc.cal接口去掉deviceready事件依赖
  2. #158889 sdk接口在mounted中调用不影响应用级事件的正常使用

v1.0.57

  1. #153919 light-sdk rpc.cal接口去掉deviceready事件依赖

v1.0.56

  1. #151819 light-sdk去除deviceready事件依赖以支持在异步视图和js文件中也能调用

v1.0.55

  1. #148807 light sdk的addButoon等头部操作接口在jsn环境下调用head模块

v1.0.54

  1. #147343,#147347,#147353,#147355 新增日历管理接口,包括日历的增删改查
  2. #144137 LightSDK.native.setSystemStatusBar,hidden设置为null,调用接口ios会闪退问题修复

v1.0.53

  1. #142515 控制导航栏按钮红点是否隐藏接口新增 LightSDK.native.showNativeBadge

v1.0.49

  1. scanCode增加了params入参,回调调整为第二个参数
  2. 将writeGlobalData,readGlobalData调整为过期
  3. 新增交易键盘、图片预览、文件预览接口