declare namespace UniApp { interface ks { /** * 登录 * * 文档: [https://mp.kuaishou.com/docs/develop/api-next/open/payment/ks.pay.html#ks-pay) */ pay(options: PayOptions): void; createVideoContext(videoId: string, currentComponent?: any): VideoContext; } } interface PayOptions { orderInfo: object, service: number, /** * 接口调用成功的回调函数 */ success?: (result: any) => void; /** * 接口调用失败的回调函数 */ fail?: (result: any) => void; /** * 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (result: any) => void; } interface VideoContext { /** * 暂停 */ pause(): void; /** * 播放 */ play(): void; /** * 跳转到指定位置,单位 s */ seek(position: number): void; /** * 发送弹幕,danmu 包含两个属性 text, color。 */ sendDanmu(danmu: Danmu): void; /** * 设置倍速播放,支持的倍率有 0.5/0.8/1.0/1.25/1.5 */ playbackRate(rate: number): void; /** * 进入全屏,可传入{direction}参数(1.7.0起支持),详见video组件文档 */ requestFullScreen(direction?: RequestFullScreenOptions): void; /** * 退出全屏 */ exitFullScreen(): void; } /** * Uni 实例变量 * * 文档: [http://uniapp.dcloud.io/api](http://uniapp.dcloud.io/api) */ declare let ks: UniApp.ks;