@uni-helper/uni-app-types
Version:
为 uni-app 组件提供 TypeScript 类型
2,016 lines (2,015 loc) • 299 kB
text/typescript
import { DefineComponent, StyleValue } from "vue";
//#region src/common.d.ts
type CommonProps = {
class?: any;
style?: StyleValue;
};
//#endregion
//#region src/events/index.d.ts
/** 组件的一些属性值集合 */
interface _EventTarget<Dataset extends Record<string, any> = Record<string, any>> {
/** 事件源组件的id */
id?: string;
/** 当前组件的类型 */
tagName?: string;
/** 事件源组件上由 data- 开头的自定义属性组成的集合 */
dataset?: Dataset;
/** 距离页面顶部的偏移量 */
offsetTop: number;
/** 距离页面左边的偏移量 */
offsetLeft: number;
[key: string]: any;
}
/** 基础事件 */
interface _BaseEvent<Mark extends Record<string, any> = Record<string, any>, CurrentTargetDataset extends Record<string, any> = Record<string, any>, TargetDataset extends Record<string, any> = CurrentTargetDataset> {
/** 事件类型 */
type?: string;
/** 事件生成时的时间戳 */
timeStamp?: number;
/** 事件冒泡路径上所有由 mark: 开头的自定义属性组成的集合 */
mark?: Mark;
/** 触发事件的源组件的一些属性值集合 */
target?: _EventTarget<TargetDataset>;
/** 事件绑定的当前组件的一些属性值集合 */
currentTarget?: _EventTarget<CurrentTargetDataset>;
[key: string]: any;
}
/** 自定义事件 */
interface _CustomEvent<Detail extends Record<string, any> = Record<string, any>, Mark extends Record<string, any> = Record<string, any>, CurrentTargetDataset extends Record<string, any> = Record<string, any>, TargetDataset extends Record<string, any> = CurrentTargetDataset> extends _BaseEvent<Mark, CurrentTargetDataset, TargetDataset> {
/** 额外信息 */
detail: Detail;
[key: string]: any;
}
/** 当前停留在屏幕中的触摸点信息 */
interface _TouchDetail {
/** 标志符 */
identifier?: number;
/** 距离文档左上角的横向距离 */
pageX?: number;
/** 距离文档左上角的纵向距离 */
pageY?: number;
/** 距离页面可显示区域(屏幕除去导航条)左上角的横向距离 */
clientX?: number;
/** 距离页面可显示区域(屏幕除去导航条)左上角的纵向距离 */
clientY?: number;
}
/** 当前停留在 canvas 中的触摸点信息 */
interface _TouchCanvasDetail {
/** 标志符 */
identifier?: number;
/** 距离 canvas 左上角的横向距离 */
x?: number;
/** 距离 canvas 左上角的纵向距离 */
y?: number;
}
/** 触摸事件 */
interface _BaseTouchEvent<Detail extends Record<string, any> = Record<string, any>, T extends _TouchDetail | _TouchCanvasDetail = _TouchDetail, Mark extends Record<string, any> = Record<string, any>, CurrentTargetDataset extends Record<string, any> = Record<string, any>, TargetDataset extends Record<string, any> = CurrentTargetDataset> extends _CustomEvent<Detail, Mark, CurrentTargetDataset, TargetDataset> {
/** 当前停留在屏幕中的触摸点信息的数组 */
touches: T[];
/** 当前变化的触摸点信息的数组 */
changedTouches: T[];
}
/** 触摸事件响应 */
interface _TouchEvent<Detail extends Record<string, any> = Record<string, any>, Mark extends Record<string, any> = Record<string, any>, CurrentTargetDataset extends Record<string, any> = Record<string, any>, TargetDataset extends Record<string, any> = CurrentTargetDataset> extends _BaseTouchEvent<Detail, _TouchDetail, Mark, CurrentTargetDataset, TargetDataset> {}
/** canvas 触摸事件响应 */
interface _TouchCanvasEvent<Mark extends Record<string, any> = Record<string, any>, TargetDataset extends Record<string, any> = Record<string, any>> extends _BaseTouchEvent<never, _TouchCanvasDetail, Mark, never, TargetDataset> {
currentTarget: never;
}
declare global {
namespace UniHelper {
/** 组件的一些属性值集合 */
interface EventTarget extends _EventTarget {}
/** 基础事件 */
interface BaseEvent extends _BaseEvent {}
/** 自定义事件 */
interface CustomEvent extends _CustomEvent {}
/** 当前停留在屏幕中的触摸点信息 */
interface TouchDetail extends _TouchDetail {}
/** 当前停留在 canvas 中的触摸点信息 */
interface TouchCanvasDetail extends _TouchCanvasDetail {}
/** 触摸事件 */
interface BaseTouchEvent extends _BaseTouchEvent {}
/** 触摸事件响应 */
interface TouchEvent extends _TouchEvent {}
/** canvas 触摸事件响应 */
interface TouchCanvasEvent extends _TouchCanvasEvent {}
}
}
//#endregion
//#region src/ad/ad.d.ts
type _AdOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdOnLoad = (event: _AdOnLoadEvent) => void;
interface _AdOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdOnErrorEvent = _CustomEvent<_AdOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdOnError = (event: _AdOnErrorEvent) => void;
type _AdOnCloseEvent = _BaseEvent;
/** 广告关闭的回调 */
type _AdOnClose = (event: _AdOnCloseEvent) => void;
/** 信息流广告属性 */
type _AdProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告单元 id,可在小程序管理后台的流量主模块新建 */
unitId: string;
/**
* 广告自动刷新的间隔时间,必须大于等于 30
*
* 该参数不传入时 Banner 广告不会自动刷新
*
* 单位为 `s`
*/
adIntervals: number;
/** 广告数据,优先级高于 adpid */
data: Record<string, any>;
/** 小程序应用 ID */
appid: string;
/** 小程序广告位 ID */
apid: string;
/**
* Type 为 feeds 时广告左边距,必须大于 0
*
* 单位为 `px`
*/
adLeft: number;
/**
* Type 为 feeds 时广告上边距,必须大于 0
*
* 单位为 `px`
*/
adTop: number;
/**
* Type 为 feeds 时广告宽度,最大值为屏幕宽度,最小值为 265
*
* 单位为 `px`
*
* 默认为 `100%`
*/
adWidth: number;
/**
* Type 为 feeds 时广告高度,最大值为 160,最小值为 85
*
* 单位为 `px`
*/
adHeight: number;
/** 广告类型 */
type: string;
/** 广告加载成功的回调 */
onLoad: _AdOnLoad;
/** 广告加载失败的回调 */
onError: _AdOnError;
/** 广告关闭的回调 */
onClose: _AdOnClose;
}>;
/** 信息流广告 */
type _Ad = DefineComponent<_AdProps>;
/** 信息流广告实例 */
type _AdInstance = InstanceType<_Ad>;
declare global {
namespace UniHelper {
type AdOnLoadEvent = _AdOnLoadEvent;
/** 广告加载成功的回调 */
interface AdOnLoad extends _AdOnLoad {}
interface AdOnErrorDetail extends _AdOnErrorDetail {}
type AdOnErrorEvent = _AdOnErrorEvent;
/** 广告加载失败的回调 */
interface AdOnError extends _AdOnError {}
type AdOnCloseEvent = _AdOnCloseEvent;
/** 广告关闭的回调 */
interface AdOnClose extends _AdOnClose {}
/** 信息流广告属性 */
type AdProps = _AdProps;
/** 信息流广告 */
type Ad = _Ad;
/** 信息流广告实例 */
type AdInstance = _AdInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 信息流广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-component.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
ad: _Ad;
}
}
//#endregion
//#region src/ad/ad-content-page.d.ts
type _AdContentPageOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdContentPageOnLoad = (event: _AdContentPageOnLoadEvent) => void;
interface _AdContentPageOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdContentPageOnErrorEvent = _CustomEvent<_AdContentPageOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdContentPageOnError = (event: _AdContentPageOnErrorEvent) => void;
interface _AdContentPageOnStartDetail {
/** 广告唯一标识 */
id: string;
/**
* 广告类型
*
* `0` 未知类型
*
* `1` 普通信息流
*
* `2` sdk 内部广告
*
* `3` 第三方广告
*
* `4` 直播
*/
type: 0 | 1 | 2 | 3 | 4;
/** 视频总时长 */
duration: number;
}
type _AdContentPageOnStartEvent = _CustomEvent<_AdContentPageOnStartDetail>;
/** 广告开始播放时触发 */
type _AdContentPageOnStart = (event: _AdContentPageOnStartEvent) => void;
interface _AdContentPageOnPauseDetail {
/** 广告唯一标识 */
id: string;
/**
* 广告类型
*
* `0` 未知类型
*
* `1` 普通信息流
*
* `2` sdk 内部广告
*
* `3` 第三方广告
*
* `4` 直播
*/
type: 0 | 1 | 2 | 3 | 4;
/** 视频总时长 */
duration: number;
}
type _AdContentPageOnPauseEvent = _CustomEvent<_AdContentPageOnPauseDetail>;
/** 广告暂停播放时触发 */
type _AdContentPageOnPause = (event: _AdContentPageOnPauseEvent) => void;
interface _AdContentPageOnResumeDetail {
/** 广告唯一标识 */
id: string;
/**
* 广告类型
*
* `0` 未知类型
*
* `1` 普通信息流
*
* `2` sdk 内部广告
*
* `3` 第三方广告
*
* `4` 直播
*/
type: 0 | 1 | 2 | 3 | 4;
/** 视频总时长 */
duration: number;
}
type _AdContentPageOnResumeEvent = _CustomEvent<_AdContentPageOnResumeDetail>;
/** 广告恢复播放时触发 */
type _AdContentPageOnResume = (event: _AdContentPageOnResumeEvent) => void;
interface _AdContentPageOnCompleteDetail {
/** 广告唯一标识 */
id: string;
/**
* 广告类型
*
* `0` 未知类型
*
* `1` 普通信息流
*
* `2` sdk 内部广告
*
* `3` 第三方广告
*
* `4` 直播
*/
type: 0 | 1 | 2 | 3 | 4;
/** 视频总时长 */
duration: number;
}
type _AdContentPageOnCompleteEvent = _CustomEvent<_AdContentPageOnCompleteDetail>;
/** 广告完成播放时触发 */
type _AdContentPageOnComplete = (event: _AdContentPageOnCompleteEvent) => void;
/** 短视频内容联盟广告属性 */
type _AdContentPageProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告加载成功的回调 */
onLoad: _AdContentPageOnLoad;
/** 广告加载失败的回调 */
onError: _AdContentPageOnError;
/** 广告开始播放时触发 */
onStart: _AdContentPageOnStart;
/** 广告暂停播放时触发 */
onPause: _AdContentPageOnPause;
/** 广告恢复播放时触发 */
onResume: _AdContentPageOnResume;
/** 广告完成播放时触发 */
onComplete: _AdContentPageOnComplete;
}>;
/** 短视频内容联盟广告 */
type _AdContentPage = DefineComponent<_AdContentPageProps>;
/** 短视频内容联盟广告实例 */
type _AdContentPageInstance = InstanceType<_AdContentPage>;
declare global {
namespace UniHelper {
type AdContentPageOnLoadEvent = _AdContentPageOnLoadEvent;
/** 广告加载成功的回调 */
interface AdContentPageOnLoad extends _AdContentPageOnLoad {}
interface AdContentPageOnErrorDetail extends _AdContentPageOnErrorDetail {}
type AdContentPageOnErrorEvent = _AdContentPageOnErrorEvent;
/** 广告加载失败的回调 */
interface AdContentPageOnError extends _AdContentPageOnError {}
interface AdContentPageOnStartDetail extends _AdContentPageOnStartDetail {}
type AdContentPageOnStartEvent = _AdContentPageOnStartEvent;
/** 广告开始播放时触发 */
interface AdContentPageOnStart extends _AdContentPageOnStart {}
interface AdContentPageOnPauseDetail extends _AdContentPageOnPauseDetail {}
type AdContentPageOnPauseEvent = _AdContentPageOnPauseEvent;
/** 广告暂停播放时触发 */
interface AdContentPageOnPause extends _AdContentPageOnPause {}
interface AdContentPageOnResumeDetail extends _AdContentPageOnResumeDetail {}
type AdContentPageOnResumeEvent = _AdContentPageOnResumeEvent;
/** 广告恢复播放时触发 */
interface AdContentPageOnResume extends _AdContentPageOnResume {}
interface AdContentPageOnCompleteDetail extends _AdContentPageOnCompleteDetail {}
type AdContentPageOnCompleteEvent = _AdContentPageOnCompleteEvent;
/** 广告完成播放时触发 */
interface AdContentPageOnComplete extends _AdContentPageOnComplete {}
/** 短视频内容联盟广告属性 */
type AdContentPageProps = _AdContentPageProps;
/** 短视频内容联盟广告 */
type AdContentPage = _AdContentPage;
/** 短视频内容联盟广告实例 */
type AdContentPageInstance = _AdContentPageInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 短视频内容联盟广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-content-page.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdContentPage: _AdContentPage;
}
}
//#endregion
//#region src/ad/ad-draw.d.ts
type _AdDrawOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdDrawOnLoad = (event: _AdDrawOnLoadEvent) => void;
interface _AdDrawOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdDrawOnErrorEvent = _CustomEvent<_AdDrawOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdDrawOnError = (event: _AdDrawOnErrorEvent) => void;
/** 沉浸视频流广告属性 */
type _AdDrawProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告数据 */
data: Record<string, any>;
/** 广告加载成功的回调 */
onLoad: _AdDrawOnLoad;
/** 广告加载失败的回调 */
onError: _AdDrawOnError;
}>;
/** 沉浸视频流广告 */
type _AdDraw = DefineComponent<_AdDrawProps>;
/** 沉浸视频流广告实例 */
type _AdDrawInstance = InstanceType<_AdDraw>;
declare global {
namespace UniHelper {
type AdDrawOnLoadEvent = _AdDrawOnLoadEvent;
/** 广告加载成功的回调 */
interface AdDrawOnLoad extends _AdDrawOnLoad {}
interface AdDrawOnErrorDetail extends _AdDrawOnErrorDetail {}
type AdDrawOnErrorEvent = _AdDrawOnErrorEvent;
/** 广告加载失败的回调 */
interface AdDrawOnError extends _AdDrawOnError {}
/** 沉浸视频流广告属性 */
type AdDrawProps = _AdDrawProps;
/** 沉浸视频流广告 */
type AdDraw = _AdDraw;
/** 沉浸视频流广告实例 */
type AdDrawInstance = _AdDrawInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 沉浸视频流广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-draw.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdDraw: _AdDraw;
}
}
//#endregion
//#region src/ad/ad-fullscreen-video.d.ts
type _AdFullscreenVideoOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdFullscreenVideoOnLoad = (event: _AdFullscreenVideoOnLoadEvent) => void;
interface _AdFullscreenVideoOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdFullscreenVideoOnErrorEvent = _CustomEvent<_AdFullscreenVideoOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdFullscreenVideoOnError = (event: _AdFullscreenVideoOnErrorEvent) => void;
type _AdFullscreenVideoOnCloseEvent = _BaseEvent;
/** 广告关闭的回调 */
type _AdFullscreenVideoOnClose = (event: _AdFullscreenVideoOnCloseEvent) => void;
/** 全屏视频广告属性 */
type _AdFullscreenVideoProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 false
*/
loadnext: boolean;
/** 广告加载成功的回调 */
onLoad: _AdFullscreenVideoOnLoad;
/** 广告加载失败的回调 */
onError: _AdFullscreenVideoOnError;
/** 广告关闭的回调 */
onClose: _AdFullscreenVideoOnClose;
}>;
/** 全屏视频广告 */
type _AdFullscreenVideo = DefineComponent<_AdFullscreenVideoProps>;
/** 全屏视频广告实例 */
type _AdFullscreenVideoInstance = InstanceType<_AdFullscreenVideo>;
declare global {
namespace UniHelper {
type AdFullscreenVideoOnLoadEvent = _AdFullscreenVideoOnLoadEvent;
/** 广告加载成功的回调 */
interface AdFullscreenVideoOnLoad extends _AdFullscreenVideoOnLoad {}
interface AdFullscreenVideoOnErrorDetail extends _AdFullscreenVideoOnErrorDetail {}
type AdFullscreenVideoOnErrorEvent = _AdFullscreenVideoOnErrorEvent;
/** 广告加载失败的回调 */
interface AdFullscreenVideoOnError extends _AdFullscreenVideoOnError {}
type AdFullscreenVideoOnCloseEvent = _AdFullscreenVideoOnCloseEvent;
/** 广告关闭的回调 */
interface AdFullscreenVideoOnClose extends _AdFullscreenVideoOnClose {}
/** 全屏视频广告属性 */
type AdFullscreenVideoProps = _AdFullscreenVideoProps;
/** 全屏视频广告 */
type AdFullscreenVideo = _AdFullscreenVideo;
/** 全屏视频广告实例 */
type AdFullscreenVideoInstance = _AdFullscreenVideoInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 全屏视频广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-fullscreen-video.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdFullscreenVideo: _AdFullscreenVideo;
}
}
//#endregion
//#region src/ad/ad-interactive.d.ts
type _AdInteractiveOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdInteractiveOnLoad = (event: _AdInteractiveOnLoadEvent) => void;
interface _AdInteractiveOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdInteractiveOnErrorEvent = _CustomEvent<_AdInteractiveOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdInteractiveOnError = (event: _AdInteractiveOnErrorEvent) => void;
/** 互动广告属性 */
type _AdInteractiveProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string;
/** 点击广告后打开的页面路径 */
openPagePath: string;
/** 广告加载成功的回调 */
onLoad: _AdInteractiveOnLoad;
/** 广告加载失败的回调 */
onError: _AdInteractiveOnError;
}>;
/** 互动广告 */
type _AdInteractive = DefineComponent<_AdInteractiveProps>;
/** 互动广告实例 */
type _AdInteractiveInstance = InstanceType<_AdInteractive>;
declare global {
namespace UniHelper {
type AdInteractiveOnLoadEvent = _AdInteractiveOnLoadEvent;
/** 广告加载成功的回调 */
interface AdInteractiveOnLoad extends _AdInteractiveOnLoad {}
interface AdInteractiveOnErrorDetail extends _AdInteractiveOnErrorDetail {}
type AdInteractiveOnErrorEvent = _AdInteractiveOnErrorEvent;
/** 广告加载失败的回调 */
interface AdInteractiveOnError extends _AdInteractiveOnError {}
/** 互动广告属性 */
type AdInteractiveProps = _AdInteractiveProps;
/** 互动广告 */
type AdInteractive = _AdInteractive;
/** 互动广告实例 */
type AdInteractiveInstance = _AdInteractiveInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 互动广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-interactive.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdInteractive: _AdInteractive;
}
}
//#endregion
//#region src/ad/ad-interstitial.d.ts
type _AdInterstitialOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdInterstitialOnLoad = (event: _AdInterstitialOnLoadEvent) => void;
interface _AdInterstitialOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdInterstitialOnErrorEvent = _CustomEvent<_AdInterstitialOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdInterstitialOnError = (event: _AdInterstitialOnErrorEvent) => void;
type _AdInterstitialOnCloseEvent = _BaseEvent;
/** 广告关闭的回调 */
type _AdInterstitialOnClose = (event: _AdInterstitialOnCloseEvent) => void;
/** 插屏广告属性 */
type _AdInterstitialProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 `false`
*/
loadnext: boolean;
/** 广告加载成功的回调 */
onLoad: _AdInterstitialOnLoad;
/** 广告加载失败的回调 */
onError: _AdInterstitialOnError;
/** 广告关闭的回调 */
onClose: _AdInterstitialOnClose;
}>;
/** 插屏广告 */
type _AdInterstitial = DefineComponent<_AdInterstitialProps>;
/** 插屏广告实例 */
type _AdInterstitialInstance = InstanceType<_AdInterstitial>;
declare global {
namespace UniHelper {
type AdInterstitialOnLoadEvent = _AdInterstitialOnLoadEvent;
/** 广告加载成功的回调 */
interface AdInterstitialOnLoad extends _AdInterstitialOnLoad {}
interface AdInterstitialOnErrorDetail extends _AdInterstitialOnErrorDetail {}
type AdInterstitialOnErrorEvent = _AdInterstitialOnErrorEvent;
/** 广告加载失败的回调 */
interface AdInterstitialOnError extends _AdInterstitialOnError {}
type AdInterstitialOnCloseEvent = _AdInterstitialOnCloseEvent;
/** 广告关闭的回调 */
interface AdInterstitialOnClose extends _AdInterstitialOnClose {}
/** 插屏广告属性 */
type AdInterstitialProps = _AdInterstitialProps;
/** 插屏广告 */
type AdInterstitial = _AdInterstitial;
/** 插屏广告实例 */
type AdInterstitialInstance = _AdInterstitialInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 插屏广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-interstitial.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdInterstitial: _AdInterstitial;
}
}
//#endregion
//#region src/ad/ad-rewarded-video.d.ts
/** 服务器回调透传数据 */
interface _AdRewardedVideoUrlCallback {
userId: string;
extra: string;
}
type _AdRewardedVideoOnLoadEvent = _BaseEvent;
/** 广告加载成功的回调 */
type _AdRewardedVideoOnLoad = (event: _AdRewardedVideoOnLoadEvent) => void;
interface _AdRewardedVideoOnErrorDetail {
/** 错误码 */
errCode: number;
/** 错误信息 */
errMsg: string;
}
type _AdRewardedVideoOnErrorEvent = _CustomEvent<_AdRewardedVideoOnErrorDetail>;
/** 广告加载失败的回调 */
type _AdRewardedVideoOnError = (event: _AdRewardedVideoOnErrorEvent) => void;
type _AdRewardedVideoOnCloseEvent = _BaseEvent;
/** 广告关闭的回调 */
type _AdRewardedVideoOnClose = (event: _AdRewardedVideoOnCloseEvent) => void;
/** 激励视频广告属性 */
type _AdRewardedVideoProps = CommonProps & Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 `false`
*/
loadnext: boolean;
/** 服务器回调透传数据 */
urlCallback: _AdRewardedVideoUrlCallback;
/** 广告加载成功的回调 */
onLoad: _AdRewardedVideoOnLoad;
/** 广告加载失败的回调 */
onError: _AdRewardedVideoOnError;
/** 广告关闭的回调 */
onClose: _AdRewardedVideoOnClose;
}>;
/** 激励视频广告 */
type _AdRewardedVideo = DefineComponent<_AdRewardedVideoProps>;
/** 激励视频广告实例 */
type _AdRewardedVideoInstance = InstanceType<_AdRewardedVideo>;
declare global {
namespace UniHelper {
/** 服务器回调透传数据 */
interface AdRewardedVideoUrlCallback extends _AdRewardedVideoUrlCallback {}
type AdRewardedVideoOnLoadEvent = _AdRewardedVideoOnLoadEvent;
/** 广告加载成功的回调 */
interface AdRewardedVideoOnLoad extends _AdRewardedVideoOnLoad {}
interface AdRewardedVideoOnErrorDetail extends _AdRewardedVideoOnErrorDetail {}
type AdRewardedVideoOnErrorEvent = _AdRewardedVideoOnErrorEvent;
/** 广告加载失败的回调 */
interface AdRewardedVideoOnError extends _AdRewardedVideoOnError {}
type AdRewardedVideoOnCloseEvent = _AdRewardedVideoOnCloseEvent;
/** 广告关闭的回调 */
interface AdRewardedVideoOnClose extends _AdRewardedVideoOnClose {}
/** 激励视频广告属性 */
type AdRewardedVideoProps = _AdRewardedVideoProps;
/** 激励视频广告 */
type AdRewardedVideo = _AdRewardedVideo;
/** 激励视频广告实例 */
type AdRewardedVideoInstance = _AdRewardedVideoInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 激励视频广告
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/uni-ad/ad-rewarded-video.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
AdRewardedVideo: _AdRewardedVideo;
}
}
//#endregion
//#region src/basic-components/icon.d.ts
/** 图标属性 */
type _IconProps = CommonProps & Partial<{
/** 类型 */
type: string;
/**
* 大小
*
* 单位为 px
*
* 默认为 23
*/
size: number;
/** 颜色 */
color: string;
}>;
/** 图标 */
type _Icon = DefineComponent<_IconProps>;
/** 图标实例 */
type _IconInstance = InstanceType<_Icon>;
declare global {
namespace UniHelper {
/** 图标属性 */
type IconProps = _IconProps;
/** 图标 */
type Icon = _Icon;
/** 图标实例 */
type IconInstance = _IconInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 图标
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/icon.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
icon: _Icon;
}
}
//#endregion
//#region src/basic-components/progress.d.ts
/**
* 动画播放方式
*
* Backwards 动画从头播
*
* Forwards 动画从上次结束点接着播
*/
type _ProgressActiveMode = "backwards" | "forwards";
type _ProgressOnActiveendEvent = _BaseEvent;
/** 动画完成时触发 */
type _ProgressOnActiveend = (event: _ProgressOnActiveendEvent) => void;
/** 进度条属性 */
type _ProgressProps = CommonProps & Partial<{
/**
* 百分比
*
* 取值范围为 0 - 100
*
* 没有默认值
*/
percent: number;
/**
* 是否在进度条右侧显示百分比
*
* 默认为 false
*/
showInfo: boolean;
/**
* 圆角大小
*
* 默认为 0
*/
borderRadius: number | string;
/**
* 进度条右侧显示的百分比字体大小
*
* 默认为 16
*/
fontSize: number | string;
/**
* 进度条线的宽度
*
* 单位为 px
*
* 默认为 6
*/
strokeWidth: number;
/**
* 已选择的进度条的颜色
*
* 默认为 #09bb07,百度默认为 #e6e6e6
*/
activeColor: string;
/**
* 未选择的进度条的颜色
*
* 默认为 #ebebeb
*/
backgroundColor: string;
/**
* 是否显示进度条从左往右的动画
*
* 默认为 false
*/
active: boolean;
/**
* 动画播放方式
*
* Backwards 动画从头播
*
* Forwards 动画从上次结束点接着播
*
* 默认为 backwards
*/
activeMode: _ProgressActiveMode;
/**
* 进度增加 1% 所需时间
*
* 单位为 ms
*
* 默认为 30
*/
duration: number;
/** 动画完成时触发 */
onActiveend: _ProgressOnActiveend;
}>;
/** 进度条 */
type _Progress = DefineComponent<_ProgressProps>;
/** 进度条实例 */
type _ProgressInstance = InstanceType<_Progress>;
declare global {
namespace UniHelper {
/**
* 动画播放方式
*
* Backwards 动画从头播
*
* Forwards 动画从上次结束点接着播
*/
type ProgressActiveMode = _ProgressActiveMode;
type ProgressOnActiveendEvent = _ProgressOnActiveendEvent;
/** 动画完成时触发 */
interface ProgressOnActiveend extends _ProgressOnActiveend {}
/** 进度条属性 */
type ProgressProps = _ProgressProps;
/** 进度条 */
type Progress = _Progress;
/** 进度条实例 */
type ProgressInstance = _ProgressInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 进度条
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/progress.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
progress: _Progress;
}
}
declare global {
namespace JSX {
interface IntrinsicElements {
/**
* 进度条
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/progress.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
progress: _ProgressProps;
}
}
}
declare module "vue/jsx-runtime" {
namespace JSX {
interface IntrinsicElements {
/**
* 进度条
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/progress.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
progress: _ProgressProps;
}
}
}
declare module "vue" {
interface IntrinsicElementAttributes {
/**
* 进度条
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/progress.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
progress: _ProgressProps;
}
}
//#endregion
//#region src/basic-components/rich-text.d.ts
/** 显示连续空格 */
type _RichTextSpace = "ensp" | "emsp" | "nbsp";
/** 文本节点 */
interface _RichTextTextNode {
type: "text";
text: string;
}
/** 元素节点 */
interface _RichTextNodeNode {
type?: "node";
name: string;
attrs?: Record<string, any>;
children?: Array<_RichTextTextNode | _RichTextNodeNode>;
}
/** 节点 */
type _RichTextNode = _RichTextTextNode | _RichTextNodeNode;
/** 节点列表 */
type _RichTextNodes = _RichTextNode[] | string;
type _RichTextOnItemclickEvent = _CustomEvent<{
node: _RichTextNode;
}>;
/** 拦截点击事件,支持 a 和 img 标签 */
type _RichTextOnItemclick = (event: _RichTextOnItemclickEvent) => void;
/** 富文本属性 */
type _RichTextProps = CommonProps & Partial<{
/** 节点列表 */
nodes: _RichTextNodes;
/**
* 显示连续空格
*
* 没有默认值
*/
space: _RichTextSpace;
/**
* 富文本是否可以长按选中
*
* 默认为 true
*/
selectable: boolean;
/**
* 是否阻止长按图片时弹起默认菜单
*
* 只在初始化时有效,不支持动态修改
*
* 默认为 false
*/
imageMenuPrevent: boolean;
/**
* 富文本中的图片是否可点击预览
*
* 在不设置的情况下,若 rich-text 未监听点击事件,则默认开启
*
* 未显示设置 preview 时会进行点击默认预览判断,建议显示设置 preview
*/
preview: boolean;
/** 拦截点击事件,支持 a 和 img 标签 */
onItemclick: _RichTextOnItemclick;
}>;
/** 富文本 */
type _RichText = DefineComponent<_RichTextProps>;
/** 富文本实例 */
type _RichTextInstance = InstanceType<_RichText>;
declare global {
namespace UniHelper {
/** 显示连续空格 */
type RichTextSpace = _RichTextSpace;
/** 文本节点 */
interface RichTextTextNode extends _RichTextTextNode {}
/** 元素节点 */
interface RichTextNodeNode extends _RichTextNodeNode {}
/** 节点 */
type RichTextNode = _RichTextNode;
/** 节点列表 */
type RichTextNodes = _RichTextNodes;
type RichTextOnItemclickEvent = _RichTextOnItemclickEvent;
/** 拦截点击事件,支持 a 和 img 标签 */
interface RichTextOnItemclick extends _RichTextOnItemclick {}
/** 富文本属性 */
type RichTextProps = _RichTextProps;
/** 富文本 */
type RichText = _RichText;
/** 富文本实例 */
type RichTextInstance = _RichTextInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 富文本
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/rich-text.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
RichText: _RichText;
}
}
//#endregion
//#region src/basic-components/text.d.ts
/**
* 显示连续空格
*
* Ensp 中文字符空格一半大小
*
* Emsp 中文字符空格大小
*
* Nbsp 根据字体设置的空格大小
*/
type _TextSpace = "ensp" | "emsp" | "nbsp";
/** 文本组件属性 */
type _TextProps = CommonProps & Partial<{
/**
* 文本是否可选
*
* 默认为 false
*/
selectable: boolean;
/**
* 文本是否可选,可能会使文本节点显示为 inline-block
*
* 默认为 false
*/
userSelect: boolean;
/**
* 显示连续空格
*
* Ensp 中文字符空格一半大小
*
* Emsp 中文字符空格大小
*
* Nbsp 根据字体设置的空格大小
*
* 没有默认值
*/
space: _TextSpace;
/**
* 是否解码
*
* 默认为 false
*/
decode: boolean;
}>;
/**
* 文本组件
*
* 用于包裹文本内容
*/
type _Text = DefineComponent<_TextProps>;
/** 文本组件实例 */
type _TextInstance = InstanceType<_Text>;
declare global {
namespace UniHelper {
/**
* 显示连续空格
*
* Ensp 中文字符空格一半大小
*
* Emsp 中文字符空格大小
*
* Nbsp 根据字体设置的空格大小
*/
type TextSpace = _TextSpace;
/** 文本组件属性 */
type TextProps = _TextProps;
/**
* 文本组件
*
* 用于包裹文本内容
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/text.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
type Text = _Text;
/** 文本组件实例 */
type TextInstance = _TextInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/**
* 文本组件
*
* 用于包裹文本内容
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/text.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
text: _Text;
}
}
declare global {
namespace JSX {
interface IntrinsicElements {
/**
* 文本组件
*
* 用于包裹文本内容
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/text.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
text: _TextProps;
}
}
}
declare module "vue/jsx-runtime" {
namespace JSX {
interface IntrinsicElements {
/**
* 文本组件
*
* 用于包裹文本内容
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/text.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
text: _TextProps;
}
}
}
declare module "vue" {
interface IntrinsicElementAttributes {
/**
* 进度条
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/progress.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
text: _TextProps;
}
}
//#endregion
//#region src/canvas/index.d.ts
/** 类型 */
type _CanvasType = "2d" | "webgl";
type _CanvasOnTouchstartEvent = _TouchCanvasEvent;
/** 手指触摸动作开始时触发 */
type _CanvasOnTouchstart = (event: _CanvasOnTouchstartEvent) => void;
type _CanvasOnTouchmoveEvent = _TouchCanvasEvent;
/** 手指触摸后移动时触发 */
type _CanvasOnTouchmove = (event: _CanvasOnTouchmoveEvent) => void;
type _CanvasOnTouchendEvent = _TouchCanvasEvent;
/** 手指触摸动作结束时触发 */
type _CanvasOnTouchend = (event: _CanvasOnTouchendEvent) => void;
type _CanvasOnTouchcancelEvent = _TouchCanvasEvent;
/** 手指触摸动作被打断时触发 */
type _CanvasOnTouchcancel = (event: _CanvasOnTouchcancelEvent) => void;
type _CanvasOnLongtapEvent = _BaseEvent;
/** 手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动 */
type _CanvasOnLongtap = (event: _CanvasOnLongtapEvent) => void;
interface _CanvasOnErrorDetail {
/** 错误信息 */
errMsg: string;
}
type _CanvasOnErrorEvent = _CustomEvent<_CanvasOnErrorDetail>;
/** 发生错误时触发 */
type _CanvasOnError = (event: _CanvasOnErrorEvent) => void;
/** 画布属性 */
type _CanvasProps = CommonProps & Partial<{
/** 类型 */
type: _CanvasType;
/** 唯一标识符 */
canvasId: string;
/**
* 当在 canvas 中移动时且有绑定手势事件时,是否禁止屏幕滚动以及下拉刷新
*
* 默认为 false
*/
disableScroll: boolean;
/**
* 是否启用高清处理
*
* 默认为 true
*/
hidpi: boolean;
/** 手指触摸动作开始时触发 */
onTouchstart: _CanvasOnTouchstart;
/** 手指触摸后移动时触发 */
onTouchmove: _CanvasOnTouchmove;
/** 手指触摸动作结束时触发 */
onTouchend: _CanvasOnTouchend;
/** 手指触摸动作被打断时触发 */
onTouchcancel: _CanvasOnTouchcancel;
/** 手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动 */
onLongtap: _CanvasOnLongtap;
/** 发生错误时触发 */
onError: _CanvasOnError;
}>;
/** 画布 */
type _Canvas = DefineComponent<_CanvasProps>;
/** 画布实例 */
type _CanvasInstance = InstanceType<_Canvas>;
declare global {
namespace UniHelper {
/** 类型 */
type CanvasType = _CanvasType;
type CanvasOnTouchstartEvent = _CanvasOnTouchstartEvent;
/** 手指触摸动作开始时触发 */
interface CanvasOnTouchstart extends _CanvasOnTouchstart {}
type CanvasOnTouchmoveEvent = _CanvasOnTouchmoveEvent;
/** 手指触摸后移动时触发 */
interface CanvasOnTouchmove extends _CanvasOnTouchmove {}
type CanvasOnTouchendEvent = _CanvasOnTouchendEvent;
/** 手指触摸动作结束时触发 */
interface CanvasOnTouchend extends _CanvasOnTouchend {}
type CanvasOnTouchcancelEvent = _CanvasOnTouchcancelEvent;
/** 手指触摸动作被打断时触发 */
interface CanvasOnTouchcancel extends _CanvasOnTouchcancel {}
type CanvasOnLongtapEvent = _CanvasOnLongtapEvent;
/** 手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动 */
interface CanvasOnLongtap extends _CanvasOnLongtap {}
interface CanvasOnErrorDetail extends _CanvasOnErrorDetail {}
type CanvasOnErrorEvent = _CanvasOnErrorEvent;
/** 发生错误时触发 */
interface CanvasOnError extends _CanvasOnError {}
/** 画布属性 */
type CanvasProps = _CanvasProps;
/** 画布 */
type Canvas = _Canvas;
/** 画布实例 */
type CanvasInstance = _CanvasInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/** 画布
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/canvas.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
canvas: _Canvas;
}
}
declare global {
namespace JSX {
interface IntrinsicElements {
/** 画布
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/canvas.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
canvas: _CanvasProps;
}
}
}
declare module "vue/jsx-runtime" {
namespace JSX {
interface IntrinsicElements {
/** 画布
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/canvas.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
canvas: _CanvasProps;
}
}
}
declare module "vue" {
interface IntrinsicElementAttributes {
/** 画布
* ***
* [👉🏻点击查看组件文档](https://uniapp.dcloud.net.cn/component/canvas.html)
* |
* [使用说明](https://uni-typed.netlify.app/)
*/
canvas: _CanvasProps;
}
}
//#endregion
//#region src/form-components/button.d.ts
/**
* 按钮的大小
*
* Default 默认
*
* Mini 小
*/
type _ButtonSize = "default" | "mini";
/**
* 按钮的样式类型,如想在多端统一颜色,请用 default 然后自行写样式
*
* Primary 微信小程序、360 小程序为绿色,APP、H5、百度小程序、支付宝小程序、飞书小程序、快应用为蓝色,字节跳动小程序为红色,QQ
* 小程序为浅蓝色
*
* Default 白色
*
* Warn 红色
*/
type _ButtonType = "primary" | "default" | "warn";
/**
* 用于 form 组件,点击分别会触发 form 组件的 submit / reset 事件
*
* Submit 点击会触发 form 的 submit 事件
*
* Reset 点击会触发 form 的 reset 事件
*/
type _ButtonFormType = "submit" | "reset";
/**
* 开放能力
*
* Feedback 打开“意见反馈”页面,用户可提交反馈内容并上传日志
*
* Share 触发用户转发
*
* GetUserInfo 获取用户信息,可以从 `@getuserinfo` 回调中获取到用户信息
*
* Contact 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 `@contact` 回调中获得具体信息
*
* GetPhoneNumber 获取用户手机号,可以从 `@getphonenumber` 回调中获取到用户信息
*
* GetRealtimePhoneNumber 手机号实时验证,可以从 `@getrealtimephonenumber` 回调中获取到用户信息
*
* LaunchApp 小程序中打开APP,可以通过 `app-parameter` 属性设定向 APP 传的参数
*
* OpenSetting 打开授权设置页
*
* ChooseAvatar 获取用户头像,可以从 `@chooseavatar` 回调中获取到头像信息
*
* GetAuthorize 支持小程序授权
*
* Lifestyle 关注生活号
*
* ContactShare 分享到通讯录好友
*
* OpenGroupProfile 呼起 QQ 群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时 manifest.json
* 中必须配置 groupIdList
*
* OpenGuildProfile 呼起频道页面,可以通过 guild-id 属性设定需要打开的频道 ID
*
* OpenPublicProfile 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时 manifest.json
* 中必须配置 publicIdList
*
* ShareMessageToFriend 在自定义开放数据域组件中,向指定好友发起分享
*
* AddFriend 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权
*
* AddColorSign 添加彩签,点击后添加状态有用户提示,无回调
*
* AddGroupApp 添加群应用(只有管理员或群主有权操作),添加后给 button 绑定 `@addgroupapp` 事件接收回调数据
*
* AddToFavorites 收藏当前页面,点击按钮后会触发 Page.onAddToFavorites 方法
*
* ChooseAddress 选择用户收货地址,可以从 `@chooseaddress` 回调中获取到用户选择的地址信息
*
* ChooseInvoiceTitle 选择用户发票抬头,可以从 `@chooseinvoicetitle` 回调中获取到用户选择发票抬头信息
*
* Login 登录,可以从 `@login` 回调中确认是否登录成功
*
* Subscribe 订阅类模板消息,需要用户授权才可发送
*
* Favorite 触发用户收藏
*
* WatchLater 触发用户稍后再看
*
* OpenProfile 触发打开用户主页
*
* AgreePrivacyAuthorization 用户同意隐私协议按钮
*/
type _ButtonOpenType = "feedback" | "share" | "getUserInfo" | "contact" | "getPhoneNumber" | "getRealtimePhoneNumber" | "launchApp" | "openSetting" | "chooseAvatar" | "getAuthorize" | "lifestyle" | "contactShare" | "openGroupProfile" | "openGuildProfile" | "openPublicProfile" | "shareMessageToFriend" | "addFriend" | "addColorSign" | "addGroupApp" | "addToFavorites" | "chooseAddress" | "chooseInvoiceTitle" | "login" | "subscribe" | "favorite" | "watchLater" | "openProfile" | "agreePrivacyAuthorization";
/**
* 返回用户信息的语言
*
* Zh_CN 简体中文
*
* Zh_TW 繁体中文
*
* En 英文
*/
type _ButtonLang = "zh_CN" | "zh_TW" | "en";
interface _ButtonOnGetphonenumberDetail {
/** 错误信息 */
errMsg?: string;
/** 动态令牌 */
code?: string;
/** 包括敏感数据在内的完整用户信息的加密数据 */
encryptedData?: string;
/** 加密算法的初始向量 */
iv?: string;
/** 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据 */
cloudID?: string;
}
type _ButtonOnGetphonenumberEvent = _CustomEvent<_ButtonOnGetphonenumberDetail>;
/**
* 获取用户手机号时回调
*
* Open-type="getPhoneNumber" 时有效
*/
type _ButtonOnGetphonenumber = (event: _ButtonOnGetphonenumberEvent) => void;
interface _ButtonOnGetrealtimephonenumberDetail {
/** 错误信息 */
errMsg?: string;
/** 错误码(失败时返回) */
errno?: number;
/** 动态令牌 */
code?: string;
/** 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据 */
cloudID?: string;
}
type _ButtonOnGetrealtimephonenumberEvent = _CustomEvent<_ButtonOnGetrealtimephonenumberDetail>;
/**
* 手机号实时验证回调
*
* Open-type="getRealtimePhoneNumber" 时有效
*/
type _ButtonOnGetrealtimephonenumber = (event: _ButtonOnGetrealtimephonenumberEvent) => void;
type _ButtonOnErrorEvent = _BaseEvent;
/** 使用开放能力发生错误时回调 */
type _ButtonOnError = (event: _ButtonOnErrorEvent) => void;
interface _ButtonOnOpensettingDetail {
authSetting: Record<string, any>;
}
type _ButtonOnOpensettingEvent = _CustomEvent<_ButtonOnOpensettingDetail>;
/**
* 在打开授权设置页并关闭后回调
*
* Open-type="openSetting" 时有效
*/
type _ButtonOnOpensetting = (event: _ButtonOnOpensettingEvent) => void;
type _ButtonOnLaunchappEvent = _BaseEvent;
/**
* 从小程序成功打开 APP 回调
*
* Open-type="launchApp" 时有效
*/
type _ButtonOnLaunchapp = (event: _ButtonOnLaunchappEvent) => void;
type _ButtonOnChooseavatarEvent = _BaseEvent;
/**
* 获取用户头像回调
*
* Open-type="chooseAvatar" 时有效
*/
type _ButtonOnChooseavatar = (event: _ButtonOnChooseavatarEvent) => void;
type _ButtonOnAddgroupappEvent = _BaseEvent;
/**
* 添加群应用回调
*
* Open-type="addGroupApp" 时有效
*/
type _ButtonOnAddgroupapp = (event: _ButtonOnAddgroupappEvent) => void;
type _ButtonOnChooseaddressEvent = _BaseEvent;
/**
* 用户编辑并选择收货地址回调
*
* Open-type="chooseAddress" 时有效
*/
type _ButtonOnChooseaddress = (event: _ButtonOnChooseaddressEvent) => void;
type _ButtonOnChooseinvoicetitleEvent = _BaseEvent;
/**
* 用户选择发票抬头回调
*
* Open-type="chooseInvoiceTitle" 时有效
*/
type _ButtonOnChooseinvoicetitle = (event: _ButtonOnChooseinvoicetitleEvent) => void;
type _ButtonOnSubscribeEvent = _BaseEvent;
/**
* 订阅消息授权回调
*
* Open-type="subscribe" 时有效
*/
type _ButtonOnSubscribe = (event: _ButtonOnSubscribeEvent) => void;
type _ButtonOnLoginEvent = _BaseEvent;
/**
* 登录回调
*
* Open-type="login" 时有效
*/
type _ButtonOnLogin = (event: _ButtonOnLoginEvent) => void;
type _ButtonOnAgreeprivacyauthorizationEvent = _BaseEvent;
/**
* 用户同意隐私协议按钮回调
*
* Open-type="agreePrivacyAuthorization" 时有效
*/
type _ButtonOnAgreeprivacyauthorization = (event: _ButtonOnAgreeprivacyauthorizationEvent) => void;
/** 按钮属性 */
type _ButtonProps = CommonProps & Partial<{
/**
* 按钮的大小
*
* Default 默认
*
* Mini 小
*
* 默认为 default
*/
size: _ButtonSize;
/**
* 按钮的样式类型
*
* Primary 微信小程序、360 小程序为绿色,APP、H5、百度小程序、支付宝小程序、飞书小程序、快应用为蓝色,字节跳动小程序为红色,QQ
* 小程序为浅蓝色
*
* Default 白色
*
* Warn 红色
*
* 默认为 default
*/
type: _ButtonType;
/**
* 按钮是否镂空,背景色透明
*
* 默认为 false
*/
plain: boolean;
/** 是否禁用 */
disabled: boolean;
/**
* 是否带 loading 图标
*
* 默认为 false
*/
loading: boolean;
/**
* 用于 form 组件,点击分别会触发 form 组件的 submit / reset 事件
*
* Submit 点击会触发 form 的 submit 事件
*
* Reset 点击会触发 form 的 reset 事件
*
* 没有默认值
*/
formType: _ButtonFormType;
/**
* 开放能力
*
* Feedback 打开“意见反馈”页面,用户可提交反馈内容并上传日志
*
* Share 触发用户转发
*
* GetUserInfo 获取用户信息,可以从 `@getuserinfo` 回调中获取到用户信息
*
* Contact 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 `@contact` 回调中获得具体信息
*
* GetPhoneNumber 获取用户手机号,可以从 `@getphonenumber` 回调中获取到用户信息
*
* GetRealtimePhoneNumber 手机号实时验证,可以从 `@getrealtimephonenumber` 回调中获取到用户信息
*
* LaunchApp 小程序中打开APP,可以通过 `app-parameter` 属性设定向 APP 传的参数
*
* OpenSetting 打开授权设置页
*
* ChooseAvatar 获取用户头像,可以从 `@chooseavatar` 回调中获取到头像信息
*
* GetAuthorize 支持小程序授权
*
* Lifestyle 关注生活号
*
* ContactShare 分享到通讯录好友
*
* OpenGroupProfile 呼起 QQ 群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时
* manifest.json 中必须配置 groupIdList
*
* OpenGuildProfile 呼起频道页面,可以通过 guild-id 属性设定需要打开的频道 ID
*
* OpenPublicProfile 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时
* manifest.json 中必须配置 publicIdList
*
* ShareMessageToFriend 在自定义开放数据域组件中,向指定好友发起分享
*
* AddFriend 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权
*
* AddColorSign 添加彩签,点击后添加状态有用户提示,无回调
*
* AddGroupApp 添加群应用(只有管理员或群主有权操作),添加后给 button 绑定 `@addgroupapp` 事件接收回调数据
*
* AddToFavorites 收藏当前页面,点击按钮后会触发 Page.onAddToFavorites 方法
*
* ChooseAddress 选择用户收货地址,可以从 `@chooseaddress` 回调中获取到用户选择的地址信息
*
* ChooseInvoiceTitle 选择用户发票抬头,可以从 `@chooseinvoicetitle` 回调中获取到用户选择发票抬头信息
*
* Login 登录,可以从 `@login` 回调中确认是否登录成功
*
* Subscribe 订阅类模板消息,需要用户授权才可发送
*
* Favorite 触发用户收藏
*
* WatchLater 触发用户稍后再看
*
* OpenProfile 触发打开用户主页
*/
openType: _ButtonOpenType;
/**
* 当手机号快速验证或手机号实时验证额度用尽时,
* 是否对用户展示“申请获取你的手机号,但该功能
* 使用次数已达当前小程序上限,暂时无法使用”的
* 提示。
* @default true
*/
phoneNumberNoQuotaToast?: boolean;
/**
* 指定按下去的样式类
*
* 当 hover-class="none" 时,没有点击态效果
*
* 默认为 button-hover
*/
hoverClass: string;
/**
* 按住后多久出现点击态
*
* 单位为 ms
*
* 默认为 20
*/
hoverStartTime: number;
/**
* 手指松开后点击态保留时间
*
* 单位为 ms
*
* 默认为 70
*/
hoverStayTime: number;
/**
* 打开 APP 时,向 APP 传递的参数
*
* Open-type="launchApp" 时有效
*/
appParameter: string;
/**
* 指定是否阻止本节点的祖先节点出现点击态
*
* 默认为 false
*/
hoverStopPropagation: boolean;
/**
* 返回用户信息的语言
*
* Zh_CN 简体中文
*
* Zh_TW 繁体中文
*
* En 英文
*
* 默认为 en
*/
lang: _ButtonLang;
/**
* 会话来源
*
* Open-type="contact" 时有效
*/
sessionFrom: string;
/**
* 会话内消息卡片标题
*
* Open-type="contact" 时有效
*
* 默认为当前标题
*/
sendMessageTitle: string;
/**
* 会话内消息卡片点击跳转小程序路径
*
* Open-type="contact" 时有效
*
* 默认为当前分享路径
*/
sendMessagePath: string;
/**
* 会话内消息卡片图片
*
* Open-type="contact" 时有效
*
* 默认为截图
*/
sendMessageImg: string;
/**
* 是否显示会话内消息卡片
*
* 设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息
*
* Open-type="contact" 时有效
*
* 默认为 false
*/
showMessageCard: boolean;
/**
* 打开群资料卡时,传递的群号
*
* Open-type="openGroupProfile" 时有效
*/
groupId: string;
/**
* 打开频道页面时,传递的频道号
*
* Open-type="openGuildProfile" 时有效
*/
guildId: string;
/**
* 打开公众号资料卡时,传递的号码
*
* Open-type="openPublicProfile" 时有效
*/
publicId: string;
/**
* 获取用户手机号时回调
*
* Open-type="getPhoneNumber" 时有效
*/
onGetphonenumber: _ButtonOnGetphonenumber;
/**
* 手机号实时验证回调
*
* Open-type="getRealtimePhoneNumber" 时有效
*/
onGetrealtimephonenumber: _ButtonOnGetrealtimephonenumber;
/** 使用开放能力发生错误时回调 */
onError: _ButtonOnError;
/**
* 在打开授权设置页并关闭后回调
*
* Open-type="openSetting" 时有效
*/
onOpensetting: _ButtonOnOpensetting;
/**
* 从小程序成功打开 APP 回调
*
* Open-type="launchApp" 时有效
*/
onLaunchapp: _ButtonOnLaunchapp;
/**
* 获取用户头像回调
*
* Open-type="chooseAvatar" 时有效
*/
onChooseavatar: _ButtonOnChooseavatar;
/**
* 添加群应用回调
*
* Open-type="addGroupApp" 时有效
*/
onAddgroupapp: _ButtonOnAddgroupapp;
/**
* 用户编辑并选择收货地址回调
*
* Open-type="chooseAddress" 时有效
*/
onChooseaddress: _ButtonOnChooseaddress;
/**
* 用户选择发票抬头回调
*
* Open-type="chooseInvoiceTitle" 时有效
*/
onChooseinvoicetitle: _ButtonOnChooseinvoicetitle;
/**
* 订阅消息授权回调
*
* Open-type="subscribe" 时有效
*/
onSubscribe: _ButtonOnSubscribe;
/**
* 登录回调
*
* Open-type="login" 时有效
*/
onLogin: _ButtonOnLogin;
/**
* 用户同意隐私协议回调
*
* Open-type="agreePrivacyAuthorization" 时有效
*/
onAgreeprivacyauthorization: _ButtonOnAgreeprivacyauthorization;
}>;
/** 按钮 */
type _Button = DefineComponent<_ButtonProps>;
/** 按钮实例 */
type _ButtonInstance = InstanceType<_Button>;
declare global {
namespace UniHelper {
/**
* 按钮的大小
*
* Default 默认
*
* Mini 小
*/
type ButtonSize = _ButtonSize;
/**
* 按钮的样式类型,如想在多端统一颜色,请用 default 然后自行写样式
*
* Primary 微信小程序、360 小程序为绿色,APP、H5、百度小程序、支付宝小程序、飞书小程序、快应用为蓝色,字节跳动小程序为红色,QQ
* 小程序为浅蓝色
*
* Default 白色
*
* Warn 红色
*/
type ButtonType = _ButtonType;
/**
* 用于 form 组件,点击分别会触发 form 组件的 submit / reset 事件
*
* Submit 点击会触发 form 的 submit 事件
*
* Reset 点击会触发 form 的 reset 事件
*/
type ButtonFormType = _ButtonFormType;
/**
* 开放能力
*
* Feedback 打开“意见反馈”页面,用户可提交反馈内容并上传日志
*
* Share 触发用户转发
*
* GetUserInfo 获取用户信息,可以从 `@getuserinfo` 回调中获取到用户信息
*
* Contact 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 `@contact` 回调中获得具体信息
*
* GetPhoneNumber 获取用户手机号,可以从 `@getphonenumber` 回调中获取到用户信息
*
* GetRealtimePhoneNumber 手机号实时验证,可以从 `@getrealtimephonenumber` 回调中获取到用户信息
*
* LaunchApp 小程序中打开APP,可以通过 `app-parameter` 属性设定向 APP 传的参数
*
* OpenSetting 打开授权设置页
*
* ChooseAvatar 获取用户头像,可以从 `@chooseavatar` 回调中获取到头像信息
*
* GetAuthorize 支持小程序授权
*
* Lifestyle 关注生活号
*
* ContactShare 分享到通讯录好友
*
* OpenGroupProfile 呼起 QQ 群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时
* manifest.json 中必须配置 groupIdList
*
* OpenGuildProfile 呼起频道页面,可以通过 guild-id 属性设定需要打开的频道 ID
*
* OpenPublicProfile 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时
* manifest.json 中必须配置 publicIdList
*
* ShareMessageToFriend 在自定义开放数据域组件中,向指定好友发起分享
*
* AddFriend 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权
*
* AddColorSign 添加彩签,点击后添加状态有用户提示,无回调
*
* AddGroupApp 添加群应用(只有管理员或群主有权操作),添加后给 button 绑定 `@addgroupapp` 事件接收回调数据
*
* AddToFavorites 收藏当前页面,点击按钮后会触发 Page.onAddToFavorites 方法
*
* ChooseAddress 选择用户收货地址,可以从 `@chooseaddress` 回调中获取到用户选择的地址信息
*
* ChooseInvoiceTitle 选择用户发票抬头,可以从 `@chooseinvoicetitle` 回调中获取到用户选择发票抬头信息
*
* Login 登录,可以从 `@login` 回调中确认是否登录成功
*
* Subscribe 订阅类模板消息,需要用户授权才可发送
*
* Favorite 触发用户收藏
*
* WatchLater 触发用户稍后再看
*
* OpenProfile 触发打开用户主页
*
* AgreePrivacyAuthorization 用户同意隐私协议
*/
type ButtonOpenType = _ButtonOpenType;
/**
* 返回用户信息的语言
*
* Zh_CN 简体中文
*
* Zh_TW 繁体中文
*
* En 英文
*/
type ButtonLang = _ButtonLang;
interface ButtonOnGetphonenumberDetail extends _ButtonOnGetphonenumberDetail {}
type ButtonOnGetphonenumberEvent = _ButtonOnGetphonenumberEvent;
/**
* 获取用户手机号时回调
*
* Open-type="getPhoneNumber" 时有效
*/
interface ButtonOnGetphonenumber extends _ButtonOnGetphonenumber {}
interface ButtonOnGetrealtimephonenumberDetail extends _ButtonOnGetrealtimephonenumberDetail {}
type ButtonOnGetrealtimephonenumberEvent = _ButtonOnGetrealtimephonenumberEvent;
/**
* 手机号实时验证回调
*
* Open-type="getRealtimePhoneNumber" 时有效
*/
interface ButtonOnGetrealtimephonenumber extends _ButtonOnGetrealtimephonenumber {}
type ButtonOnErrorEvent = _ButtonOnErrorEvent;
/** 使用开放能力发生错误时回调 */
interface ButtonOnError extends _ButtonOnError {}
interface ButtonOnOpensettingDetail extends _ButtonOnOpensettingDetail {}
type ButtonOnOpensettingEvent = _ButtonOnOpensettingEvent;
/**
* 在打开授权设置页并关闭后回调
*
* Open-type="openSetting" 时有效
*/
interface ButtonOnOpensetting extends _ButtonOnOpensetting {}
type ButtonOnLaunchappEvent = _ButtonOnLaunchappEvent;
/**
* 从小程序成功打开 APP 回调
*
* Open-type="launchApp" 时有效
*/
interface ButtonOnLaunchapp extends _ButtonOnLaunchapp {}
type ButtonOnChooseavatarEvent = _ButtonOnChooseavatarEvent;
/**
* 获取用户头像回调
*
* Open-type="chooseAvatar" 时有效
*/
interface ButtonOnChooseavatar extends _ButtonOnChooseavatar {}
type ButtonOnAddgroupappEvent = _ButtonOnAddgroupappEvent;
/**
* 添加群应用回调
*
* Open-type="addGroupApp" 时有效
*/
interface ButtonOnAddgroupapp extends _ButtonOnAddgroupapp {}
type ButtonOnChooseaddressEvent = _ButtonOnChooseaddressEvent;
/**
* 用户编辑并选择收货地址回调
*
* Open-type="chooseAddress" 时有效
*/
interface ButtonOnChooseaddress extends _ButtonOnChooseaddress {}
type ButtonOnChooseinvoicetitleEvent = _ButtonOnChooseinvoicetitleEvent;
/**
* 用户选择发票抬头回调
*
* Open-type="chooseInvoiceTitle" 时有效
*/
interface ButtonOnChooseinvoicetitle extends _ButtonOnChooseinvoicetitle {}
type ButtonOnSubscribeEvent = _ButtonOnSubscribeEvent;
/**
* 订阅消息授权回调
*
* Open-type="subscribe" 时有效
*/
interface ButtonOnSubscribe extends _ButtonOnSubscribe {}
type ButtonOnLoginEvent = _ButtonOnLoginEvent;
/**
* 登录回调
*
* Open-type="login" 时有效
*/
interface ButtonOnLogin extends _ButtonOnLogin {}
type ButtonOnAgreeprivacyauthorizationEvent = _ButtonOnAgreeprivacyauthorizationEvent;
/**
* 用户同意隐私协议回调
*
* Open-type="agreePrivacyAuthorization" 时有效
*/
interface ButtonOnAgreeprivacyauthorization extends _ButtonOnAgreeprivacyauthorization {}
/** 按钮属性 */
type ButtonProps = _ButtonProps;
/** 按钮 */
type Button = _Button;
/** 按钮实例 */
type ButtonInstance = _ButtonInstance;
}
}
declare module "vue" {
interface GlobalComponents {
/** 按钮
* ***
* [👉🏻点击查看组件文档](ht