初次提交

This commit is contained in:
lipenggao 2024-05-20 09:36:39 +08:00
commit c6557a6b4d
236 changed files with 12314 additions and 0 deletions

51
app.json Normal file
View 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
View File

@ -0,0 +1,10 @@
import { httpRequest } from "./utils/httpReques"
App({
data: {
httpRequest
},
onLaunch: function () {
}
})

32
app.ttss Normal file
View 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;
}

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View 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();
}
}
})

View 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>

View 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
View 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
View 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" />`

View 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
]
>;

View 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;
}
>;

View 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]>;

View 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];
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}>;

View 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;
}

View 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;
}

View 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;
}
>;

View 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";
/**
* ### videolive-playerad
* 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;
}
>;

View 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>;

View 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]>;

View 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;
}
>;

View 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;

View 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;
}
>;

View 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
View 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;

View 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 };
};
}
],
{}
>;

View 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 };
};
}
],
{}
>;

View 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[];
}
>;

View 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
>;

View 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;
}
>;

View 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;
}

View 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
>;

View 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;
}

View 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;
}

View 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;
}
>;

View 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;
}
>;

View 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;
}

View 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;
}
>;

View 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 }
>;

View 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;
}

View 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<[]>;
}

View 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
View 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;
};

View 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;

View 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;
}>;

View 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;
}
>;

View 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
View 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
]
>;
}
>;

View 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;
}
>;

View 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
};
}
>;

View 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>>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}

View 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;

View 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;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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]
>;

View 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]
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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;
}
>;

View 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
View 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
View 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;
/** 垂直精度,单位 mAndroid 需要系统 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
View 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;
}
>;

View 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
View 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
View 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;
}[];
}
>;

View 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
View 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;
}>;

View 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;
}>;

View 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;
}>;

View 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;
}>;

View 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";
}>;

View 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]>;

View 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;
}
>;

View 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;
}
>;

View 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;

View 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
View 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;
}
>;

View 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;
}

View 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;
}>;

View 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;

View 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>]
>;

View 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