初次提交
This commit is contained in:
commit
c6557a6b4d
51
app.json
Normal file
51
app.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/home/home",
|
||||
"pages/my/my",
|
||||
"pages/theater/theater",
|
||||
"pages/recommend/recommend",
|
||||
"pages/search/search",
|
||||
"pages/leaderboard/leaderboard",
|
||||
"pages/subscribe/subscribe",
|
||||
"pages/consumption/consumption",
|
||||
"pages/rechargeRecord/rechargeRecord",
|
||||
"pages/videoDetail/videoDetail"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#080B16",
|
||||
"navigationBarTitleText": "初晴剧场",
|
||||
"navigationBarTextStyle": "white"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#999999",
|
||||
"selectedColor": "#5BBE04",
|
||||
"backgroundColor": "#000000",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/home/home",
|
||||
"iconPath": "/static/tab/home.png",
|
||||
"selectedIconPath": "/static/tab/home_selected.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/recommend/recommend",
|
||||
"iconPath": "/static/tab/recommend.png",
|
||||
"selectedIconPath": "/static/tab/recommend_selected.png",
|
||||
"text": "推荐"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/theater/theater",
|
||||
"iconPath": "/static/tab/theater.png",
|
||||
"selectedIconPath": "/static/tab/theater_selected.png",
|
||||
"text": "剧场"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/my",
|
||||
"iconPath": "/static/tab/my.png",
|
||||
"selectedIconPath": "/static/tab/my_selected.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
10
app.ts
Normal file
10
app.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { httpRequest } from "./utils/httpReques"
|
||||
|
||||
App({
|
||||
data: {
|
||||
httpRequest
|
||||
},
|
||||
onLaunch: function () {
|
||||
|
||||
}
|
||||
})
|
32
app.ttss
Normal file
32
app.ttss
Normal file
@ -0,0 +1,32 @@
|
||||
view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.__wa_img_no_radius {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #080B16;
|
||||
}
|
||||
|
||||
.pb_80 {
|
||||
padding-bottom: 80rpx;
|
||||
}
|
||||
|
||||
/* ._m_modal_html {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 99;
|
||||
} */
|
||||
|
||||
.mt_36 {
|
||||
margin-top: 36rpx;
|
||||
}
|
4
components/myModal/myModal.json
Normal file
4
components/myModal/myModal.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
40
components/myModal/myModal.ts
Normal file
40
components/myModal/myModal.ts
Normal file
@ -0,0 +1,40 @@
|
||||
// e:\project\dy_video_all\初晴剧场\components\myModal\myModal.ts
|
||||
Component({
|
||||
data: {
|
||||
maskFlag: false
|
||||
},
|
||||
properties: {
|
||||
cancelText: {
|
||||
type: String,
|
||||
value: '取消'
|
||||
},
|
||||
confirmText: {
|
||||
type: String,
|
||||
value: '确定'
|
||||
},
|
||||
contentText: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.setData({
|
||||
maskFlag: true
|
||||
})
|
||||
},
|
||||
hide() {
|
||||
this.setData({
|
||||
maskFlag: false
|
||||
})
|
||||
},
|
||||
handelCancel() {
|
||||
this.triggerEvent('handelCancel', { cancel: true, confirm: false });
|
||||
this.hide();
|
||||
},
|
||||
handelConfirm() {
|
||||
this.triggerEvent('handelConfirm', { cancel: false, confirm: true });
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
})
|
21
components/myModal/myModal.ttml
Normal file
21
components/myModal/myModal.ttml
Normal file
@ -0,0 +1,21 @@
|
||||
<view class="_m_modal_html" tt:if="{{maskFlag}}">
|
||||
<view class="_m_m_mask">
|
||||
<view class="_m_m_m_content">
|
||||
<view class="_m_m_m_co_warp">
|
||||
<view class="_m_m_m_c_header">
|
||||
<view class="_m_m_m_c_h_tips">
|
||||
<text class="_m_m_m_c_h_ti_text">{{contentText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_m_m_m_c_footer">
|
||||
<view class="_m_m_m_c_foo_cancel" bindtap="handelCancel">
|
||||
<text class="_m_m_m_c_foo_can_text">{{cancelText}}</text>
|
||||
</view>
|
||||
<view class="_m_m_m_c_foo_confirm" bindtap="handelConfirm">
|
||||
<text class="_m_m_m_c_foo_confirm_text">{{confirmText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
92
components/myModal/myModal.ttss
Normal file
92
components/myModal/myModal.ttss
Normal file
@ -0,0 +1,92 @@
|
||||
/* e:\project\dy_video_all\初晴剧场\components\myModal\myModal.ttss */
|
||||
|
||||
._m_modal_html {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
._m_m_mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* display: flex;
|
||||
justify-content: center;
|
||||
align-items: center; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
|
||||
}
|
||||
|
||||
._m_m_m_content {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
padding: 0 72rpx;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
._m_m_m_co_warp {
|
||||
width: 100%;
|
||||
padding: 40rpx 52rpx;
|
||||
background-color: #272A30;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
._m_m_m_c_header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
._m_m_m_c_h_tips {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
._m_m_m_c_h_ti_text {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
._m_m_m_c_foo_cancel {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 68rpx;
|
||||
background-color: #5BBE04;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
._m_m_m_c_foo_can_text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
._m_m_m_c_foo_confirm {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 68rpx;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 12rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
._m_m_m_c_foo_confirm_text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
21
node_modules/@douyin-microapp/typings/LICENCE
generated
vendored
Normal file
21
node_modules/@douyin-microapp/typings/LICENCE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
23
node_modules/@douyin-microapp/typings/README.md
generated
vendored
Normal file
23
node_modules/@douyin-microapp/typings/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# 字节小程序类型定义文件
|
||||
|
||||
字节跳动小程序 API 的 TypeScript 类型定义文件。
|
||||
|
||||
## 安装
|
||||
|
||||
```shell
|
||||
npm install @douyin-microapp/typings
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
安装后手动进行导入。
|
||||
|
||||
- `import '@douyin-microapp/typings';`
|
||||
|
||||
也可以直接在项目的 `tsconfig.json` 配置文件中指定。
|
||||
|
||||
- `types: ["@douyin-microapp/typings"]`。
|
||||
|
||||
或者通过 [三斜杠指令](https://www.tslang.cn/docs/handbook/triple-slash-directives.html) 引用。
|
||||
|
||||
- `/// <reference path="node_modules/@douyin-microapp/typings/index.d.ts" />`
|
48
node_modules/@douyin-microapp/typings/api/accelerometer.d.ts
generated
vendored
Normal file
48
node_modules/@douyin-microapp/typings/api/accelerometer.d.ts
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 开始监听加速度数据
|
||||
* 具体加速度数据通过注册tt.onAccelerometerChange的回调方法来获取
|
||||
*/
|
||||
export const startAccelerometer: AsyncAPI;
|
||||
|
||||
/**
|
||||
* ### 停止监听加速度数据
|
||||
*/
|
||||
export const stopAccelerometer: AsyncAPI;
|
||||
|
||||
/**
|
||||
* ### 监听加速度数据。
|
||||
* 回调的频率为 5 次 / 秒,暂不支持设置。接口调用后会开始监听,可通过tt.onStopAccelerometer停止监听。
|
||||
*/
|
||||
export const onAccelerometerChange: SyncAPI<
|
||||
[
|
||||
callback: (res: {
|
||||
/** X 轴数据 */
|
||||
x: number;
|
||||
/** Y 轴数据 */
|
||||
y: number;
|
||||
/** Z 轴数据 */
|
||||
z: number;
|
||||
}) => void
|
||||
]
|
||||
>;
|
35
node_modules/@douyin-microapp/typings/api/action-sheet.d.ts
generated
vendored
Normal file
35
node_modules/@douyin-microapp/typings/api/action-sheet.d.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 显示操作菜单
|
||||
*
|
||||
* 设计文档详见操作菜单
|
||||
*/
|
||||
export const showActionSheet: AsyncAPI<
|
||||
{
|
||||
itemList: string[];
|
||||
},
|
||||
{
|
||||
/** */
|
||||
tapIndex: number;
|
||||
}
|
||||
>;
|
75
node_modules/@douyin-microapp/typings/api/app-lifecycle.d.ts
generated
vendored
Normal file
75
node_modules/@douyin-microapp/typings/api/app-lifecycle.d.ts
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 监听小程序切前台事件。该事件与 App.onShow 的回调参数一致。
|
||||
*/
|
||||
export const onAppShow: SyncAPI<
|
||||
[
|
||||
(res: {
|
||||
/** 小程序切前台的路径 (代码包路径) */
|
||||
path: string;
|
||||
/** 小程序切前台的场景值 */
|
||||
scene: number;
|
||||
/** 小程序切前台的 query 参数 */
|
||||
query: object;
|
||||
/** 来源信息,从另一个小程序或 App 进入小程序时返回,否则返回 {}。 */
|
||||
referrerInfo: {
|
||||
/** 来源小程序的 appId */
|
||||
appId: string;
|
||||
/** 来源小程序传过来的数据 */
|
||||
extraData: object;
|
||||
};
|
||||
}) => void
|
||||
]
|
||||
>;
|
||||
|
||||
/**
|
||||
* 取消监听小程序进前台事件。
|
||||
*/
|
||||
export const offAppShow: SyncAPI<[CallableFunction]>;
|
||||
|
||||
/**
|
||||
* 监听小程序切后台事件。该事件与 App.onHide 的回调时机一致。
|
||||
*/
|
||||
export const onAppHide: SyncAPI<[CallableFunction]>;
|
||||
|
||||
/**
|
||||
* 取消监听小程序切后台事件。
|
||||
*/
|
||||
export const offAppHide: SyncAPI<[CallableFunction]>;
|
||||
|
||||
/**
|
||||
* 监听小程序错误事件,如脚本错误或 API 调用报错等。该事件与 App.onError 的回调时机与参数一致。
|
||||
*/
|
||||
export const onError: SyncAPI<
|
||||
[
|
||||
(
|
||||
/** 错误信息 */
|
||||
error: string
|
||||
) => void
|
||||
]
|
||||
>;
|
||||
|
||||
/**
|
||||
* 取消监听小程序错误事件。
|
||||
*/
|
||||
export const offError: SyncAPI<[callback?: CallableFunction]>;
|
36
node_modules/@douyin-microapp/typings/api/apply-ec-coupon.d.ts
generated
vendored
Normal file
36
node_modules/@douyin-microapp/typings/api/apply-ec-coupon.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 白名单 API,小程序绑定的抖音小店的发放抖店优惠券能力
|
||||
*/
|
||||
export const applyEcCoupon: AsyncAPI<
|
||||
{
|
||||
shopId: string;
|
||||
couponMetaId: string;
|
||||
couponCount?: number;
|
||||
},
|
||||
{
|
||||
/** "applyEcCoupon:ok" */
|
||||
errMsg: string;
|
||||
/** 发券的券码列表 */
|
||||
couponIdList: [string];
|
||||
}
|
||||
>;
|
48
node_modules/@douyin-microapp/typings/api/apply-refund.d.ts
generated
vendored
Normal file
48
node_modules/@douyin-microapp/typings/api/apply-refund.d.ts
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 开放API-申请退款
|
||||
*/
|
||||
|
||||
interface refundGoods {
|
||||
goodsId: string;
|
||||
goodsType: number;
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
export const applyRefund: AsyncAPI<
|
||||
{
|
||||
refundInfo: {
|
||||
reason: string[];
|
||||
note?: string;
|
||||
};
|
||||
outOrderNo: string;
|
||||
goodsList?: refundGoods[];
|
||||
refundTotalAmount?: number;
|
||||
type?: number;
|
||||
callbackData?: { [key: string]: unknown };
|
||||
},
|
||||
{
|
||||
refundId: string;
|
||||
outRefundNo: string;
|
||||
orderId: string;
|
||||
}
|
||||
>;
|
36
node_modules/@douyin-microapp/typings/api/array-buffer-to-base64.d.ts
generated
vendored
Normal file
36
node_modules/@douyin-microapp/typings/api/array-buffer-to-base64.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 将 [ArrayBuffer](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) 对象转成 Base64 字符串
|
||||
*/
|
||||
export const arrayBufferToBase64: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 要转化成 Base64 字符串的 ArrayBuffer 对象 */
|
||||
obj: ArrayBuffer;
|
||||
}
|
||||
],
|
||||
{
|
||||
/** 参数对应生成的 Base64 编码的字符串 */
|
||||
base64: string;
|
||||
}
|
||||
>;
|
29
node_modules/@douyin-microapp/typings/api/authorize.d.ts
generated
vendored
Normal file
29
node_modules/@douyin-microapp/typings/api/authorize.d.ts
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 提前向用户发出授权请求
|
||||
* 该方法不会调用对应接口,只会弹框咨询用户是否授权或者获取用户信息。如果用户之前有授权,该接口直接返回成功,不会跟用户产生交互。
|
||||
*/
|
||||
export const authorize: AsyncAPI<{
|
||||
/** 需要预授权的 scope,详见 用户授权 scope 说明 */
|
||||
scope: string;
|
||||
}>;
|
82
node_modules/@douyin-microapp/typings/api/background-audio.d.ts
generated
vendored
Normal file
82
node_modules/@douyin-microapp/typings/api/background-audio.d.ts
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 获取全局唯一的背景音频管理器 BackgroundAudioManager。该 api 多次调用时返回的是同一个实例,在多页面使用时,会操作到同一个上下文对象。
|
||||
*/
|
||||
export const getBackgroundAudioManager: SyncAPI<[], BackgroundAudioManager>;
|
||||
|
||||
interface BackgroundAudioManager {
|
||||
/** 音频源地址, 默认为空字符串,当设置了新的 src 时,会自动开始播放,仅支持临时路径(如通过下载到本地的音频地址)、网络地址(需在小程序开发者平台配置域名白名单),所支持的格式同系统音频播放器 */
|
||||
src: string;
|
||||
/** 开始播放的位置(单位:s) */
|
||||
startTime: number;
|
||||
/** 音频标题, 用于原生音频播放器音频标题 */
|
||||
title: string;
|
||||
/** 专辑名 */
|
||||
epname: string;
|
||||
/** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */
|
||||
singer: string;
|
||||
/** 封面图 URL,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图 */
|
||||
coverImgUrl: string;
|
||||
/** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */
|
||||
webUrl: string;
|
||||
/** 音频协议。默认值为 http,设置 hls 可以支持播放 HLS 协议的直播音频 */
|
||||
protocol: string;
|
||||
/** 设置点击悬浮控件/通知栏跳转当前小程序指定页面,数据格式为 {path:"(音乐播放路径)",query:{name:''}} */
|
||||
audioPage: {
|
||||
path: string;
|
||||
query: object;
|
||||
};
|
||||
/** 当前音频总时长(单位 s),只读 */
|
||||
duration: number;
|
||||
/** 当前音频进度(单位 s),只读 */
|
||||
currentTime: number;
|
||||
/** 当前音频是否处于暂停状态,只读 */
|
||||
paused: boolean;
|
||||
/** 当前音频已缓冲部分(单位 s),只读 */
|
||||
buffered: number;
|
||||
/** 播放 */
|
||||
play: CallableFunction;
|
||||
/** 暂停 */
|
||||
pause: CallableFunction;
|
||||
/** 停止播放。停止后再次播放时从头开始播放 */
|
||||
stop: CallableFunction;
|
||||
/** 当前音频跳转到指定位置(单位:s),并开始播放 */
|
||||
seek: (
|
||||
/** 跳转的时间(单位:s) */
|
||||
options: number
|
||||
) => void;
|
||||
/** 监听音频进入可以播放状态,但不保证后面可以流畅播放 */
|
||||
onCanplay: (callback: () => void) => void;
|
||||
/** 监听自然播放结束事件 */
|
||||
onEnded: (callback: () => void) => void;
|
||||
/** 监听音频进度更新事件 */
|
||||
onTimeUpdate: (callback: () => void) => void;
|
||||
/** 监听音频播放错误事件 */
|
||||
onError: (callback: () => void) => void;
|
||||
/** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */
|
||||
onWaiting: (callback: () => void) => void;
|
||||
/** 监听音频开始进行 seek 操作的事件 */
|
||||
onSeeking: (callback: () => void) => void;
|
||||
/** 监听音频完成 seek 操作的事件 */
|
||||
onSeeked: (callback: () => void) => void;
|
||||
}
|
36
node_modules/@douyin-microapp/typings/api/base64-to-array-buffer.d.ts
generated
vendored
Normal file
36
node_modules/@douyin-microapp/typings/api/base64-to-array-buffer.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 将 Base64 字符串转成 【ArrayBuffer](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) 对象。
|
||||
*/
|
||||
export const base64ToArrayBuffer: SyncAPI<
|
||||
[
|
||||
/** 要转化成 ArrayBuffer 对象的 Base64 字符串 */
|
||||
str: string
|
||||
],
|
||||
arrayBuffer
|
||||
>;
|
||||
|
||||
interface arrayBuffer {
|
||||
/** 参数对应生成的 ArrayBuffer 对象 */
|
||||
obj: ArrayBuffer;
|
||||
}
|
156
node_modules/@douyin-microapp/typings/api/bytenn-manager.d.ts
generated
vendored
Normal file
156
node_modules/@douyin-microapp/typings/api/bytenn-manager.d.ts
generated
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
type InferSync = SyncAPI<
|
||||
[
|
||||
{
|
||||
/**
|
||||
* 输入数据的格式
|
||||
*/
|
||||
dataConfig: {
|
||||
/**
|
||||
* 输入的图像数据
|
||||
*/
|
||||
data: ArrayBuffer;
|
||||
/**
|
||||
* 输入数据的宽度
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* 输入数据的高度
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* 输入数据的通道数
|
||||
*/
|
||||
channel: number;
|
||||
/**
|
||||
* 输入数据的 batch 数,默认为 1
|
||||
*/
|
||||
batch?: number;
|
||||
/**
|
||||
* 输入数据的类型
|
||||
*/
|
||||
dataType: string;
|
||||
/**
|
||||
* 输入数据的格式,NCHW 或 NHWC
|
||||
*/
|
||||
dataFormat: string;
|
||||
};
|
||||
/**
|
||||
* 数据转换的格式
|
||||
*/
|
||||
convertConfig: {
|
||||
/**
|
||||
* 数据对应的输出通道
|
||||
*/
|
||||
outputChannel: number;
|
||||
/**
|
||||
* 归一化参数
|
||||
*/
|
||||
normalizeFactor: number;
|
||||
/**
|
||||
* 归一化后的偏置,默认为 0
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* 输入通道的配置格式
|
||||
*/
|
||||
inputConfig: {
|
||||
/**
|
||||
* 输入通道的通道名
|
||||
*/
|
||||
inputChannel: number;
|
||||
/**
|
||||
* 当前通道对应的权重
|
||||
*/
|
||||
weight: number;
|
||||
}[];
|
||||
}[];
|
||||
}
|
||||
],
|
||||
{}
|
||||
>;
|
||||
|
||||
interface BytennEngine {
|
||||
inferSync: InferSync;
|
||||
}
|
||||
|
||||
type Load = SyncAPI<[], {}>;
|
||||
|
||||
type OnLoad = SyncAPI<
|
||||
[
|
||||
/**
|
||||
* res 为返回的 BytennEngine
|
||||
*/
|
||||
(res: BytennEngine) => void
|
||||
],
|
||||
{}
|
||||
>;
|
||||
|
||||
type OnError = SyncAPI<
|
||||
[
|
||||
/**
|
||||
* err 为返回的错误原因
|
||||
*/
|
||||
(err: Error) => void
|
||||
],
|
||||
{}
|
||||
>;
|
||||
|
||||
/** ### 进行网络加载 */
|
||||
export const load: Load;
|
||||
|
||||
/** ### 设置加载完成回调,会返回加载好的神经网络 */
|
||||
export const onLoad: OnLoad;
|
||||
|
||||
/** ### 设置加载失败回调,会返回加载失败的原因 */
|
||||
export const onError: OnError;
|
||||
|
||||
/** ### 使用神经网络进行同步推理,会直接返回推理结果 */
|
||||
export const inferSync: InferSync;
|
||||
|
||||
/**
|
||||
* ### 创建一个 BytennEngineContext
|
||||
*
|
||||
* 非 IDE 预览环境使用前请申请使用白名单
|
||||
*/
|
||||
export const createBytennEngineContext: SyncAPI<
|
||||
[
|
||||
/**
|
||||
* 请求的模型名称
|
||||
*/
|
||||
modelName: string,
|
||||
/**
|
||||
* 需要初始化的模型配置,numThread 为后台工作线程数,backend 为推理后端类型
|
||||
*/
|
||||
config?: {
|
||||
numThread?: number;
|
||||
backend?: string;
|
||||
}
|
||||
],
|
||||
{
|
||||
/** 创建好的 bytennEngineContext */
|
||||
load: Load;
|
||||
onError: OnError;
|
||||
onLoad: OnLoad;
|
||||
}
|
||||
>;
|
36
node_modules/@douyin-microapp/typings/api/can-i-put-stuff-over-component.d.ts
generated
vendored
Normal file
36
node_modules/@douyin-microapp/typings/api/can-i-put-stuff-over-component.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 小程序中的一些组件是由客户端实现的,如 video、live-player、ad 等。
|
||||
* 如果开发者希望通过 css 等手段往这些组件的上方放置一些其他组件,是需要依赖小程序所在 App 具备一定能力才可以实现的。
|
||||
* 因此开发者可以使用本方法在小程序运行时判断某组件上方是否支持放置其他组件,并根据返回结果动态的决定小程序页面的实现方式。
|
||||
*/
|
||||
export const canIPutStuffOverComponent: SyncAPI<
|
||||
[
|
||||
/** 小程序组件标签名称,如"video"、"live-player"等, 对 canvas 组件的同层判断请见 [canvas 组件](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/foundation/tt-can-i-put-stuff-over-component/#canvas%E7%BB%84%E4%BB%B6) */
|
||||
componentName: string
|
||||
],
|
||||
{
|
||||
/** 返回值是一个布尔值,表示是否支持在该类型组件上放置其他组件 */
|
||||
res: boolean;
|
||||
}
|
||||
>;
|
43
node_modules/@douyin-microapp/typings/api/can-i-use.d.ts
generated
vendored
Normal file
43
node_modules/@douyin-microapp/typings/api/can-i-use.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 判断小程序的 API,回调,参数,组件等是否在当前版本可用。
|
||||
* ```
|
||||
* // 对象的属性或方法
|
||||
* tt.canIUse("UpdateManager");
|
||||
* tt.canIUse("Stats.isDirectory");
|
||||
*
|
||||
* // 接口参数、回调或者返回值
|
||||
* tt.canIUse("exitMiniProgram");
|
||||
* tt.canIUse("getLaunchOptionsSync.return.path");
|
||||
* tt.canIUse("getSystemInfo.success.screenWidth");
|
||||
* tt.canIUse("showToast.object.title");
|
||||
* tt.canIUse("onCompassChange.callback.direction");
|
||||
* tt.canIUse("request.object.method.GET");
|
||||
*
|
||||
* // 组件的属性
|
||||
* tt.canIUse("swiper");
|
||||
* tt.canIUse("text.selectable");
|
||||
* tt.canIUse("button.open-type.contact");
|
||||
* ```
|
||||
*/
|
||||
export const canIUse: SyncAPI<[schema: string], boolean>;
|
32
node_modules/@douyin-microapp/typings/api/capture-screen.d.ts
generated
vendored
Normal file
32
node_modules/@douyin-microapp/typings/api/capture-screen.d.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 监听用户主动截屏事件
|
||||
* 用户使用系统截屏按键截屏时触发此事件,只能添加一个监听器。
|
||||
*/
|
||||
export const onUserCaptureScreen: SyncAPI<[() => void]>;
|
||||
|
||||
/**
|
||||
* ### 取消监听用户主动截屏事件
|
||||
* 卸载通过 tt.onUserCaptureScreen 注册的截屏事件监听函数。
|
||||
*/
|
||||
export const offUserCaptureScreen: SyncAPI<[() => void]>;
|
31
node_modules/@douyin-microapp/typings/api/check-follow-state.d.ts
generated
vendored
Normal file
31
node_modules/@douyin-microapp/typings/api/check-follow-state.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 查看用户是否已关注小程序绑定的头条号。
|
||||
*/
|
||||
export const checkFollowState: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 是否已关注头条号 */
|
||||
result: boolean;
|
||||
}
|
||||
>;
|
40
node_modules/@douyin-microapp/typings/api/check-session.d.ts
generated
vendored
Normal file
40
node_modules/@douyin-microapp/typings/api/check-session.d.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 用户的登录态具有时效性检查
|
||||
*
|
||||
* 随着用户未使用小程序的时间增加,用户的登录态越容易失效;反之,则用户登录态可持续保持有效。
|
||||
*
|
||||
* 使用该 API 可检查用户当前的 session 状态是否有效,登录态过期后开发者可以再调用 tt.login 获取新的用户登录态。
|
||||
*
|
||||
* ```js
|
||||
* tt.checkSession({
|
||||
* success() {
|
||||
* console.log(`session 未过期`);
|
||||
* },
|
||||
* fail() {
|
||||
* console.log(`session 已过期,需要重新登录`);
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const checkSession: AsyncAPI;
|
43
node_modules/@douyin-microapp/typings/api/choose-address.d.ts
generated
vendored
Normal file
43
node_modules/@douyin-microapp/typings/api/choose-address.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址,同时,用户在小程序中新增的地址会同步至开发者地址库中共存。
|
||||
*/
|
||||
export const chooseAddress: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** "chooseAddress:ok" */
|
||||
errMsg: string;
|
||||
/** 收货人姓名 */
|
||||
userName: string;
|
||||
/** 国际收货地址第一级地址 */
|
||||
provinceName: string;
|
||||
/** 国际收货地址第二级地址 */
|
||||
cityName: string;
|
||||
/** 国际收货地址第三级地址 */
|
||||
countyName: string;
|
||||
/** 详细收货地址信息 */
|
||||
detailInfo: string;
|
||||
/** 收货人手机号码 */
|
||||
telNumber: string;
|
||||
}
|
||||
>;
|
40
node_modules/@douyin-microapp/typings/api/clipboard.d.ts
generated
vendored
Normal file
40
node_modules/@douyin-microapp/typings/api/clipboard.d.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 设置系统剪贴板内容
|
||||
* 可以和tt.getClipboardData配套使用。
|
||||
*/
|
||||
export const setClipboardData: AsyncAPI<{
|
||||
/** 剪贴板的内容 */
|
||||
data: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 获取系统剪贴板内容
|
||||
*/
|
||||
export const getClipboardData: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 剪贴板的内容 */
|
||||
data: string;
|
||||
}
|
||||
>;
|
61
node_modules/@douyin-microapp/typings/api/compass.d.ts
generated
vendored
Normal file
61
node_modules/@douyin-microapp/typings/api/compass.d.ts
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 监听罗盘数据变化事件
|
||||
*
|
||||
* 接口调用后会自动开始监听,可使用 tt.stopCompass 停止监听
|
||||
*
|
||||
* 罗盘数据会在用户手机如下操作发生改变(频率 5 次/秒)
|
||||
* - 朝向变化
|
||||
* - 加速前进
|
||||
* - 加速后退
|
||||
* - 摇一摇
|
||||
*/
|
||||
export const onCompassChange: SyncAPI<
|
||||
[
|
||||
(res: {
|
||||
/** 方向 */
|
||||
direction?: number;
|
||||
}) => void
|
||||
]
|
||||
>;
|
||||
|
||||
/**
|
||||
* ### 取消监听罗盘数据变化事件
|
||||
*/
|
||||
export const offCompassChange: SyncAPI<[(...args: any[]) => void]>;
|
||||
|
||||
/**
|
||||
* ### 开始监听罗盘数据
|
||||
*
|
||||
* 罗盘数据会在用户手机如下操作发生改变(频率 5 次/秒)
|
||||
* - 朝向变化
|
||||
* - 加速前进
|
||||
* - 加速后退
|
||||
* - 摇一摇
|
||||
*/
|
||||
export const startCompass: AsyncAPI;
|
||||
|
||||
/**
|
||||
* ### 停止监听罗盘数据
|
||||
*/
|
||||
export const stopCompass: AsyncAPI;
|
37
node_modules/@douyin-microapp/typings/api/complete-pay-sync.d.ts
generated
vendored
Normal file
37
node_modules/@douyin-microapp/typings/api/complete-pay-sync.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
/**
|
||||
* 支付
|
||||
*/
|
||||
export const completePaySync: SyncAPI<
|
||||
[
|
||||
{
|
||||
orderId?: string;
|
||||
result: {
|
||||
status: "success" | "fail";
|
||||
orderId: string;
|
||||
outOrderNo: string;
|
||||
result: { code: number; orderId: string } | { errMsg: string };
|
||||
};
|
||||
}
|
||||
],
|
||||
{}
|
||||
>;
|
38
node_modules/@douyin-microapp/typings/api/complete-refund-sync.d.ts
generated
vendored
Normal file
38
node_modules/@douyin-microapp/typings/api/complete-refund-sync.d.ts
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
export const completeRefundSync: SyncAPI<
|
||||
[
|
||||
{
|
||||
orderId?: string;
|
||||
result: {
|
||||
status: "success" | "fail";
|
||||
outOrderNo: string;
|
||||
result:
|
||||
| { refundId: string; outRefundNo: string; orderId: string }
|
||||
| { errMsg: string };
|
||||
};
|
||||
}
|
||||
],
|
||||
{}
|
||||
>;
|
45
node_modules/@douyin-microapp/typings/api/compress-image.d.ts
generated
vendored
Normal file
45
node_modules/@douyin-microapp/typings/api/compress-image.d.ts
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 压缩图片接口
|
||||
*
|
||||
* 该 API 仅对 `jpg` 有效
|
||||
*/
|
||||
export const compressImage: AsyncAPI<
|
||||
{
|
||||
/**
|
||||
* 图片路径,不支持网络图片,可以本地路径、代码包相对路径
|
||||
*/
|
||||
src: string | string[];
|
||||
|
||||
/**
|
||||
* 压缩质量,范围 0 ~ 100,数值越小,质量越低,压缩率越高
|
||||
*
|
||||
* 默认值 80
|
||||
*/
|
||||
quality?: number;
|
||||
},
|
||||
{
|
||||
/** 压缩完成后的文件的临时路径 */
|
||||
tempFilePath: string | string[];
|
||||
}
|
||||
>;
|
126
node_modules/@douyin-microapp/typings/api/connect-socket.d.ts
generated
vendored
Normal file
126
node_modules/@douyin-microapp/typings/api/connect-socket.d.ts
generated
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, AsyncAPIWithHandler } from "./types";
|
||||
|
||||
interface SocketTask {
|
||||
/**
|
||||
* 表示 Socket 连接状态 code
|
||||
* 若由于参数错误导致未创建连接, 则为 undefined
|
||||
*/
|
||||
readonly readyState?: 0 | 1 | 2 | 3;
|
||||
/** 表示 Socket 正在连接的常量 */
|
||||
readonly CONNECTING: 0;
|
||||
/** 表示 Socket 连接已经打开的常量 */
|
||||
readonly OPEN: 1;
|
||||
/** 表示 Socket 连接关闭中的常量 */
|
||||
readonly CLOSING: 2;
|
||||
/** 表示 Socket 连接已关闭的常量 */
|
||||
readonly CLOSED: 3;
|
||||
|
||||
/**
|
||||
* ### WebSocket 发送给服务端数据的方法
|
||||
*/
|
||||
send: AsyncAPI<{
|
||||
/** 发送的数据内容 */
|
||||
data: string | ArrayBuffer;
|
||||
}>;
|
||||
|
||||
/** ### 关闭 WebSocket 连接的方法。 */
|
||||
close: AsyncAPI<{
|
||||
/** 关闭连接状态码 */
|
||||
code?: number;
|
||||
/** 连接被关闭的原因 */
|
||||
reason?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 监听 WebSocket 连接服务器成功的事件
|
||||
* 表示 WebSocket 的状态变成 open,可以发送数据给服务器。
|
||||
*/
|
||||
onOpen: (
|
||||
callback: (res: {
|
||||
/** 连接服务器返回的 Response Header */
|
||||
header: Record<string, unknown>;
|
||||
/** 使用的网络传输层协议 */
|
||||
protocolType: string;
|
||||
/** websocket 类型 */
|
||||
socketType: "ttnet" | "tradition";
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** 监听 WebSocket 与服务器的连接断开的事件 */
|
||||
onClose: (
|
||||
callback: (res: {
|
||||
/** 使用的网络传输层协议 */
|
||||
protocolType: string;
|
||||
/** websocket 类型 */
|
||||
socketType: string;
|
||||
/** 错误信息 */
|
||||
errMsg: string;
|
||||
/** 关闭原因 */
|
||||
reason: string;
|
||||
/** 关闭 code */
|
||||
code: string | number;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** ### 监听 WebSocket 接收到服务器发送信息的事件。 */
|
||||
onMessage: (
|
||||
callback: (res: {
|
||||
/** 接收到的服务器消息 */
|
||||
data: string | ArrayBuffer;
|
||||
/** websocket 使用的协议 */
|
||||
protocolType: string;
|
||||
/** websocket 类型 */
|
||||
socketType: "ttnet" | "tradition";
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** ### 监听 WebSocket 发生错误的事件 */
|
||||
onError: (
|
||||
callback: (res: {
|
||||
/** 错误信息 */
|
||||
errMsg: string;
|
||||
}) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* ### 创建一个 WebSocket 连接实例
|
||||
*
|
||||
* 并通过返回的socketTask操作该连接
|
||||
*
|
||||
* 网络相关的 API 在使用前需要配置域名白名单
|
||||
*
|
||||
* 请参考[网络请求使用说明](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/other/network-request-reference/)
|
||||
*/
|
||||
export const connectSocket: AsyncAPIWithHandler<
|
||||
{
|
||||
/** Socket 连接地址 */
|
||||
url: string;
|
||||
header?: Record<string, string>;
|
||||
protocols?: string[];
|
||||
},
|
||||
{
|
||||
/** 当前创建的 sockTask 的序号 */
|
||||
socketTaskId: number;
|
||||
},
|
||||
SocketTask
|
||||
>;
|
34
node_modules/@douyin-microapp/typings/api/continue-to-pay.d.ts
generated
vendored
Normal file
34
node_modules/@douyin-microapp/typings/api/continue-to-pay.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 开放API-继续支付
|
||||
*/
|
||||
|
||||
export const continueToPay: AsyncAPI<
|
||||
{
|
||||
orderId?: string;
|
||||
outOrderNo?: string;
|
||||
},
|
||||
{
|
||||
orderId: string;
|
||||
outOrderNo: string;
|
||||
}
|
||||
>;
|
158
node_modules/@douyin-microapp/typings/api/create-animation.d.ts
generated
vendored
Normal file
158
node_modules/@douyin-microapp/typings/api/create-animation.d.ts
generated
vendored
Normal file
@ -0,0 +1,158 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
export const createAnimation: SyncAPI<
|
||||
[
|
||||
| {
|
||||
/**
|
||||
* 指定一个动画周期的时长, 单位 ms
|
||||
*
|
||||
* 默认值 400
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* 定义动画在每一动画周期中执行的节奏, [参考文档](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function)
|
||||
*
|
||||
* 默认值 "linear"
|
||||
*/
|
||||
timingFunction?: string;
|
||||
/**
|
||||
* 定义动画于何时开始
|
||||
*
|
||||
* 默认值 0
|
||||
*/
|
||||
delay?: number;
|
||||
/**
|
||||
* 指定元素变形的原点
|
||||
*
|
||||
* 默认值 "50% 50% 0"
|
||||
*/
|
||||
transformOrigin?: string;
|
||||
}
|
||||
| undefined
|
||||
],
|
||||
Animation
|
||||
>;
|
||||
|
||||
interface Animation {
|
||||
/** 透明度 */
|
||||
opacity: (value: number) => Animation;
|
||||
/** 背景色 */
|
||||
backgroundColor: (value: string) => Animation;
|
||||
/** 宽度 */
|
||||
width: (value: number) => Animation;
|
||||
/** 高度 */
|
||||
height: (value: number) => Animation;
|
||||
/** 顶部距离 */
|
||||
top: (value: number) => Animation;
|
||||
/** 底部距离 */
|
||||
bottom: (value: number) => Animation;
|
||||
/** 左侧距离 */
|
||||
left: (value: number) => Animation;
|
||||
/** 右侧距离 */
|
||||
right: (value: number) => Animation;
|
||||
|
||||
/** 旋转, 等效 rotateZ */
|
||||
rotate: (value: number) => Animation;
|
||||
/** X 轴旋转 */
|
||||
rotateX: (x: number) => Animation;
|
||||
/** Y 轴旋转 */
|
||||
rotateY: (y: number) => Animation;
|
||||
/** Z 轴旋转 */
|
||||
rotateZ: (z: number) => Animation;
|
||||
/**
|
||||
* 从 固定轴 顺时针旋转一个角度
|
||||
*
|
||||
* @param x 描述旋转轴向量的x坐标
|
||||
* @param y 描述旋转轴向量的y坐标
|
||||
* @param z 描述旋转轴向量的z坐标
|
||||
* @param a 代表旋转的角度. 正角度表示顺时针旋转, 负角度表示逆时针旋转
|
||||
*/
|
||||
rotate3d: (x: number, y: number, z: number, a: number) => Animation;
|
||||
|
||||
/** XY 缩放 */
|
||||
scale: (s: number) => Animation;
|
||||
/** X 轴缩放 */
|
||||
scaleX: (x: number) => Animation;
|
||||
/** Y 轴缩放 */
|
||||
scaleY: (y: number) => Animation;
|
||||
/** Z 轴缩放 */
|
||||
scaleZ: (z: number) => Animation;
|
||||
/** XYZ 轴缩放 */
|
||||
scale3d: (x: number, y: number, z: number) => Animation;
|
||||
|
||||
/** XY 轴平移 */
|
||||
translate: (x: number, y: number) => Animation;
|
||||
/** X 轴平移 */
|
||||
translateX: (x: number) => Animation;
|
||||
/** Y 轴平移 */
|
||||
translateY: (y: number) => Animation;
|
||||
/** Z 轴平移 */
|
||||
translateZ: (z: number) => Animation;
|
||||
/** XYZ 轴平移 */
|
||||
translate3d: (x: number, y: number, z: number) => Animation;
|
||||
|
||||
/** XY 轴倾斜 */
|
||||
skew: (x: number, y: number) => Animation;
|
||||
/** X 轴倾斜 */
|
||||
skewX: (x: number) => Animation;
|
||||
/** Y 轴倾斜 */
|
||||
skewY: (y: number) => Animation;
|
||||
|
||||
/**
|
||||
* CSS 函数 matrix() 指定了一个由指定的 6 个值组成的 2D 变换矩阵
|
||||
*
|
||||
* 这种矩阵的常量值是隐含的,而不是由参数传递的, 其他的参数是以列优先的顺序描述的
|
||||
*
|
||||
* `matrix(a, b, c, d, tx, ty)` 是 `matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1)` 的简写
|
||||
*/
|
||||
matrix: (
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
d: number,
|
||||
tx: number,
|
||||
ty: number
|
||||
) => Animation;
|
||||
|
||||
/**
|
||||
* CSS 函数 matrix3d() 以 4x4 齐次矩阵的形式定义一个3D转换
|
||||
* 其结果是一个 [transform-function](https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function) 数据类型。
|
||||
*/
|
||||
matrix3d: (
|
||||
a1: number,
|
||||
b1: number,
|
||||
c1: number,
|
||||
d1: number,
|
||||
a2: number,
|
||||
b2: number,
|
||||
c2: number,
|
||||
d2: number,
|
||||
a3: number,
|
||||
b3: number,
|
||||
c3: number,
|
||||
d3: number,
|
||||
a4: number,
|
||||
b4: number,
|
||||
c4: number,
|
||||
d4: number
|
||||
) => Animation;
|
||||
}
|
264
node_modules/@douyin-microapp/typings/api/create-cloud.d.ts
generated
vendored
Normal file
264
node_modules/@douyin-microapp/typings/api/create-cloud.d.ts
generated
vendored
Normal file
@ -0,0 +1,264 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI, AsyncAPI, AsyncAPIWithHandler } from "./types";
|
||||
|
||||
export interface CloudID {
|
||||
cloudID: string;
|
||||
}
|
||||
|
||||
export interface DeleteFile {
|
||||
fileName: string;
|
||||
status: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CloudUploadTask {
|
||||
onProgressUpdate: (
|
||||
callback: (data: {
|
||||
/** 上传进度 */
|
||||
progress: number;
|
||||
/** 已经上传的数据长度,单位byte */
|
||||
totalBytesSent: number;
|
||||
/** 预期需要上传的数据总长度,单位byte */
|
||||
totalBytesExpectedToSend: number;
|
||||
}) => void
|
||||
) => void;
|
||||
offProgressUpdate: (
|
||||
// eslint-disable-next-line
|
||||
callback: (...args: any[]) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
export interface CloudDownloadTask {
|
||||
onProgressUpdate: (
|
||||
callback: (data: {
|
||||
/** 上传进度 */
|
||||
progress: number;
|
||||
/** 已经上传的数据长度,单位byte */
|
||||
totalBytesWritten: number;
|
||||
/** 预期需要上传的数据总长度,单位byte */
|
||||
totalBytesExpectedToWrite: number;
|
||||
}) => void
|
||||
) => void;
|
||||
offProgressUpdate: (
|
||||
// eslint-disable-next-line
|
||||
callback: (...args: any[]) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
export interface CloudExtensionManager {
|
||||
joinGroup: AsyncAPI<
|
||||
{
|
||||
groupInfoArray: { groupName: string; groupValue: string }[];
|
||||
},
|
||||
{
|
||||
result: { groupName: string; groupValue: string; status: number }[];
|
||||
}
|
||||
>;
|
||||
exitGroup: AsyncAPI<
|
||||
{
|
||||
groupInfoArray: { groupName: string; groupValue: string }[];
|
||||
},
|
||||
{
|
||||
result: { groupName: string; groupValue: string; status: number }[];
|
||||
}
|
||||
>;
|
||||
}
|
||||
|
||||
export interface CloudSocketTask {
|
||||
/**
|
||||
* 表示 Socket 连接状态 code
|
||||
* 若由于参数错误导致未创建连接, 则为 undefined
|
||||
*/
|
||||
readonly readyState?: 0 | 1 | 2 | 3;
|
||||
/** 表示 Socket 正在连接的常量 */
|
||||
readonly CONNECTING: 0;
|
||||
/** 表示 Socket 连接已经打开的常量 */
|
||||
readonly OPEN: 1;
|
||||
/** 表示 Socket 连接关闭中的常量 */
|
||||
readonly CLOSING: 2;
|
||||
/** 表示 Socket 连接已关闭的常量 */
|
||||
readonly CLOSED: 3;
|
||||
|
||||
/**
|
||||
* ### WebSocket 发送给服务端数据的方法
|
||||
*/
|
||||
send: AsyncAPI<{
|
||||
/** 发送的数据内容 */
|
||||
data: string | ArrayBuffer;
|
||||
}>;
|
||||
|
||||
/** ### 关闭 WebSocket 连接的方法。 */
|
||||
close: AsyncAPI<{
|
||||
/** 关闭连接状态码 */
|
||||
code?: number;
|
||||
/** 连接被关闭的原因 */
|
||||
reason?: string;
|
||||
}>;
|
||||
|
||||
getCloudExtensionManager: SyncAPI<[], CloudExtensionManager>;
|
||||
|
||||
/**
|
||||
* ### 监听 WebSocket 连接服务器成功的事件
|
||||
* 表示 WebSocket 的状态变成 open,可以发送数据给服务器。
|
||||
*/
|
||||
onOpen: (
|
||||
callback: (res: {
|
||||
/** 连接服务器返回的 Response Header */
|
||||
header: Record<string, unknown>;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** 监听 WebSocket 与服务器的连接断开的事件 */
|
||||
onClose: (
|
||||
callback: (res: {
|
||||
/** 错误信息 */
|
||||
errMsg?: string;
|
||||
/** 关闭原因 */
|
||||
reason?: string;
|
||||
/** 关闭 code */
|
||||
code?: string | number;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** ### 监听 WebSocket 接收到服务器发送信息的事件。 */
|
||||
onMessage: (
|
||||
callback: (res: {
|
||||
/** 接收到的服务器消息 */
|
||||
data: string | ArrayBuffer;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** ### 监听 WebSocket 发生错误的事件 */
|
||||
onError: (
|
||||
callback: (res: {
|
||||
/** 错误信息 */
|
||||
errMsg: string;
|
||||
}) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
export interface TempFileURL {
|
||||
fileName: string;
|
||||
url: string;
|
||||
maxAge: number;
|
||||
status: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface Cloud {
|
||||
envID: string;
|
||||
serviceID?: string;
|
||||
callContainer: AsyncAPI<
|
||||
{
|
||||
path: string;
|
||||
serviceID?: string;
|
||||
init?: {
|
||||
method?:
|
||||
| "get"
|
||||
| "GET"
|
||||
| "options"
|
||||
| "OPTIONS"
|
||||
| "post"
|
||||
| "POST"
|
||||
| "put"
|
||||
| "PUT"
|
||||
| "delete"
|
||||
| "DELETE"
|
||||
| "trace"
|
||||
| "TRACE"
|
||||
| "patch"
|
||||
| "PATCH";
|
||||
header?: Record<string, string>;
|
||||
body?: object | string | ArrayBuffer;
|
||||
timeout?: number;
|
||||
};
|
||||
},
|
||||
{
|
||||
statusCode: number;
|
||||
header: object;
|
||||
data: string;
|
||||
}
|
||||
>;
|
||||
CloudID: SyncAPI<[string], CloudID>;
|
||||
uploadFile: AsyncAPIWithHandler<
|
||||
{
|
||||
cloudPath: string;
|
||||
filePath: string;
|
||||
timeout?: number;
|
||||
},
|
||||
{},
|
||||
CloudUploadTask
|
||||
>;
|
||||
downloadFile: AsyncAPIWithHandler<
|
||||
{
|
||||
cloudPath: string;
|
||||
filePath?: string;
|
||||
timeout?: number;
|
||||
},
|
||||
{
|
||||
tempFilePath?: string;
|
||||
filePath?: string;
|
||||
},
|
||||
CloudDownloadTask
|
||||
>;
|
||||
deleteFile: AsyncAPI<
|
||||
{
|
||||
cloudPaths: string[];
|
||||
timeout?: number;
|
||||
},
|
||||
{
|
||||
fileLists: DeleteFile[];
|
||||
}
|
||||
>;
|
||||
getTempFileURL: AsyncAPI<
|
||||
{
|
||||
cloudPaths: string[];
|
||||
timeout?: number;
|
||||
maxAge?: number;
|
||||
},
|
||||
{
|
||||
fileLists: TempFileURL[];
|
||||
}
|
||||
>;
|
||||
connectContainer: AsyncAPIWithHandler<
|
||||
{
|
||||
path: string;
|
||||
serviceID?: string;
|
||||
header?: Record<string, unknown>;
|
||||
},
|
||||
{
|
||||
socketTaskId: number;
|
||||
},
|
||||
CloudSocketTask
|
||||
>;
|
||||
}
|
||||
/**
|
||||
* ### 创建托管云实例
|
||||
*/
|
||||
export const createCloud: SyncAPI<
|
||||
[
|
||||
{
|
||||
envID: string;
|
||||
serviceID?: string;
|
||||
}
|
||||
],
|
||||
Cloud
|
||||
>;
|
53
node_modules/@douyin-microapp/typings/api/create-interstitial-ad.d.ts
generated
vendored
Normal file
53
node_modules/@douyin-microapp/typings/api/create-interstitial-ad.d.ts
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 创建插屏广告组件
|
||||
*
|
||||
* 开发者可以在小程序中使用插屏广告获得收入。具体接入方式可参考 [抖音端插屏广告-接入指南](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/functional-plug-in/advertising-component-access-guide/chaping/)
|
||||
*/
|
||||
export const createInterstitialAd: SyncAPI<
|
||||
[{ adUnitId: string }],
|
||||
InterstitialAd
|
||||
>;
|
||||
|
||||
type Callback = (...args: any[]) => any;
|
||||
|
||||
interface InterstitialAd {
|
||||
/** 显示插屏广告 */
|
||||
show: () => Promise<any>;
|
||||
/** 加载插屏广告 */
|
||||
load: () => Promise<any>;
|
||||
/** 销毁插屏广告实例 */
|
||||
destroy: () => Promise<any>;
|
||||
/** 监听插屏广告加载事件 */
|
||||
onLoad: (fn: Callback) => void;
|
||||
/** 取消监听插屏广告加载事件 */
|
||||
offLoad: (fn: Callback) => void;
|
||||
/** 监听插屏错误事件 */
|
||||
onError: (fn: (data: { errMsg: string; errCode: number }) => void) => void;
|
||||
/** 取消监听插屏错误事件 */
|
||||
offError: (fn: Callback) => void;
|
||||
/** 监听插屏广告关闭事件 */
|
||||
onClose: (fn: (data: any) => void) => void;
|
||||
/** 取消监听插屏广告关闭事件 */
|
||||
offClose: (fn: Callback) => void;
|
||||
}
|
54
node_modules/@douyin-microapp/typings/api/create-live-player-context.d.ts
generated
vendored
Normal file
54
node_modules/@douyin-microapp/typings/api/create-live-player-context.d.ts
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 根据 <live-player /> 组件 id 创建可以控制组件的上下文 LivePlayerContext 对象
|
||||
*/
|
||||
export const createLivePlayerContext: SyncAPI<
|
||||
| [
|
||||
/** <live-player /> 组件的 id */
|
||||
id: string,
|
||||
/** 在自定义组件下,当前组件实例的 this,以操作组件内 <live-player /> 组件 */
|
||||
component: object
|
||||
]
|
||||
| [
|
||||
/** <live-player /> 组件的 id */
|
||||
id: string
|
||||
],
|
||||
LivePlayerContext
|
||||
>;
|
||||
|
||||
interface LivePlayerContext {
|
||||
/** 用来控制进入全屏时画面朝向 0代表默认值,正常竖向 90代表屏幕逆时针90度 -90代表屏幕顺时针90度 */
|
||||
direction: number;
|
||||
/** 播放 */
|
||||
play: CallableFunction;
|
||||
/** 停止 */
|
||||
stop: CallableFunction;
|
||||
/** 静音 */
|
||||
mute: CallableFunction;
|
||||
/** 取消静音 */
|
||||
unmute: CallableFunction;
|
||||
/** 进入全屏 */
|
||||
requestFullScreen: CallableFunction;
|
||||
/** 退出全屏 */
|
||||
exitFullScreen: CallableFunction;
|
||||
}
|
101
node_modules/@douyin-microapp/typings/api/create-media-recorder.d.ts
generated
vendored
Normal file
101
node_modules/@douyin-microapp/typings/api/create-media-recorder.d.ts
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
type Start = SyncAPI<[], {}>;
|
||||
type Pause = SyncAPI<[], {}>;
|
||||
type Resume = SyncAPI<[], {}>;
|
||||
type Stop = SyncAPI<[], {}>;
|
||||
type Destroy = SyncAPI<[], {}>;
|
||||
type RequestFrame = SyncAPI<[], {}>;
|
||||
type OnError = SyncAPI<
|
||||
[
|
||||
/**
|
||||
* err 为返回的错误原因
|
||||
*/
|
||||
(err: Error) => void
|
||||
],
|
||||
{}
|
||||
>;
|
||||
type OnStart = SyncAPI<[() => void], {}>;
|
||||
type onStop = SyncAPI<
|
||||
[
|
||||
(info: {
|
||||
/**
|
||||
* The file path of the output video.
|
||||
*/
|
||||
filePath: string;
|
||||
/**
|
||||
* The duration of the output video, in seconds.
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* The file size of the output video, in kb.
|
||||
*/
|
||||
fileSize: number;
|
||||
}) => void
|
||||
],
|
||||
{}
|
||||
>;
|
||||
|
||||
export const createMediaRecorder: SyncAPI<
|
||||
[
|
||||
canvas: unknown,
|
||||
config?: {
|
||||
/**
|
||||
* The width of the output video.
|
||||
* @default 480
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* The height of the output video.
|
||||
* @default 640
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* The bit rate of the output video, in kbps.
|
||||
* @default 3000
|
||||
*/
|
||||
videoBitsPerSecond?: number;
|
||||
/**
|
||||
* The gop(group of pictures) of the output video.
|
||||
* @default 12
|
||||
*/
|
||||
gop?: number;
|
||||
/**
|
||||
* The fps(frame per second) of the outpu video.
|
||||
* This value corresponds to the intended frame rate.
|
||||
* If you set this to 0, media recorder will enter manual mode.
|
||||
* In manual mode, you need to call `requestFrame` to trigger the recording of the canvas.
|
||||
* @default 60
|
||||
*/
|
||||
fps?: number;
|
||||
}
|
||||
],
|
||||
{
|
||||
start: Start;
|
||||
pause: Pause;
|
||||
resume: Resume;
|
||||
stop: Stop;
|
||||
destroy: Destroy;
|
||||
onError: OnError;
|
||||
requestFrame: RequestFrame;
|
||||
}
|
||||
>;
|
79
node_modules/@douyin-microapp/typings/api/create-merchant-order.d.ts
generated
vendored
Normal file
79
node_modules/@douyin-microapp/typings/api/create-merchant-order.d.ts
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
|
||||
interface GoodsInfo {
|
||||
quantity: number;
|
||||
price: number;
|
||||
goodsTitle?: string;
|
||||
goodsPhoto?: string;
|
||||
goodsSubTitle?: string;
|
||||
goodsLabels?: string;
|
||||
goodsId: string;
|
||||
goodsIdType: number;
|
||||
discountAmount: number;
|
||||
dateRule?: string;
|
||||
goodsPage: {
|
||||
path?: string;
|
||||
params?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface ReservationInfo {
|
||||
useReservation: boolean;
|
||||
relationType: number;
|
||||
itemReservations: ReservationItem[];
|
||||
}
|
||||
|
||||
interface ReservationItem {
|
||||
userReserveIds: string[];
|
||||
}
|
||||
|
||||
export const createMerchantOrder: AsyncAPI<
|
||||
{
|
||||
goodsList: GoodsInfo[];
|
||||
totalDiscountAmount: number;
|
||||
totalAmount: number;
|
||||
appId?: string;
|
||||
appType: number;
|
||||
scene: string;
|
||||
launchFrom: string;
|
||||
location: string;
|
||||
phoneNum?: string;
|
||||
contactName?: string;
|
||||
extra?: string;
|
||||
poiId?: string;
|
||||
merchantId?: string;
|
||||
storeName?: string;
|
||||
storeIcon?: string;
|
||||
videoId?: string;
|
||||
callbackData?: string;
|
||||
reservationData?: ReservationInfo[];
|
||||
},
|
||||
{
|
||||
orderId: string;
|
||||
outOrderNo: string;
|
||||
payOrderId: string;
|
||||
orderToken: string;
|
||||
}
|
||||
>;
|
37
node_modules/@douyin-microapp/typings/api/create-offscreen-canvas.d.ts
generated
vendored
Normal file
37
node_modules/@douyin-microapp/typings/api/create-offscreen-canvas.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 创建离屏 canvas 实例
|
||||
*/
|
||||
export const createOffscreenCanvas: SyncAPI<
|
||||
[],
|
||||
/** 离屏 canvas 实例,可通过 tt.createOffscreenCanvas 创建 */
|
||||
OffscreenCanvas
|
||||
>;
|
||||
|
||||
interface OffscreenCanvas {
|
||||
/** 该方法返回 OffscreenCanvas 的绘图上下文 */
|
||||
getContext: (
|
||||
/** canvas 类型,可取值 2d 或 webgl */
|
||||
type: "2d" | "webgl"
|
||||
) => any;
|
||||
}
|
76
node_modules/@douyin-microapp/typings/api/create-order.d.ts
generated
vendored
Normal file
76
node_modules/@douyin-microapp/typings/api/create-order.d.ts
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 开放API-创建订单
|
||||
*/
|
||||
|
||||
interface GoodsInfo {
|
||||
quantity: number;
|
||||
price: number;
|
||||
|
||||
discountAmount?: number; //商品折扣
|
||||
|
||||
goodsName: string; // 商品名
|
||||
goodsPhoto: string; // 商品照片
|
||||
goodsId: string; // 商品 ID
|
||||
goodsType: number; // 商品类型 1 或 2
|
||||
|
||||
goodsSubTitle?: string; // 商品副标题,暂时无需填入
|
||||
goodsLabels?: string[]; // 商品标签
|
||||
dateRule?: string; // 使用规则
|
||||
|
||||
goodsPage?: {
|
||||
path?: string; // 商品详情页路径
|
||||
params?: string; // 详情页路径参数
|
||||
};
|
||||
}
|
||||
export const createOrder: AsyncAPI<
|
||||
{
|
||||
goodsList: GoodsInfo[];
|
||||
|
||||
payment: {
|
||||
totalDiscountAmount?: number;
|
||||
totalAmount: number;
|
||||
};
|
||||
|
||||
appType?: number;
|
||||
|
||||
contactInfo?: {
|
||||
phoneNumber?: string;
|
||||
contactName?: string;
|
||||
};
|
||||
note?: string;
|
||||
merchantInfo?: {
|
||||
merchantId?: string;
|
||||
};
|
||||
|
||||
storeInfo?: {
|
||||
storeName?: string;
|
||||
storeIcon?: string;
|
||||
};
|
||||
|
||||
callbackData?: { [key: string]: unknown };
|
||||
},
|
||||
{
|
||||
orderId: string;
|
||||
outOrderNo: string;
|
||||
}
|
||||
>;
|
43
node_modules/@douyin-microapp/typings/api/create-refund-order.d.ts
generated
vendored
Normal file
43
node_modules/@douyin-microapp/typings/api/create-refund-order.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
|
||||
interface RefundGoods {
|
||||
goods_id: string;
|
||||
goods_id_type: number;
|
||||
refund_quantity: number;
|
||||
}
|
||||
|
||||
export const createRefundOrder: AsyncAPI<
|
||||
{
|
||||
appId: string;
|
||||
reason: string[];
|
||||
type: number;
|
||||
outOrderNo: string;
|
||||
description: string;
|
||||
extra?: string;
|
||||
refundGoods: RefundGoods[];
|
||||
refundTotalAmount?: number;
|
||||
},
|
||||
{ refundId: string; outRefundNo: string; orderId: string }
|
||||
>;
|
53
node_modules/@douyin-microapp/typings/api/create-rewarded-video-ad.d.ts
generated
vendored
Normal file
53
node_modules/@douyin-microapp/typings/api/create-rewarded-video-ad.d.ts
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 开发者可以在小程序中使用激励视频广告获得收入。
|
||||
* 具体接入方式可参考[抖音端激励视频广告接入说明](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/functional-plug-in/advertising-component-access-guide/vibrato-end-video-advertising-incentives/)
|
||||
*/
|
||||
export const createRewardedVideoAd: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 广告位 id */
|
||||
adUnitId: string;
|
||||
}
|
||||
],
|
||||
RewardedVideoAd
|
||||
>;
|
||||
|
||||
type Callback = (...args: any[]) => any;
|
||||
|
||||
interface RewardedVideoAd {
|
||||
/** 广告创建后默认是隐藏的,可以通过该方法显示广告 */
|
||||
show: () => Promise<any>;
|
||||
/** 当广告素材加载出现错误时,可以通过 load 方法手动加载 */
|
||||
load: () => Promise<any>;
|
||||
/** 绑定广告 load 事件的监听器 */
|
||||
onLoad: (fn: Callback) => void;
|
||||
/** 解除绑定 load 事件的监听器 */
|
||||
offLoad: (fn: Callback) => void;
|
||||
/** 绑定 error 事件的监听器 */
|
||||
onError: (fn: (data: { errMsg: string; errCode: number }) => void) => void;
|
||||
/** 解除绑定 error 事件的监听器 */
|
||||
onClose: (fn: (data: { isEnded: boolean }) => void) => void;
|
||||
/** 绑定 close 事件的监听器 */
|
||||
offClose: (fn: Callback) => void;
|
||||
}
|
40
node_modules/@douyin-microapp/typings/api/create-worker.d.ts
generated
vendored
Normal file
40
node_modules/@douyin-microapp/typings/api/create-worker.d.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/** 通信消息类型 */
|
||||
type message = string | boolean | number | object | [] | ArrayBuffer;
|
||||
|
||||
export const createWorker: SyncAPI<
|
||||
[
|
||||
/** worker 线程的绝对路径 */
|
||||
scriptPath: string
|
||||
],
|
||||
workerContext
|
||||
>;
|
||||
|
||||
interface workerContext {
|
||||
/** 监听 worker 线程的消息 */
|
||||
onMessage: SyncAPI<[callback: (msg: message) => void]>;
|
||||
/** 发送消息给 worker 线程 */
|
||||
postMessage: SyncAPI<[message: message]>;
|
||||
/** 销毁 worker 线程 */
|
||||
terminate: SyncAPI<[]>;
|
||||
}
|
60
node_modules/@douyin-microapp/typings/api/download-file.d.ts
generated
vendored
Normal file
60
node_modules/@douyin-microapp/typings/api/download-file.d.ts
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPIWithHandler } from "./types";
|
||||
|
||||
/**
|
||||
* ### 客户端直接发起一个 HTTPS GET 请求, 下载网络文件到本地临时目录
|
||||
*
|
||||
* 单次下载允许的最大文件为 50MB
|
||||
*
|
||||
* 网络相关的 API 在使用前需要配置域名白名单。请参考网络请求使用说明
|
||||
*/
|
||||
export const downloadFile: AsyncAPIWithHandler<
|
||||
{
|
||||
/** 文件地址 */
|
||||
url: string;
|
||||
/** 请求 Header */
|
||||
header?: Record<string, string>;
|
||||
},
|
||||
{
|
||||
/** 文件本地路径 */
|
||||
tempFilePath: string;
|
||||
/** 返回 HTTP 状态码 */
|
||||
statusCode: number;
|
||||
},
|
||||
DownloadTask
|
||||
>;
|
||||
|
||||
interface DownloadTask {
|
||||
/** 中断下载任务 */
|
||||
abort: () => void;
|
||||
|
||||
/** 监听下载任务 */
|
||||
onProgressUpdate: (
|
||||
callback: (res: {
|
||||
/** 下载进度 */
|
||||
progress: number;
|
||||
/** 已经下载的数据长度,单位byte */
|
||||
totalBytesWritten: number;
|
||||
/** 预期需要下载的数据总长度,单位byte */
|
||||
totalBytesExpectedToWrite: number;
|
||||
}) => void
|
||||
) => void;
|
||||
}
|
26
node_modules/@douyin-microapp/typings/api/env.d.ts
generated
vendored
Normal file
26
node_modules/@douyin-microapp/typings/api/env.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
/** ### 环境变量 */
|
||||
export const env: {
|
||||
/** 用户数据存储的路径 */
|
||||
readonly USER_DATA_PATH: string;
|
||||
/** 开发环境 */
|
||||
readonly VERSION: string;
|
||||
};
|
25
node_modules/@douyin-microapp/typings/api/exit-mini-program.d.ts
generated
vendored
Normal file
25
node_modules/@douyin-microapp/typings/api/exit-mini-program.d.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 退出当前小程序到后台。
|
||||
*/
|
||||
export const exitMiniProgram: AsyncAPI;
|
32
node_modules/@douyin-microapp/typings/api/favorite.d.ts
generated
vendored
Normal file
32
node_modules/@douyin-microapp/typings/api/favorite.d.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 在小程序内调起关注小程序的引导组件,用于引导用户关注小程序。
|
||||
*/
|
||||
export const showFavoriteGuide: AsyncAPI<{
|
||||
/** 引导组件类型,可以是 bar(底部弹窗)、tip(顶部气泡)*/
|
||||
type?: string;
|
||||
/** 弹窗文案,最多显示 12 个字符 */
|
||||
content?: string;
|
||||
/** 弹窗类型为 bar 时的位置参数,可以是 bottom(贴近底部)、overtab(悬于页面 tab 区域上方) */
|
||||
position?: string;
|
||||
}>;
|
33
node_modules/@douyin-microapp/typings/api/follow-aweme-user.d.ts
generated
vendored
Normal file
33
node_modules/@douyin-microapp/typings/api/follow-aweme-user.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 一键关注抖音号
|
||||
*
|
||||
* 可以通过 tt.followAwemeUser 接口一键关注
|
||||
*/
|
||||
export const followAwemeUser: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 如果为 true 表示已经关注,为 false 表示未关注 */
|
||||
followed: boolean;
|
||||
}
|
||||
>;
|
33
node_modules/@douyin-microapp/typings/api/follow-official-account.d.ts
generated
vendored
Normal file
33
node_modules/@douyin-microapp/typings/api/follow-official-account.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 关注小程序绑定的头条号
|
||||
*
|
||||
* 可以通过 tt.checkFollowState 接口获取当前关注状态
|
||||
*/
|
||||
export const followOfficialAccount: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 如果为 0 表示关注成功 */
|
||||
errCode: 0 | 1;
|
||||
}
|
||||
>;
|
364
node_modules/@douyin-microapp/typings/api/fs.d.ts
generated
vendored
Normal file
364
node_modules/@douyin-microapp/typings/api/fs.d.ts
generated
vendored
Normal file
@ -0,0 +1,364 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 保存临时文件到用户目录
|
||||
* 用户目录以 ttfile://user 开头
|
||||
*/
|
||||
export const saveFile: SaveFile;
|
||||
|
||||
/** ### 获取 临时目录(ttfile://tmep) 或 用户目录(ttfile://user) 下的文件信息 */
|
||||
export const getFileInfo: GetFileInfo;
|
||||
|
||||
/** ### 获取该小程序下用户目录文件列表, 用户目录以 ttfile://user 开头 */
|
||||
export const getSavedFileList: GetSavedFileList;
|
||||
|
||||
/** ### 删除该小程序下用户目录内的文件, 用户目录以 ttfile://user 开头 */
|
||||
export const removeSavedFile: RemoveSavedFile;
|
||||
|
||||
type ReadFile = AsyncAPI<
|
||||
{
|
||||
/** 要读取的文件的路径 */
|
||||
filePath: string;
|
||||
/** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 */
|
||||
encoding?: string;
|
||||
/** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */
|
||||
position?: number;
|
||||
/** 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */
|
||||
length?: number;
|
||||
},
|
||||
{
|
||||
/** 返回数据 */
|
||||
data: string;
|
||||
}
|
||||
>;
|
||||
|
||||
type RemoveSavedFile = AsyncAPI<{
|
||||
/** 要删除的文件路径, 必须以 ttfile://user 开头 */
|
||||
filePath: string;
|
||||
}>;
|
||||
|
||||
type GetSavedFileList = AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 文件数组,每一项是一个 FileItem */
|
||||
fileList: {
|
||||
/** 文件路径 */
|
||||
filePath: string;
|
||||
/** 本地文件大小,以字节为单位 */
|
||||
size: number;
|
||||
/** 文件保存时的时间戳,从 1970/01/01 08:00:00 到当前时间的秒数 */
|
||||
createTime: number;
|
||||
}[];
|
||||
}
|
||||
>;
|
||||
|
||||
type GetFileInfo = AsyncAPI<
|
||||
{
|
||||
/** 要读取的文件路径 */
|
||||
filePath: string;
|
||||
/** 计算文件指纹的算法 */
|
||||
digestAlgorithm?: string;
|
||||
},
|
||||
{
|
||||
/** 文件大小,以字节为单位 */
|
||||
size: number;
|
||||
/** 按照传入的 digestAlgorithm 计算得出的文件指纹 */
|
||||
digest?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
type SaveFile = AsyncAPI<
|
||||
{
|
||||
/** 文件临时路径 */
|
||||
tempFilePath: string;
|
||||
/** 要存储的路径, 必须以 ttfile://user 开头 */
|
||||
filePath?: string;
|
||||
},
|
||||
{
|
||||
/** 保存后文件路径 */
|
||||
savedFilePath: string;
|
||||
}
|
||||
>;
|
||||
|
||||
interface Stat {
|
||||
/** 文件的类型和存取的权限,对应 POSIX stat.st_mode */
|
||||
mode: string;
|
||||
/** 文件大小,单位:B,对应 POSIX stat.st_size */
|
||||
size: number;
|
||||
/** 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime */
|
||||
lastAccessedTime: number;
|
||||
/** 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime */
|
||||
lastModifiedTime: number;
|
||||
/** 判断当前文件是否一个目录 */
|
||||
isDirectory: () => {};
|
||||
/** 判断当前文件是否一个普通文件 */
|
||||
isFile: () => {};
|
||||
}
|
||||
|
||||
type encoding =
|
||||
| "ascii"
|
||||
| "base64"
|
||||
| "binary"
|
||||
| "hex"
|
||||
| "ucs2"
|
||||
| "ucs-2"
|
||||
| "utf16le"
|
||||
| "utf-16le"
|
||||
| "utf-8"
|
||||
| "utf8"
|
||||
| "latin1";
|
||||
|
||||
/**
|
||||
* ### 获取全局唯一的文件管理器
|
||||
*/
|
||||
export const getFileSystemManager: SyncAPI<
|
||||
[],
|
||||
{
|
||||
/** 读取本地文件内容 */
|
||||
readFile: ReadFile;
|
||||
/** 同步读取本地文件内容 */
|
||||
readFileSync: SyncAPI<
|
||||
[
|
||||
/** 要读取的文件的路径 */
|
||||
filePath: string,
|
||||
/** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 */
|
||||
encoding?: string,
|
||||
/** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */
|
||||
position?: number,
|
||||
/** 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */
|
||||
length?: number
|
||||
],
|
||||
string
|
||||
>;
|
||||
/** 写文件,只能写入用户目录(ttfile://user) */
|
||||
writeFile: AsyncAPI<
|
||||
{
|
||||
/** 要写入的文件路径, 必须以 ttfile://user 开头 */
|
||||
filePath: string;
|
||||
/** 要写入的文本或二进制数据 */
|
||||
data: string;
|
||||
/** 指定写入文件的字符编码 */
|
||||
encoding: encoding;
|
||||
},
|
||||
{}
|
||||
>;
|
||||
/** 同步写文件 */
|
||||
writeFileSync: SyncAPI<
|
||||
[
|
||||
/** 要写入的文件路径, 必须以 ttfile://user 开头 */
|
||||
filePath: string,
|
||||
/** 要写入的文本或二进制数据 */
|
||||
data: string,
|
||||
/** 指定写入文件的字符编码 */
|
||||
encoding: encoding
|
||||
]
|
||||
>;
|
||||
/** 在 用户目录 下创建目录 */
|
||||
mkdir: AsyncAPI<{
|
||||
/** 创建的目录路径, 必须以 ttfile://user 开头 */
|
||||
dirPath: string;
|
||||
/** 是否在递归创建该目录的上级目录后再创建该目录 */
|
||||
recursive?: boolean;
|
||||
}>;
|
||||
/** 同步方法,在 用户目录 下创建目录 */
|
||||
mkdirSync: SyncAPI<
|
||||
[
|
||||
/** 创建的目录路径, 必须以 ttfile://user 开头 */
|
||||
dirPath: string,
|
||||
/** 是否在递归创建该目录的上级目录后再创建该目录 */
|
||||
recursive?: boolean
|
||||
]
|
||||
>;
|
||||
/** 读取目录内文件列表 */
|
||||
readdir: AsyncAPI<
|
||||
{
|
||||
/** 要读取的目录路径 */
|
||||
dirPath: string;
|
||||
},
|
||||
{
|
||||
/** 指定目录下的文件名数组 */
|
||||
files: string[];
|
||||
}
|
||||
>;
|
||||
/** 同步方法,读取目录内文件列表 */
|
||||
readdirSync: SyncAPI<
|
||||
[
|
||||
/** 要读取的目录路径 */
|
||||
dirPath: string
|
||||
],
|
||||
string[]
|
||||
>;
|
||||
/** 删除目录, 只能是 ttfile://user 下的目录 */
|
||||
rmdir: AsyncAPI<{
|
||||
/** 要删除的目录路径,必须以 ttfile://user 开头 */
|
||||
dirPath: string;
|
||||
/** 目录不为空时,是否递归删除 */
|
||||
recursive?: boolean;
|
||||
}>;
|
||||
/** 同步方法,删除目录, 只能是 ttfile://user 下的目录 */
|
||||
rmdirSync: SyncAPI<
|
||||
[
|
||||
/** 要删除的目录路径,必须以 ttfile://user 开头 */
|
||||
dirPath: string,
|
||||
/** 目录不为空时,是否递归删除 */
|
||||
recursive?: boolean
|
||||
]
|
||||
>;
|
||||
/** 判断文件/目录是否存在 */
|
||||
access: AsyncAPI<{
|
||||
/** 要判断是否存在的文件/目录路径 */
|
||||
path: string;
|
||||
}>;
|
||||
/** 同步方法,判断文件/目录是否存在 */
|
||||
accessSync: SyncAPI<
|
||||
[
|
||||
/** 待检测的文件或者目录地址 */
|
||||
path: string
|
||||
]
|
||||
>;
|
||||
/** 删除文件,只能在 ttfile://user 开头的用户目录下操作 */
|
||||
unlink: AsyncAPI<{
|
||||
/** 要删除的文件路径, 必须以 ttfile://user 开头 */
|
||||
filePath: string;
|
||||
}>;
|
||||
/** 同步方法,删除文件,只能删除 用户目录(ttfile://user)下的文件 */
|
||||
unlinkSync: SyncAPI<
|
||||
[
|
||||
/** 要删除的文件路径, 必须以 ttfile://user 开头 */
|
||||
filePath: string
|
||||
]
|
||||
>;
|
||||
/** 获取文件 Stats 对象 */
|
||||
stat: AsyncAPI<
|
||||
{
|
||||
/** 文件/目录路径 */
|
||||
path: string;
|
||||
/** 是否递归获取目录下的每个文件的 Stat 信息 */
|
||||
recursive?: boolean;
|
||||
},
|
||||
{
|
||||
/** Stats 对象 */
|
||||
stat: Stat;
|
||||
stats: Stat | { path: string; stat: Stat }[];
|
||||
}
|
||||
>;
|
||||
/** 同步获取文件 Stats 对象 */
|
||||
statSync: SyncAPI<
|
||||
[
|
||||
/** 文件/目录路径 */
|
||||
path: string,
|
||||
/** 是否递归获取目录下的每个文件的 Stat 信息 */
|
||||
recursive?: boolean
|
||||
],
|
||||
Stat | { path: string; stat: Stat }[]
|
||||
>;
|
||||
/** 重命名文件,可以把文件从 oldPath 移动到 newPath */
|
||||
rename: AsyncAPI<{
|
||||
/** 源文件路径,可以是普通文件或目录,必须以 ttfile://user 开头 */
|
||||
oldPath: string;
|
||||
/** 新文件路径,必须以 ttfile://user 开头 */
|
||||
newPath: string;
|
||||
}>;
|
||||
/** 同步方法,重命名文件,可以把文件从 oldPath 移动到 newPath */
|
||||
renameSync: SyncAPI<
|
||||
[
|
||||
/** 源文件路径,可以是普通文件或目录,必须以 ttfile://user 开头 */
|
||||
oldPath: string,
|
||||
/** 新文件路径,必须以 ttfile://user 开头 */
|
||||
newPath: string
|
||||
]
|
||||
>;
|
||||
/** 复制文件 */
|
||||
copyFile: AsyncAPI<{
|
||||
/** 源文件路径,只可以是普通文件 */
|
||||
srcPath: string;
|
||||
/** 目标文件路径, 必须以 ttfile://user 开头 */
|
||||
destPath: string;
|
||||
}>;
|
||||
/** 同步方法,复制文件 */
|
||||
copyFileSync: SyncAPI<
|
||||
[
|
||||
/** 源文件路径,只可以是普通文件 */
|
||||
srcPath: string,
|
||||
/** 目标文件路径, 必须以 ttfile://user 开头 */
|
||||
destPath: string
|
||||
]
|
||||
>;
|
||||
/** 解压文件 */
|
||||
unzip: AsyncAPI<{
|
||||
/** 源文件路径,只可以是 zip 压缩文件 */
|
||||
zipFilePath: string;
|
||||
/** 目标目录路径, 必须以 ttfile://user 开头 */
|
||||
targetPath: string;
|
||||
}>;
|
||||
/** 保存临时文件到用户目录, 用户目录以 ttfile://user 开头 */
|
||||
saveFileSync: SyncAPI<
|
||||
[
|
||||
/** 文件临时路径 */
|
||||
tempFilePath: string,
|
||||
/** 要存储的路径, 必须以 ttfile://user 开头 */
|
||||
filePath?: string
|
||||
],
|
||||
string
|
||||
>;
|
||||
/** 保存临时文件到用户目录, 用户目录以 ttfile://user 开头 */
|
||||
saveFile: SaveFile;
|
||||
/** 获取 临时目录(ttfile://tmep) 或 用户目录(ttfile://user) 下的文件信息 */
|
||||
getFileInfo: GetFileInfo;
|
||||
/** 获取该小程序下用户目录文件列表, 用户目录以 ttfile://user 开头 */
|
||||
getSavedFileList: GetSavedFileList;
|
||||
/** 删除该小程序下用户目录内的文件, 用户目录以 ttfile://user 开头 */
|
||||
removeSavedFile: RemoveSavedFile;
|
||||
appendFile: AsyncAPI<{
|
||||
/** 目标文件位置 */
|
||||
filePath: string;
|
||||
/** 追加内容数据 */
|
||||
data: string | ArrayBuffer;
|
||||
/** 数据的编码格式 */
|
||||
encoding: encoding;
|
||||
}>;
|
||||
appendFileSync: SyncAPI<
|
||||
[
|
||||
/** 目标文件位置 */
|
||||
filePath: string,
|
||||
/** 追加内容数据 */
|
||||
data: string | ArrayBuffer,
|
||||
/** 数据的编码格式 */
|
||||
encoding: encoding
|
||||
]
|
||||
>;
|
||||
truncate: AsyncAPI<{
|
||||
/** 目标文件路径 */
|
||||
filePath: string;
|
||||
/** 截断位置 */
|
||||
length: number;
|
||||
}>;
|
||||
truncateSync: SyncAPI<
|
||||
[
|
||||
/** 目标文件路径 */
|
||||
filePath: string,
|
||||
/** 截断位置 */
|
||||
length: number
|
||||
]
|
||||
>;
|
||||
}
|
||||
>;
|
37
node_modules/@douyin-microapp/typings/api/get-connected-wifi.d.ts
generated
vendored
Normal file
37
node_modules/@douyin-microapp/typings/api/get-connected-wifi.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 获取设备当前所连的 WiFi 信息
|
||||
*/
|
||||
export const getConnectedWifi: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** Wi-Fi 的 SSID */
|
||||
SSID: string;
|
||||
/** Wi-Fi 的 BSSID */
|
||||
BSSID: string;
|
||||
/** Wi-Fi 是否安全(iOS 由于系统原因暂不支持) */
|
||||
secure: boolean;
|
||||
/** Wi-Fi 信号强度(iOS 由于系统原因暂不支持) */
|
||||
signalStrength: number;
|
||||
}
|
||||
>;
|
57
node_modules/@douyin-microapp/typings/api/get-custom-button-bounding-client-rect.d.ts
generated
vendored
Normal file
57
node_modules/@douyin-microapp/typings/api/get-custom-button-bounding-client-rect.d.ts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 获取左上角logo/返回位置+ 右上角反馈+more+close布局位置信息。坐标信息以屏幕左上角为原点。
|
||||
*/
|
||||
export const getCustomButtonBoundingClientRect: SyncAPI<
|
||||
[],
|
||||
{
|
||||
leftIcon: {
|
||||
/** 宽度 */
|
||||
width: number; // Integer
|
||||
/** 高度 */
|
||||
height: number; // Integer
|
||||
/** 顶部位置 */
|
||||
top: number; // Integer
|
||||
/** 底部位置 */
|
||||
bottom: number; // Integer
|
||||
/** 右侧位置 */
|
||||
right: number; // Integer
|
||||
/** 左侧位置 */
|
||||
left: number; // Integer
|
||||
};
|
||||
capsule: {
|
||||
/** 宽度 */
|
||||
width: number; // Integer
|
||||
/** 高度 */
|
||||
height: number; // Integer
|
||||
/** 顶部位置 */
|
||||
top: number; // Integer
|
||||
/** 底部位置 */
|
||||
bottom: number; // Integer
|
||||
/** 右侧位置 */
|
||||
right: number; // Integer
|
||||
/** 左侧位置 */
|
||||
left: number; // Integer
|
||||
};
|
||||
}
|
||||
>;
|
35
node_modules/@douyin-microapp/typings/api/get-ext-config.d.ts
generated
vendored
Normal file
35
node_modules/@douyin-microapp/typings/api/get-ext-config.d.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 获取第三方平台自定义的数据字段
|
||||
*/
|
||||
export const getExtConfig: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
extConfig: Record<string, unknown>;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* ### 获取第三方平台自定义的数据字段
|
||||
*/
|
||||
export const getExtConfigSync: SyncAPI<[], Record<string, unknown>>;
|
44
node_modules/@douyin-microapp/typings/api/get-image-info.d.ts
generated
vendored
Normal file
44
node_modules/@douyin-microapp/typings/api/get-image-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 获取图片信息。
|
||||
*
|
||||
* 如果要获取网络图片的信息,详见获取[网络图片](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/media/picture/tt-get-image-info/#%E8%8E%B7%E5%8F%96%E7%BD%91%E7%BB%9C%E5%9B%BE%E7%89%87%E4%BF%A1%E6%81%AF)信息说明。
|
||||
*/
|
||||
export const getImageInfo: AsyncAPI<
|
||||
{
|
||||
/** 图片地址 */
|
||||
src: string;
|
||||
},
|
||||
{
|
||||
/** 图片宽度(单位: px) */
|
||||
width: number;
|
||||
/** 图片高度(单位: px) */
|
||||
height: number;
|
||||
/** 图片格式 */
|
||||
type: string;
|
||||
/** 返回图片的本地路径,若为网络图片则该 API 首先会下载图片再返回下载到本地后的临时路径 */
|
||||
path: string;
|
||||
/** 拍照时设备方向 */
|
||||
orientation: string;
|
||||
}
|
||||
>;
|
48
node_modules/@douyin-microapp/typings/api/get-launch-options-sync.d.ts
generated
vendored
Normal file
48
node_modules/@douyin-microapp/typings/api/get-launch-options-sync.d.ts
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 获取小程序启动时的参数
|
||||
*
|
||||
* 其值与 App.onLaunch 方法传入的参数一致,并且不会随着小程序使用而发生变化
|
||||
*/
|
||||
export const getLaunchOptionsSync: SyncAPI<
|
||||
[],
|
||||
{
|
||||
/** 小程序启动页面路径 */
|
||||
path: string;
|
||||
/** 小程序启动场景值 */
|
||||
scene: string;
|
||||
/** 小程序启动参数 */
|
||||
query: Record<string, unknown>;
|
||||
/**
|
||||
* 来源信息
|
||||
* 从另一个小程序进入小程序时返回。否则返回 {}
|
||||
*/
|
||||
referrerInfo: Record<string, unknown>;
|
||||
/**
|
||||
* 唤起小程序页面的来源方式
|
||||
* - 10 表示用户点击小程序入口 schema
|
||||
* - 0 表示其它方式,比如前后台切换
|
||||
*/
|
||||
showFrom?: 0 | 10;
|
||||
}
|
||||
>;
|
62
node_modules/@douyin-microapp/typings/api/get-menu-button-layout.d.ts
generated
vendored
Normal file
62
node_modules/@douyin-microapp/typings/api/get-menu-button-layout.d.ts
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
|
||||
*/
|
||||
export const getMenuButtonBoundingClientRect: SyncAPI<
|
||||
[],
|
||||
{
|
||||
/** 宽度,单位:px */
|
||||
width: number;
|
||||
/** 高度,单位:px */
|
||||
height: number;
|
||||
/** 上边界坐标,单位:px */
|
||||
top: number;
|
||||
/** 右边界坐标,单位:px */
|
||||
right: number;
|
||||
/** 左边界坐标,单位:px */
|
||||
left: number;
|
||||
/** 下边界坐标,单位:px */
|
||||
bottom: number;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
|
||||
*/
|
||||
export const getMenuButtonLayout: SyncAPI<
|
||||
[],
|
||||
{
|
||||
/** 宽度,单位:px */
|
||||
width: number;
|
||||
/** 高度,单位:px */
|
||||
height: number;
|
||||
/** 上边界坐标,单位:px */
|
||||
top: number;
|
||||
/** 右边界坐标,单位:px */
|
||||
right: number;
|
||||
/** 左边界坐标,单位:px */
|
||||
left: number;
|
||||
/** 下边界坐标,单位:px */
|
||||
bottom: number;
|
||||
}
|
||||
>;
|
32
node_modules/@douyin-microapp/typings/api/get-microapp-info.d.ts
generated
vendored
Normal file
32
node_modules/@douyin-microapp/typings/api/get-microapp-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
export const getMicroappInfo: AsyncAPI<
|
||||
{
|
||||
appId?: string;
|
||||
},
|
||||
{
|
||||
name: string;
|
||||
corporateName: string;
|
||||
}
|
||||
>;
|
105
node_modules/@douyin-microapp/typings/api/get-recorder-manager.d.ts
generated
vendored
Normal file
105
node_modules/@douyin-microapp/typings/api/get-recorder-manager.d.ts
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 获取全局唯一的录音管理器
|
||||
*/
|
||||
export const getRecorderManager: SyncAPI<[], RecordManager>;
|
||||
|
||||
interface RecordManager {
|
||||
/**
|
||||
* 开始录音
|
||||
*/
|
||||
start: (params?: {
|
||||
/** 录音自动完成时长,单位 ms, 默认值 60000 */
|
||||
duration?: number;
|
||||
/** 采样率 默认值 8000 */
|
||||
sampleRate?: 8000 | 16000 | 44100;
|
||||
/** 录音通道数,有效值可以是 1 或 2 */
|
||||
numberOfChannels?: 1 | 2;
|
||||
/** 码率, 默认值 48000 */
|
||||
encodeBitRate?: number;
|
||||
/** 帧大小,单位 KB。如果设置了值,那么每当录音内容达到帧大小时会通过 onFrameRecorded 返回内容 */
|
||||
frameSize?: number;
|
||||
}) => void;
|
||||
|
||||
/**
|
||||
* 暂停录音
|
||||
*/
|
||||
pause: () => void;
|
||||
|
||||
/**
|
||||
* 继续录音
|
||||
*/
|
||||
resume: () => void;
|
||||
|
||||
/**
|
||||
* 停止录音
|
||||
*/
|
||||
stop: () => void;
|
||||
|
||||
/**
|
||||
* 注册录音开始回调事件
|
||||
*/
|
||||
onStart: (callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* 注册录音暂停回调事件
|
||||
*/
|
||||
onPause: (callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* 注册录音继续回调事件
|
||||
*/
|
||||
onResume: (callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* 注册录音停止回调事件
|
||||
*/
|
||||
onStop: (
|
||||
callback: (res: {
|
||||
/** 录音文件的地址 */
|
||||
tempFilePath: string;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* 注册监听已录制完指定帧大小的文件事件
|
||||
*
|
||||
* 如果设置了 frameSize,则会回调此事件
|
||||
*/
|
||||
onFrameRecorded: (
|
||||
callback: (res: {
|
||||
/** 录音分片数据 */
|
||||
frameBuffer: ArrayBuffer;
|
||||
/** 当前帧是否正常录音结束前的最后一帧 */
|
||||
isLastFrame: boolean;
|
||||
}) => void
|
||||
) => void;
|
||||
|
||||
/** 注册录音错误事件回调 */
|
||||
onError: (
|
||||
callback: (res: {
|
||||
/** 错误消息 */
|
||||
errMsg: string;
|
||||
}) => void
|
||||
) => void;
|
||||
}
|
51
node_modules/@douyin-microapp/typings/api/get-refund-order.d.ts
generated
vendored
Normal file
51
node_modules/@douyin-microapp/typings/api/get-refund-order.d.ts
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, RefundStatus, StepStatus } from "./types";
|
||||
|
||||
export interface RefundItemInfo {
|
||||
itemOrderId: string;
|
||||
refundAmount: number;
|
||||
userReservations: ReservationItem[];
|
||||
}
|
||||
|
||||
interface ReservationItem {
|
||||
userReserveIds: string[];
|
||||
}
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
export const getRefundOrder: AsyncAPI<
|
||||
{
|
||||
refundId: string;
|
||||
outRefundNo: string;
|
||||
},
|
||||
{
|
||||
refundWay: string;
|
||||
refundQuantity: number;
|
||||
refundId: string;
|
||||
refundReason: string;
|
||||
refundTips: string;
|
||||
refundAmount: number;
|
||||
refundStatus: RefundStatus;
|
||||
refundSteps: StepStatus[];
|
||||
itemOrderList: RefundItemInfo[];
|
||||
secretKey: string;
|
||||
}
|
||||
>;
|
35
node_modules/@douyin-microapp/typings/api/get-shop-record-token.d.ts
generated
vendored
Normal file
35
node_modules/@douyin-microapp/typings/api/get-shop-record-token.d.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, RecordTokenType } from "./types";
|
||||
/**
|
||||
* 白名单 API,小程序绑定的抖音小店的幂等 token
|
||||
*/
|
||||
export const getShopRecordToken: AsyncAPI<
|
||||
{
|
||||
shopId: string;
|
||||
type: RecordTokenType;
|
||||
},
|
||||
{
|
||||
/** "getShopRecordToken:ok" */
|
||||
errMsg: string;
|
||||
/** 幂等 token */
|
||||
recordToken: string;
|
||||
}
|
||||
>;
|
63
node_modules/@douyin-microapp/typings/api/get-user-info.d.ts
generated
vendored
Normal file
63
node_modules/@douyin-microapp/typings/api/get-user-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
interface UserInfo {
|
||||
/** 用户头像 */
|
||||
avatarUrl: string;
|
||||
/** 用户名 */
|
||||
nickName: string;
|
||||
/** 用户性别,0: 未知;1:男性;2:女性 */
|
||||
gender: number;
|
||||
/** 用户城市 */
|
||||
city: string;
|
||||
/** 用户省份 */
|
||||
province: string;
|
||||
/** 用户国家 */
|
||||
country: string;
|
||||
/** 用户语言,目前为空 */
|
||||
language: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ### 获取已登录用户的基本信息或特殊信息
|
||||
*
|
||||
* 首次使用的用户会弹出授权提示窗,若用户同意,则会返回用户的真实数据。
|
||||
*/
|
||||
export const getUserInfo: AsyncAPI<
|
||||
{
|
||||
/** 是否需要返回敏感数据 */
|
||||
withCredentials?: boolean;
|
||||
},
|
||||
{
|
||||
/** "getUserInfo:ok" */
|
||||
errMsg: string;
|
||||
/** userInfo 的 JSON 字符串形式 */
|
||||
rawData: string;
|
||||
/** 用户信息 */
|
||||
userInfo: UserInfo;
|
||||
/** 用于校验用户信息是否被篡改,请参考文档 */
|
||||
signature?: string;
|
||||
/** 包括敏感信息(如 openId)在内的已加密用户数据,如需解密数据请参考文档 */
|
||||
encryptedData?: string;
|
||||
/** 加密算法参数 */
|
||||
iv?: string;
|
||||
}
|
||||
>;
|
60
node_modules/@douyin-microapp/typings/api/get-user-profile.d.ts
generated
vendored
Normal file
60
node_modules/@douyin-microapp/typings/api/get-user-profile.d.ts
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
interface UserInfo {
|
||||
/** 用户头像 */
|
||||
avatarUrl: string;
|
||||
/** 用户名 */
|
||||
nickName: string;
|
||||
/** 用户性别,0: 未知;1:男性;2:女性 */
|
||||
gender: number;
|
||||
/** 用户城市 */
|
||||
city: string;
|
||||
/** 用户省份 */
|
||||
province: string;
|
||||
/** 用户国家 */
|
||||
country: string;
|
||||
/** 用户语言,目前为空 */
|
||||
language: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ### 获取已登录用户的基本信息
|
||||
*
|
||||
* 页面产生点击事件后才可调用,每次调用都会弹出授权提示窗,若用户同意,则会返回用户的真实数据。
|
||||
*/
|
||||
export const getUserProfile: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** "getUserProfile:ok" */
|
||||
errMsg: string;
|
||||
/** userInfo 的 JSON 字符串形式 */
|
||||
rawData: string;
|
||||
/** 用户信息 */
|
||||
userInfo: UserInfo;
|
||||
/** 用于校验用户信息是否被篡改,请参考文档 */
|
||||
signature: string;
|
||||
/** 已加密用户数据,不包含 openId、unionId,如需解密数据请参考文档 */
|
||||
encryptedData: string;
|
||||
/** 加密算法参数 */
|
||||
iv: string;
|
||||
}
|
||||
>;
|
99
node_modules/@douyin-microapp/typings/api/inner-audio.d.ts
generated
vendored
Normal file
99
node_modules/@douyin-microapp/typings/api/inner-audio.d.ts
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 创建并返回内部 audio 上下文 innerAudioContext 实例,通过它能够操作音频播放。
|
||||
*/
|
||||
export const createInnerAudioContext: SyncAPI<[], InnerAudioContext>;
|
||||
|
||||
interface InnerAudioContext {
|
||||
/** 音频资源地址 */
|
||||
src: string;
|
||||
/** 是否自动播放 */
|
||||
autoplay: boolean;
|
||||
/** 是否自动循环 */
|
||||
loop: boolean;
|
||||
/** 是否遵循系统静音开关,当此参数为 false 时,即使用户打开了静音开关,也能继续发出声音 */
|
||||
obeyMuteSwitch: boolean;
|
||||
/** 当前音频总时长(单位 s),只有在当前有合法的 src 时返回,只读 */
|
||||
duration: number;
|
||||
/** 当前音频进度(单位 s),只有在当前有合法的 src 时返回,只读 */
|
||||
currentTime: number;
|
||||
/** 当前音频是否处于暂停状态,只读 */
|
||||
paused: boolean;
|
||||
/** 当前音频已缓冲部分,单位百分比,仅保证当前播放时间点到此时间点内容已缓冲,只读 */
|
||||
buffered: number;
|
||||
/** 当前音量,范围 0 ~ 1,只读 */
|
||||
volume: number;
|
||||
/** 播放 */
|
||||
play: CallableFunction;
|
||||
/** 暂停 */
|
||||
pause: CallableFunction;
|
||||
/** 停止播放。停止后再次播放时从头开始播放 */
|
||||
stop: CallableFunction;
|
||||
/** 销毁当前实例。销毁后该实例将不存在,如需播放需要再次创建 */
|
||||
destroy: CallableFunction;
|
||||
/** 跳转到指定位置播放 */
|
||||
seek: (
|
||||
/** 跳转的时间(单位:s) */
|
||||
options: number
|
||||
) => void;
|
||||
/** 监听音频进入可以播放状态,但不保证后面可以流畅播放 */
|
||||
onCanplay: (callback: () => void) => void;
|
||||
/** 监听音频播放事件 */
|
||||
onPlay: (callback: () => void) => void;
|
||||
/** 监听音频暂停事件 */
|
||||
onPause: (callback: () => void) => void;
|
||||
/** 监听音频停止事件 */
|
||||
onStop: (callback: () => void) => void;
|
||||
/** 监听自然播放结束事件 */
|
||||
onEnded: (callback: () => void) => void;
|
||||
/** 监听音频进度更新事件 */
|
||||
onTimeUpdate: (callback: () => void) => void;
|
||||
/** 监听音频播放错误事件 */
|
||||
onError: (callback: () => void) => void;
|
||||
/** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */
|
||||
onWaiting: (callback: () => void) => void;
|
||||
/** 监听音频开始进行 seek 操作的事件 */
|
||||
onSeeking: (callback: () => void) => void;
|
||||
/** 监听音频完成 seek 操作的事件 */
|
||||
onSeeked: (callback: () => void) => void;
|
||||
/** 取消监听音频进入可以播放状态 */
|
||||
offCanplay: (callback: () => void) => void;
|
||||
/** 取消监听音频播放事件 */
|
||||
offPlay: (callback: () => void) => void;
|
||||
/** 取消监听音频暂停事件 */
|
||||
offPause: (callback: () => void) => void;
|
||||
/** 取消监听音频停止事件 */
|
||||
offStop: (callback: () => void) => void;
|
||||
/** 取消监听自然播放结束事件 */
|
||||
offEnded: (callback: () => void) => void;
|
||||
/** 取消监听音频进度更新事件 */
|
||||
offTimeUpdate: (callback: () => void) => void;
|
||||
/** 取消监听音频播放错误事件 */
|
||||
offError: (callback: () => void) => void;
|
||||
/** 取消监听等待事件 */
|
||||
offWaiting: (callback: () => void) => void;
|
||||
/** 取消监听音频开始进行 seek 操作的事件 */
|
||||
offSeeking: (callback: () => void) => void;
|
||||
/** 取消监听音频完成 seek 操作的事件 */
|
||||
offSeeked: (callback: () => void) => void;
|
||||
}
|
30
node_modules/@douyin-microapp/typings/api/interaction-bar.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/interaction-bar.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 隐藏互动组件
|
||||
*/
|
||||
export const hideInteractionBar: AsyncAPI;
|
||||
|
||||
/**
|
||||
* 显示互动组件
|
||||
*/
|
||||
export const showInteractionBar: AsyncAPI;
|
27
node_modules/@douyin-microapp/typings/api/keyboard.d.ts
generated
vendored
Normal file
27
node_modules/@douyin-microapp/typings/api/keyboard.d.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 收起软键盘
|
||||
*
|
||||
* 在`<input>`、`<textarea>` 等组件中 focus 拉起键盘后调用此接口可以收起键盘。
|
||||
*/
|
||||
export const hideKeyboard: AsyncAPI;
|
40
node_modules/@douyin-microapp/typings/api/live/get-room-info.d.ts
generated
vendored
Normal file
40
node_modules/@douyin-microapp/typings/api/live/get-room-info.d.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
interface RoomInfo {
|
||||
/** 房间id */
|
||||
roomID: string;
|
||||
/** 开播时长,单位为秒 */
|
||||
liveDuration: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* ### 获取直播房间信息
|
||||
*/
|
||||
export const getRoomInfo: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** "getRoomInfo:ok" */
|
||||
errMsg: string;
|
||||
/** 房间信息 */
|
||||
roomInfo: RoomInfo;
|
||||
}
|
||||
>;
|
31
node_modules/@douyin-microapp/typings/api/live/get-self-comment-count-during-plugin-running.d.ts
generated
vendored
Normal file
31
node_modules/@douyin-microapp/typings/api/live/get-self-comment-count-during-plugin-running.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 获取当前用户在小插件运行期间的评论次数
|
||||
*/
|
||||
export const getSelfCommentCountDuringPluginRunning: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
commentCount: number;
|
||||
}
|
||||
>;
|
44
node_modules/@douyin-microapp/typings/api/live/get-user-info.live.d.ts
generated
vendored
Normal file
44
node_modules/@douyin-microapp/typings/api/live/get-user-info.live.d.ts
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
********************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
interface LiveUserInfo {
|
||||
/** 用户的open UID */
|
||||
openUID: string;
|
||||
/** 用户的加密后昵称 */
|
||||
secNickname: string;
|
||||
/** 用户的加密后头像URL */
|
||||
secAvatarURL: string;
|
||||
/** 用户身份,anchor - 主播,audience - 观众 */
|
||||
role: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ### 获取直播房间信息
|
||||
*/
|
||||
export const getLiveUserInfo: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** "getLiveUserInfo:ok" */
|
||||
errMsg: string;
|
||||
/** 房间信息 */
|
||||
userInfo: LiveUserInfo;
|
||||
}
|
||||
>;
|
31
node_modules/@douyin-microapp/typings/api/live/is-following-anchor.d.ts
generated
vendored
Normal file
31
node_modules/@douyin-microapp/typings/api/live/is-following-anchor.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
********************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 当前用户是否已关注主播
|
||||
*/
|
||||
export const isFollowingAnchor: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
isFollowing: boolean;
|
||||
}
|
||||
>;
|
37
node_modules/@douyin-microapp/typings/api/live/on-receive-audiences-follow-action.d.ts
generated
vendored
Normal file
37
node_modules/@douyin-microapp/typings/api/live/on-receive-audiences-follow-action.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "../types";
|
||||
interface FollowInfo {
|
||||
openUID: string;
|
||||
secNickname: string;
|
||||
secAvatarURL: string;
|
||||
action: number; //1-关注、2-取消关注
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
interface Result {
|
||||
followInfoList: FollowInfo[];
|
||||
}
|
||||
/**
|
||||
* ### 监听接收指定的文字评论。
|
||||
*/
|
||||
export const onReceiveAudiencesFollowAction: SyncAPI<
|
||||
[callback: (res: Result) => void]
|
||||
>;
|
37
node_modules/@douyin-microapp/typings/api/live/on-receive-specified-comment.d.ts
generated
vendored
Normal file
37
node_modules/@douyin-microapp/typings/api/live/on-receive-specified-comment.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "../types";
|
||||
interface Comment {
|
||||
openUID: string;
|
||||
secNickname: string;
|
||||
secAvatarURL: string;
|
||||
content: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
interface CommentResult {
|
||||
commentList: Comment[];
|
||||
}
|
||||
/**
|
||||
* ### 监听接收指定的文字评论。
|
||||
*/
|
||||
export const onReceiveSpecifiedComment: SyncAPI<
|
||||
[callback: (res: CommentResult) => void]
|
||||
>;
|
30
node_modules/@douyin-microapp/typings/api/live/subscribe-audiences-follow-action.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/live/subscribe-audiences-follow-action.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 订阅当前直播间观众的关注/取消关注行为
|
||||
*/
|
||||
export const subscribeAudiencesFollowAction: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
33
node_modules/@douyin-microapp/typings/api/live/subscribe-specified-content-comment.d.ts
generated
vendored
Normal file
33
node_modules/@douyin-microapp/typings/api/live/subscribe-specified-content-comment.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 订阅指定内容的文字评论
|
||||
*/
|
||||
export const subscribeSpecifiedContentComment: AsyncAPI<
|
||||
{
|
||||
/** 关键字列表 */
|
||||
keyWordList: string[];
|
||||
},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
33
node_modules/@douyin-microapp/typings/api/live/subscribe-specified-user-comment.d.ts
generated
vendored
Normal file
33
node_modules/@douyin-microapp/typings/api/live/subscribe-specified-user-comment.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 订阅指定用户的文字评论
|
||||
*/
|
||||
export const subscribeSpecifiedUserComment: AsyncAPI<
|
||||
{
|
||||
/** 监听用户openUID */
|
||||
openUIDList: string[];
|
||||
},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-all-specified-content-comment.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-all-specified-content-comment.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 取消订阅全部内容的文字评论
|
||||
*/
|
||||
export const unsubscribeAllSpecifiedContentComment: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-all-specified-user-comment.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-all-specified-user-comment.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 取消监听全部指定用户的文字评论
|
||||
*/
|
||||
export const unsubscribeAllSpecifiedUserComment: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-audiences-follow-action.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/live/unsubscribe-audiences-follow-action.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "../types";
|
||||
|
||||
/**
|
||||
* ### 取消订阅当前直播间观众的关注/取消关注行为
|
||||
*/
|
||||
export const unsubscribeAudiencesFollowAction: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
errMsg: string;
|
||||
}
|
||||
>;
|
34
node_modules/@douyin-microapp/typings/api/loading.d.ts
generated
vendored
Normal file
34
node_modules/@douyin-microapp/typings/api/loading.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 显示灰色背景的 loading 提示框
|
||||
* 该提示框不会主动隐藏。
|
||||
*/
|
||||
export const showLoading: AsyncAPI<{
|
||||
/** 内容,最多显示 7 个汉字长度的文本 */
|
||||
title: string;
|
||||
/** 是否需要遮罩层,防止手势穿透 */
|
||||
mask?: boolean;
|
||||
}>;
|
||||
|
||||
/** 隐藏 loading 提示框 */
|
||||
export const hideLoading: AsyncAPI;
|
122
node_modules/@douyin-microapp/typings/api/location.d.ts
generated
vendored
Normal file
122
node_modules/@douyin-microapp/typings/api/location.d.ts
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 打开地图选择位置
|
||||
*
|
||||
* 需要用户授权 scope.userLocation
|
||||
*
|
||||
* 使用该 API 前可以通过 tt.authorize 提前向用户发起授权请求。
|
||||
*
|
||||
* ```
|
||||
* tt.chooseLocation({
|
||||
* success(res) {
|
||||
* console.log("chooseLocation success: ", res);
|
||||
* },
|
||||
* fail(res) {
|
||||
* console.log("chooseLocation fail: " + res.errMsg);
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const chooseLocation: AsyncAPI<
|
||||
{
|
||||
/** 目标地纬度 */
|
||||
latitude?: number;
|
||||
/** 目标地经度 */
|
||||
longitude?: number;
|
||||
},
|
||||
{
|
||||
/** 位置名称 */
|
||||
name: string;
|
||||
/** 详细地址 */
|
||||
address: string;
|
||||
/** 纬度,范围为 -90 ~ 90,正数表示北,负数表示南。使用 gcj02 国测局坐标系。 */
|
||||
latitude: number;
|
||||
/** 经度,范围为 -180 ~ 180,正数表示东,负数表示西。使用 gcj02 国测局坐标系。 */
|
||||
longitude: number;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* ### 获取设备当前的地理位置
|
||||
*
|
||||
* ```
|
||||
* tt.getLocation({
|
||||
* success(res) {
|
||||
* console.log(`经度${res.longitude}, 纬度${res.latitude}`);
|
||||
* },
|
||||
* fail(res) {
|
||||
* console.log(`getLocation调用失败`);
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const getLocation: AsyncAPI<
|
||||
{
|
||||
/**
|
||||
* 指定坐标系类型,可以是 "wgs84" 或 "gcj02"
|
||||
*
|
||||
* 默认值 "wgs84"
|
||||
*/
|
||||
type?: "wgs84" | "gcj02";
|
||||
/**
|
||||
* 是否开启高精度定位
|
||||
*
|
||||
* 默认值 false
|
||||
*/
|
||||
isHighAccuracy?: boolean;
|
||||
},
|
||||
{
|
||||
/** 纬度,范围为-90 ~ 90,正数表示北,负数表示南 */
|
||||
latitude: number;
|
||||
/** 经度,范围为-180 ~180,正数表示东,负数表示西 */
|
||||
longitude: number;
|
||||
/** 高度,单位 m */
|
||||
altitude: number;
|
||||
/** 位置的精确度 */
|
||||
accuracy: number;
|
||||
/** 垂直精度,单位 m(Android 需要系统 8.0 及以上机型并且开启 GPS,否则返回 0) */
|
||||
verticalAccuracy: number;
|
||||
/** 水平精度,单位 m */
|
||||
horizontalAccuracy: number;
|
||||
/** 速度,单位 m/s */
|
||||
speed: number;
|
||||
/** 定位到的城市信息(iOS 不支持) */
|
||||
city: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* ### 使用内置地图查看位置
|
||||
*/
|
||||
export const openLocation: AsyncAPI<{
|
||||
/** 纬度,范围为 -90 ~ 90,正数表示北,负数表示南 */
|
||||
latitude: number;
|
||||
/** 经度,范围为 -180 ~ 180,正数表示东,负数表示西 */
|
||||
longitude: number;
|
||||
/** 缩放比例,范围 5 ~ 18 */
|
||||
scale?: number;
|
||||
/** 位置名 */
|
||||
name?: string;
|
||||
/** 地址的详细说明 */
|
||||
address?: string;
|
||||
}>;
|
50
node_modules/@douyin-microapp/typings/api/login.d.ts
generated
vendored
Normal file
50
node_modules/@douyin-microapp/typings/api/login.d.ts
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调用该 API 可以获取用户临时的登录凭证
|
||||
*/
|
||||
export const login: AsyncAPI<
|
||||
{
|
||||
/**
|
||||
* 未登录时, 是否强制调起 **宿主** 登录框
|
||||
*
|
||||
* 默认值 `true`
|
||||
*/
|
||||
force?: boolean;
|
||||
},
|
||||
{
|
||||
/**
|
||||
* 临时登录凭证, 有效期 3 分钟
|
||||
*
|
||||
* 开发者可以通过在服务器端调用 **登录凭证校验接口** 换取 `openid` 和 `session_key` 等信息
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* 用于标识当前设备, 无论登录与否都会返回, 有效期 3 分钟
|
||||
*/
|
||||
anonymousCode: string;
|
||||
/**
|
||||
* 判断在当前 APP(头条、抖音等)是否处于登录状态。
|
||||
*/
|
||||
isLogin: boolean;
|
||||
}
|
||||
>;
|
30
node_modules/@douyin-microapp/typings/api/make-phone-call.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/make-phone-call.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调用宿主拨打电话功能
|
||||
*
|
||||
* 用户可以选择拨打电话或取消
|
||||
*/
|
||||
export const makePhoneCall: AsyncAPI<{
|
||||
/** 电话号码 */
|
||||
phoneNumber: string;
|
||||
}>;
|
243
node_modules/@douyin-microapp/typings/api/map.d.ts
generated
vendored
Normal file
243
node_modules/@douyin-microapp/typings/api/map.d.ts
generated
vendored
Normal file
@ -0,0 +1,243 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI, SyncAPI } from "./types";
|
||||
|
||||
export const createMapContext: SyncAPI<
|
||||
[
|
||||
/** <map /> 组件的 id */
|
||||
mapId: string,
|
||||
/** 在自定义组件下,当前组件实例的 this,以操作组件内 <map /> 组件 */
|
||||
component?: object
|
||||
],
|
||||
MapContext
|
||||
>;
|
||||
|
||||
interface MapContext {
|
||||
/** 获取地图中心位置 */
|
||||
getCenterLocation: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
}
|
||||
>;
|
||||
/** 获取地图视野范围 */
|
||||
getRegion: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 西南角经纬度 */
|
||||
southwest: {
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
};
|
||||
/** 东北角经纬度 */
|
||||
northeast: {
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
};
|
||||
}
|
||||
>;
|
||||
/** 将地图中心移置当前定位点。地图能力基于 gcj02 坐标系,请注意入参经纬度信息的转换 */
|
||||
moveToLocation: AsyncAPI<
|
||||
{
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
},
|
||||
{}
|
||||
>;
|
||||
/** 获取地图缩放值 */
|
||||
getScale: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 缩放值 */
|
||||
scale: number;
|
||||
}
|
||||
>;
|
||||
/** 调整可视区域以包含所有给定的坐标点 */
|
||||
includePoints: AsyncAPI<
|
||||
{
|
||||
/** 要显示在可视区域内的坐标点列表 */
|
||||
point: {
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
}[];
|
||||
/** 坐标点形成的矩形边缘到地图边缘的距离,单位: 像素。格式为[上,右,下,左] */
|
||||
padding?: [number, number, number, number];
|
||||
},
|
||||
{}
|
||||
>;
|
||||
/** 平移 marker,带动画 */
|
||||
translateMarker: AsyncAPI<
|
||||
{
|
||||
/** 指定标记物的 id */
|
||||
markerId: number;
|
||||
/** 指定 marker 移动到的目标点 */
|
||||
destination: {
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
};
|
||||
/** 移动过程中是否自动旋转 marker */
|
||||
autoRotate?: boolean;
|
||||
/** marker 的旋转角度 */
|
||||
rotate?: number;
|
||||
/** 平移和旋转同时进行 */
|
||||
moveWithRotate?: boolean;
|
||||
/** 动画持续时长,单位为毫秒,平移与旋转分别计算 */
|
||||
duration?: number;
|
||||
/** 动画结束回调函数 */
|
||||
animationEnd?: () => void;
|
||||
},
|
||||
{}
|
||||
>;
|
||||
/** 沿指定路径移动 marker,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 marker 再次调用 moveAlong 方法,前一次的动画将被打断 */
|
||||
moveAlong: AsyncAPI<
|
||||
{
|
||||
/** 指定 marker 的 id */
|
||||
markerId: number;
|
||||
/** 移动路径的经纬度数组 */
|
||||
path: {
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
}[];
|
||||
/** 根据路径方向自动改变 marker 的旋转角度 */
|
||||
autoRotate?: boolean;
|
||||
/** 平滑移动的时间,单位毫秒 */
|
||||
duration?: number;
|
||||
/** 动画结束的回调函数 */
|
||||
animationEnd?: () => void;
|
||||
},
|
||||
{}
|
||||
>;
|
||||
/** 获取当前地图的旋转角 */
|
||||
getRotate: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 旋转角 */
|
||||
rotate: number;
|
||||
}
|
||||
>;
|
||||
/** 获取当前地图的倾斜角 */
|
||||
getSkew: AsyncAPI<
|
||||
{},
|
||||
{
|
||||
/** 倾斜角 */
|
||||
skew: number;
|
||||
}
|
||||
>;
|
||||
/** 用于将地图经纬度坐标系转换成屏幕坐标系 */
|
||||
mapToScreen: AsyncAPI<
|
||||
{
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
},
|
||||
{
|
||||
/** 经度在地图容器对应的 x 轴像素值 */
|
||||
x: number;
|
||||
/** 纬度在地图容器对应的 y 轴像素值 */
|
||||
y: number;
|
||||
}
|
||||
>;
|
||||
/** 用于将屏幕坐标系转换成地图经纬度坐标系 */
|
||||
screenToMap: AsyncAPI<
|
||||
{
|
||||
/** 横坐标 */
|
||||
x: number;
|
||||
/** 纵坐标 */
|
||||
y: number;
|
||||
},
|
||||
{
|
||||
/** 地图容器中 x 坐标对应的经度 */
|
||||
longitude: number;
|
||||
/** 地图容器中 y 坐标对应的纬度 */
|
||||
latitude: number;
|
||||
}
|
||||
>;
|
||||
}
|
||||
|
||||
type Marker = {
|
||||
/** 经度 */
|
||||
latitude: number;
|
||||
/** 纬度 */
|
||||
longitude: number;
|
||||
} & Partial<{
|
||||
/** 标记点 id */
|
||||
id: number;
|
||||
/** 标注点名,点击时显示,不传则点击无反应 */
|
||||
title: string;
|
||||
/** 图片路径 */
|
||||
iconPath: string;
|
||||
/** 标注图标宽度,默认根据屏幕 DPI 缩放 */
|
||||
width: number;
|
||||
/** 标注图标高度,默认根据屏幕 DPI 缩放 */
|
||||
height: number;
|
||||
/** marker 的显示层级,默认同 marker 插入顺序 */
|
||||
zIndex: number;
|
||||
/** 标记点上方的气泡窗口,支持的属性见 Callout,可识别换行符。有了 callout 将不显示 title */
|
||||
callout: Callout;
|
||||
/** 标注的透明度,范围 0-1 */
|
||||
alpha: number;
|
||||
/** 以标注图标左上角为原点,经纬度锚点相对于标注图标的横向偏移比例,以向右为正向,取值区间为 [0, 1] */
|
||||
anchorX: number;
|
||||
/** 以标注图标左上角为原点,经纬度锚点相对于标注图标的纵向偏移比例,以向下为正向,取值区间为 [0, 1] */
|
||||
anchorY: number;
|
||||
}>;
|
||||
|
||||
type Callout = Partial<{
|
||||
/** 气泡上的文本 */
|
||||
content: string;
|
||||
/** 气泡上文本的颜色,支持 HEX, RGBA, 颜色别名 */
|
||||
color: string;
|
||||
/** 文字大小,单位为 px */
|
||||
fontSize: number;
|
||||
/** 边框圆角,单位为 px */
|
||||
borderRadius: number;
|
||||
/** 文本边缘留白,单位为 px */
|
||||
padding: number;
|
||||
/** 'BYCLICK':点击显示; 'ALWAYS':常显 */
|
||||
display: string;
|
||||
/** 文本对齐方式。有效值: left, right, center */
|
||||
textAlign: string;
|
||||
/** 边框宽度 */
|
||||
borderWidth: number;
|
||||
/** 边框颜色 */
|
||||
borderColor: string;
|
||||
/** 背景色 */
|
||||
bgColor: string;
|
||||
/** 相对于原地位置的横向偏移量,向右为正数 */
|
||||
anchorX: number;
|
||||
/** 相对于原地位置的纵向偏移量,向下为正数 */
|
||||
anchorY: number;
|
||||
}>;
|
55
node_modules/@douyin-microapp/typings/api/media.d.ts
generated
vendored
Normal file
55
node_modules/@douyin-microapp/typings/api/media.d.ts
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/** 选择视频或图片 */
|
||||
export const chooseMedia: AsyncAPI<
|
||||
{
|
||||
/** 最多可以选择的文件个数 */
|
||||
count?: number;
|
||||
/** 支持的媒体类型 */
|
||||
mediaType?: ("image" | "video")[];
|
||||
/** 图片和视频选择的来源 */
|
||||
sourceType?: ("album" | "camera")[];
|
||||
/** 录制视频的最大时长 */
|
||||
maxDuration?: number;
|
||||
/** 仅对 mediaType 为 image 时有效,是否压缩所选文件,默认压缩 */
|
||||
sizeType?: ("compressed" | "original")[];
|
||||
/** 仅在 sourceType 为 camera 时生效,'front' 使用前置摄像头,'back' 使用后置摄像头 */
|
||||
camera?: "front" | "back";
|
||||
},
|
||||
{
|
||||
/** 本地临时文件列表 */
|
||||
tempFiles: {
|
||||
/** 本地临时文件路径 (本地路径) */
|
||||
tempFilePath: string;
|
||||
/** 本地临时文件大小,单位 B */
|
||||
size: number;
|
||||
/** 媒体类型 */
|
||||
mediaType: string;
|
||||
/** 视频的时间长度 */
|
||||
duration?: number;
|
||||
/** 视频的高度 */
|
||||
height?: number;
|
||||
/** 视频的宽度 */
|
||||
width?: number;
|
||||
}[];
|
||||
}
|
||||
>;
|
41
node_modules/@douyin-microapp/typings/api/memory-warning.d.ts
generated
vendored
Normal file
41
node_modules/@douyin-microapp/typings/api/memory-warning.d.ts
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 监听内存不足的告警事件
|
||||
*
|
||||
* 当手机内存占用过高时,触发回调函数。该事件不会杀掉小程序, 建议开发者可以在接受到告警后释放不必要的资源
|
||||
*
|
||||
* Android 下有告警等级划分。
|
||||
*/
|
||||
export const onMemoryWarning: SyncAPI<
|
||||
[
|
||||
callback: (res: {
|
||||
/**
|
||||
* Android 机器上有此字段
|
||||
* - 5 TRIM_MEMORY_RUNNING_MODERATE
|
||||
* - 10 TRIM_MEMORY_RUNNING_LOW
|
||||
* - 15 TRIM_MEMORY_RUNNING_CRITICAL
|
||||
*/
|
||||
level?: number;
|
||||
}) => void
|
||||
]
|
||||
>;
|
38
node_modules/@douyin-microapp/typings/api/modal.d.ts
generated
vendored
Normal file
38
node_modules/@douyin-microapp/typings/api/modal.d.ts
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 显示模态弹窗
|
||||
*
|
||||
* 用于同步用户重要信息,并要求用户进行确认,或执行特定操作以决策下一步骤
|
||||
*/
|
||||
export const showModal: AsyncAPI<{
|
||||
/** 标题 */
|
||||
title?: string;
|
||||
/** 内容 */
|
||||
content?: string;
|
||||
/** 确定按钮的文案, 默认值 "确认", 最多 4 个字符 */
|
||||
confirmText?: string;
|
||||
/** 是否显示取消按钮 */
|
||||
showCancel?: boolean;
|
||||
/** 取消按钮的文案, 最多 4 个字符 */
|
||||
cancelText?: string;
|
||||
}>;
|
28
node_modules/@douyin-microapp/typings/api/navigate-back-mini-program.d.ts
generated
vendored
Normal file
28
node_modules/@douyin-microapp/typings/api/navigate-back-mini-program.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 返回到跳转来的上一个小程序。
|
||||
*/
|
||||
export const navigateBackMiniProgram: AsyncAPI<{
|
||||
/** 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据 */
|
||||
extraData?: object;
|
||||
}>;
|
28
node_modules/@douyin-microapp/typings/api/navigate-to-video-view.d.ts
generated
vendored
Normal file
28
node_modules/@douyin-microapp/typings/api/navigate-to-video-view.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 跳转到分享的视频播放页面。
|
||||
*/
|
||||
export const navigateToVideoView: AsyncAPI<{
|
||||
/** tt.shareAppMessage分享视频成功后返回 */
|
||||
videoId: string;
|
||||
}>;
|
54
node_modules/@douyin-microapp/typings/api/navigation-bar.d.ts
generated
vendored
Normal file
54
node_modules/@douyin-microapp/typings/api/navigation-bar.d.ts
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* 在当前页面显示导航条加载动画。
|
||||
*/
|
||||
export const showNavigationBarLoading: AsyncAPI;
|
||||
|
||||
/**
|
||||
* 在当前页面隐藏导航条加载动画。
|
||||
*/
|
||||
export const hideNavigationBarLoading: AsyncAPI;
|
||||
|
||||
/**
|
||||
* 隐藏返回首页按钮。
|
||||
* 基础库 1.48.0 版本起,当用户打开的小程序最底层页面是非首页时,默认展示【返回首页】按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。
|
||||
*/
|
||||
export const hideHomeButton: AsyncAPI;
|
||||
|
||||
/**
|
||||
* 设置导航栏标题。
|
||||
*/
|
||||
export const setNavigationBarTitle: AsyncAPI<{
|
||||
/** 标题内容 */
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* 设置导航栏颜色。
|
||||
*/
|
||||
export const setNavigationBarColor: AsyncAPI<{
|
||||
/** 前景颜色值,包括按钮、标题、状态栏的颜色,只能取 #ffffff 和 #000000 */
|
||||
frontColor: string;
|
||||
/** 背景颜色值,有效值为十六进制颜色 */
|
||||
backgroundColor: string;
|
||||
}>;
|
121
node_modules/@douyin-microapp/typings/api/navigator.d.ts
generated
vendored
Normal file
121
node_modules/@douyin-microapp/typings/api/navigator.d.ts
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 保留当前页面, 跳转到应用内的某个页面
|
||||
*
|
||||
* 但是不能跳转到 tabbar 页面, 使用 tt.navigateBack 可以返回到原页面
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const navigateTo: AsyncAPI<{
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 关闭当前页面, 返回上一页面或多级页面
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const navigateBack: AsyncAPI<{
|
||||
/**
|
||||
* 返回的页面数, 如果 delta 大于现有页面数
|
||||
*
|
||||
* 默认值 1
|
||||
*/
|
||||
delta?: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 关闭所有页面, 打开到应用内的某个页面
|
||||
*/
|
||||
export const reLaunch: AsyncAPI<{
|
||||
/**
|
||||
* 需要跳转的应用内页面路径
|
||||
*
|
||||
* 路径后可以带参数, 参数与路径之间使用 `?` 分隔, 参数键与参数值用=相连, 不同参数用 `&` 分隔
|
||||
*
|
||||
* 如 `path?key=value&key2=value2`, 如果跳转的页面路径是 tabBar 页面则不能带参数
|
||||
*/
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 关闭当前页面, 跳转到应用内的某个页面
|
||||
*
|
||||
* 不能跳转到 tabBar 页面
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const redirectTo: AsyncAPI<{
|
||||
/**
|
||||
* 需要跳转的应用内页面路径
|
||||
*
|
||||
* 路径后可以带参数, 参数与路径之间使用 `?` 分隔, 参数键与参数值用=相连, 不同参数用 `&` 分隔
|
||||
*
|
||||
* 如 `path?key=value&key2=value2`, 如果跳转的页面路径是 tabBar 页面则不能带参数
|
||||
*/
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 跳转到 tabBar 页面
|
||||
*
|
||||
* 并关闭其他所有非 `tabBar` 页面, 将要跳转到的 `tabBar` 页面需要在 `app.json` 中定义
|
||||
*/
|
||||
export const switchTab: AsyncAPI<{
|
||||
/**
|
||||
* 需要跳转的 `tabBar` 页面的路径
|
||||
*
|
||||
* 需在 `app.json` 的 `tabBar` 字段定义的页面, 路径后不能带参数 */
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ### 返回到跳转来的上一个小程序。
|
||||
*/
|
||||
export const navigateBackMiniProgram: AsyncAPI<{
|
||||
/** 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据 */
|
||||
extraData?: Record<string, unknown>;
|
||||
}>;
|
||||
|
||||
/** ### 跳转到另一个小程序 */
|
||||
export const navigateToMiniProgram: AsyncAPI<{
|
||||
/** 要跳转的小程序 id */
|
||||
appId: string;
|
||||
/** 要跳转的小程序页面路径(不传则默认打开首页), 允许携带 query 参数 */
|
||||
path?: string;
|
||||
/**
|
||||
* 需要传递给目标小程序的数据, 目标小程序可在 App.onLaunch, App.onShow, tt.getLaunchOptionsSync 中获取到这份数据
|
||||
*/
|
||||
extraData?: object;
|
||||
/**
|
||||
* 要打开的小程序版本
|
||||
*
|
||||
* 默认值 "current"
|
||||
*
|
||||
* - current: 线上版
|
||||
* - latest: 测试版 (仅在当前小程序为开发版或测试版时此参数有效
|
||||
*
|
||||
* 如果当前小程序是正式版, 则打开的小程序必定是正式版)
|
||||
*/
|
||||
envVersion?: "current" | "latest";
|
||||
}>;
|
38
node_modules/@douyin-microapp/typings/api/network-status.d.ts
generated
vendored
Normal file
38
node_modules/@douyin-microapp/typings/api/network-status.d.ts
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
type Callback = (res: {
|
||||
/** 网络类型 */
|
||||
networkType: "wifi" | "2g" | "3g" | "4g" | "unknown" | "none";
|
||||
|
||||
/** 当前是否有网络连接 */
|
||||
isConnected: boolean;
|
||||
}) => void;
|
||||
|
||||
/**
|
||||
* ### 监听网络状态变化
|
||||
*/
|
||||
export const onNetworkStatusChange: SyncAPI<[callback: Callback]>;
|
||||
|
||||
/**
|
||||
* ### 取消监听网络状态变化
|
||||
*/
|
||||
export const offNetworkStatusChange: SyncAPI<[callback: Callback]>;
|
30
node_modules/@douyin-microapp/typings/api/off-window-resize.d.ts
generated
vendored
Normal file
30
node_modules/@douyin-microapp/typings/api/off-window-resize.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 关闭对窗口大小的监听
|
||||
*/
|
||||
export const offWindowResize: SyncAPI<
|
||||
[],
|
||||
{
|
||||
offWindowResize: (callback: () => void) => void;
|
||||
}
|
||||
>;
|
38
node_modules/@douyin-microapp/typings/api/on-window-resize.d.ts
generated
vendored
Normal file
38
node_modules/@douyin-microapp/typings/api/on-window-resize.d.ts
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 开启一个监听窗口大小的监听器
|
||||
*/
|
||||
export const onWindowResize: SyncAPI<
|
||||
[],
|
||||
{
|
||||
/** 监听窗口大小 */
|
||||
windowResize: (
|
||||
callback: (res: {
|
||||
/** 窗口宽度 */
|
||||
windowWidth: number;
|
||||
/** 窗口高度 */
|
||||
windowHeight: number;
|
||||
}) => void
|
||||
) => void;
|
||||
}
|
||||
>;
|
26
node_modules/@douyin-microapp/typings/api/open-aweme-user-profile.d.ts
generated
vendored
Normal file
26
node_modules/@douyin-microapp/typings/api/open-aweme-user-profile.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调用跳转个人抖音号主页,用户可以选择关注/取消关注抖音号。
|
||||
* 暂时只支持在抖音 App 上使用。
|
||||
*/
|
||||
export const openAwemeUserProfile: AsyncAPI;
|
34
node_modules/@douyin-microapp/typings/api/page-scroll-to.d.ts
generated
vendored
Normal file
34
node_modules/@douyin-microapp/typings/api/page-scroll-to.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 滚动栈顶的页面到目标位置
|
||||
*/
|
||||
export const pageScrollTo: AsyncAPI<{
|
||||
/** 滚动位置, 单位 px */
|
||||
scrollTop: number;
|
||||
/**
|
||||
* 执行时长, 单位 ms
|
||||
*
|
||||
* 默认值 200
|
||||
*/
|
||||
duration?: number;
|
||||
}>;
|
57
node_modules/@douyin-microapp/typings/api/pay.d.ts
generated
vendored
Normal file
57
node_modules/@douyin-microapp/typings/api/pay.d.ts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调起字节跳动小程序收银台进行支付
|
||||
*
|
||||
* 开发接入之前,请先完成商户入驻流程
|
||||
*
|
||||
*/
|
||||
export const pay: AsyncAPI<
|
||||
{
|
||||
orderInfo: {
|
||||
/** 担保交易服务端订单号 */
|
||||
order_id: string;
|
||||
/** 担保交易订单号 token */
|
||||
order_token: string;
|
||||
};
|
||||
/**
|
||||
* 仅限调试用,上线前去掉该参数
|
||||
*/
|
||||
_debug?: 0 | 1;
|
||||
/**
|
||||
* 固定值: 5(拉起小程序收银台)
|
||||
*/
|
||||
service: 5;
|
||||
},
|
||||
{
|
||||
/**
|
||||
* 只要调起收银台成功,支付状态都会回调 success, 开发者依据返回的 code 值, 进行后续业务逻辑处理
|
||||
* - `0`: 支付成功
|
||||
* - `1`: 支付超时
|
||||
* - `2`: 支付失败
|
||||
* - `3`: 支付关闭
|
||||
* - `4`: 支付取消
|
||||
* - `9`: 订单状态开发者自行获取
|
||||
*/
|
||||
code: number;
|
||||
}
|
||||
>;
|
94
node_modules/@douyin-microapp/typings/api/performance.d.ts
generated
vendored
Normal file
94
node_modules/@douyin-microapp/typings/api/performance.d.ts
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
export const performance: Performance;
|
||||
|
||||
/**
|
||||
* 性能相关
|
||||
*/
|
||||
interface Performance {
|
||||
/** 该方法返回当前缓冲区中的所有性能数据 */
|
||||
getEntries: SyncAPI<[], PerformanceEntry[]>;
|
||||
/** 获取当前缓冲区中所有名称为 [name] 且类型为 [entryType] 的性能数据 */
|
||||
getEntriesByName: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 期望获取的性能数据 name */
|
||||
name: string;
|
||||
/** 期望获取的性能数据 entryType */
|
||||
entryType: string;
|
||||
}
|
||||
],
|
||||
PerformanceEntry[]
|
||||
>;
|
||||
/** 获取当前缓冲区中所有类型为 [entryType] 的性能数据 */
|
||||
getEntriesByType: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 期望获取的性能数据 entryType */
|
||||
entryType: string;
|
||||
}
|
||||
],
|
||||
PerformanceEntry[]
|
||||
>;
|
||||
/** 获取当前缓冲区中当前页面的性能数据 */
|
||||
getCurrentPageEntries: SyncAPI<[], PerformanceEntry[]>;
|
||||
/** 获取当前缓冲区中页面路径为 [pagePath] 的性能数据 */
|
||||
getEntriesByPage: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 期望获取性能数据页面的 pagePath */
|
||||
pagePath: string;
|
||||
}
|
||||
],
|
||||
PerformanceEntry[]
|
||||
>;
|
||||
/** 在性能缓冲区中使用给定名称添加一个 name 为 [name] 的性能数据 */
|
||||
mark: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 期望标记的 name */
|
||||
name: string;
|
||||
}
|
||||
],
|
||||
PerformanceEntry[]
|
||||
>;
|
||||
/** 清空性能缓冲区中 name 为 [name] 的自定义性能数据 */
|
||||
clearMarks: SyncAPI<
|
||||
[
|
||||
{
|
||||
/** 期望清除的自定义性能数据的 name */
|
||||
name: string;
|
||||
}
|
||||
]
|
||||
>;
|
||||
}
|
||||
|
||||
interface PerformanceEntry {
|
||||
/** 该performance entry的名字 */
|
||||
name: string;
|
||||
/** 代表所上报的 performance metric 的 entryType 类型,例如 "mark"、"paint" */
|
||||
entryType: string;
|
||||
/** metric 的上报时间 */
|
||||
startTime: number;
|
||||
/** 持续时间 */
|
||||
duration: number;
|
||||
}
|
36
node_modules/@douyin-microapp/typings/api/preview-image.d.ts
generated
vendored
Normal file
36
node_modules/@douyin-microapp/typings/api/preview-image.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ## 预览一组图片
|
||||
*
|
||||
* Tip:
|
||||
* - 抖音不支持预览图片保存功能。
|
||||
* - 当 urls 中存在多个相同的图片地址,预览时会选择 current 地址对应的第一张图片进行展示,可通过给图片地址增加 query 或 hash 值避免地址重复。
|
||||
*/
|
||||
export const previewImage: AsyncAPI<{
|
||||
/** 需要预览的图片地址列表 */
|
||||
urls: string[];
|
||||
/** 当前显示图片的链接,不填则默认为 urls 中的第一张 */
|
||||
current?: string;
|
||||
/** 是否显示长按菜单 */
|
||||
showmenu?: boolean;
|
||||
}>;
|
23
node_modules/@douyin-microapp/typings/api/pull-down-refresh.d.ts
generated
vendored
Normal file
23
node_modules/@douyin-microapp/typings/api/pull-down-refresh.d.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
export const startPullDownRefresh: AsyncAPI;
|
||||
export const stopPullDownRefresh: AsyncAPI;
|
33
node_modules/@douyin-microapp/typings/api/report-analytics.d.ts
generated
vendored
Normal file
33
node_modules/@douyin-microapp/typings/api/report-analytics.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { SyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 自定义分析数据上报接口
|
||||
*
|
||||
* 调用后,会将数据上报到小程序开发者平台,
|
||||
*
|
||||
* 开发者可以在小程序开发者平台中查看上报数据。
|
||||
*
|
||||
* 使用前,需要在小程序管理后台事件中新建事件,配置好事件名与字段。
|
||||
*/
|
||||
export const reportAnalytics: SyncAPI<
|
||||
[name: string, data: Record<string, unknown>]
|
||||
>;
|
44
node_modules/@douyin-microapp/typings/api/request-subscribe-message.d.ts
generated
vendored
Normal file
44
node_modules/@douyin-microapp/typings/api/request-subscribe-message.d.ts
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) 2022 Bytedance, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
import { AsyncAPI } from "./types";
|
||||
|
||||
/**
|
||||
* ### 调起客户端订阅消息界面,返回用户订阅消息的操作结果。当用户勾选了订阅面板中的 “总是保持以上选择,不再询问” 时,
|
||||
* ### 或是点击了订阅面板中 “拒绝,不再询问” 时,模板消息会被添加到用户的小程序设置页,用户可以在设置页面进行管理。
|
||||
*/
|
||||
export const requestSubscribeMessage: AsyncAPI<
|
||||
{
|
||||
/** 需要订阅的消息模板的 id 的集合,最多支持传入三个 tmplId */
|
||||
tmplIds: [];
|
||||
},
|
||||
{
|
||||
/** "requestSubscribeMessage:ok" */
|
||||
errMsg: string;
|
||||
/** [TEMPLATE_ID]为模板 id,取值见下表
|
||||
* | 值 | 说明 |
|
||||
* | :---- | :---- |
|
||||
* | accept| 用户同意订阅该条 id 对应的模板消息 |
|
||||
* | reject| 用户拒绝订阅该条 id 对应的模板消息 |
|
||||
* | ban | 表示已被后台封禁 |
|
||||
* | fail | 表示该条 id 对应的模版消息授权失败 |
|
||||
*/
|
||||
TEMPLATE_ID: string;
|
||||
}
|
||||
>;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user