Skip to content

Commit

Permalink
fix: add CommonProps, close #22
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Nov 6, 2024
1 parent 4cb6832 commit 3ed358f
Show file tree
Hide file tree
Showing 49 changed files with 3,098 additions and 2,997 deletions.
34 changes: 18 additions & 16 deletions packages/uni-app-types/src/ad/ad-content-page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

type _AdContentPageOnLoadEvent = BaseEvent;
Expand Down Expand Up @@ -124,22 +125,23 @@ type _AdContentPageOnCompleteEvent =
type _AdContentPageOnComplete = (event: _AdContentPageOnCompleteEvent) => void;

/** 短视频内容联盟广告属性 */
type _AdContentPageProps = Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告加载成功的回调 */
onLoad: _AdContentPageOnLoad;
/** 广告加载失败的回调 */
onError: _AdContentPageOnError;
/** 广告开始播放时触发 */
onStart: _AdContentPageOnStart;
/** 广告暂停播放时触发 */
onPause: _AdContentPageOnPause;
/** 广告恢复播放时触发 */
onResume: _AdContentPageOnResume;
/** 广告完成播放时触发 */
onComplete: _AdContentPageOnComplete;
}>;
type _AdContentPageProps = CommonProps &
Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告加载成功的回调 */
onLoad: _AdContentPageOnLoad;
/** 广告加载失败的回调 */
onError: _AdContentPageOnError;
/** 广告开始播放时触发 */
onStart: _AdContentPageOnStart;
/** 广告暂停播放时触发 */
onPause: _AdContentPageOnPause;
/** 广告恢复播放时触发 */
onResume: _AdContentPageOnResume;
/** 广告完成播放时触发 */
onComplete: _AdContentPageOnComplete;
}>;

/** 短视频内容联盟广告 */
type _AdContentPage = DefineComponent<_AdContentPageProps>;
Expand Down
22 changes: 12 additions & 10 deletions packages/uni-app-types/src/ad/ad-draw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

type _AdDrawOnLoadEvent = BaseEvent;
Expand All @@ -19,16 +20,17 @@ type _AdDrawOnErrorEvent = CustomEvent<_AdDrawOnErrorDetail>;
type _AdDrawOnError = (event: _AdDrawOnErrorEvent) => void;

/** 沉浸视频流广告属性 */
type _AdDrawProps = Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告数据 */
data: Record<string, any>;
/** 广告加载成功的回调 */
onLoad: _AdDrawOnLoad;
/** 广告加载失败的回调 */
onError: _AdDrawOnError;
}>;
type _AdDrawProps = CommonProps &
Partial<{
/** APP 广告位 id */
adpid: string;
/** 广告数据 */
data: Record<string, any>;
/** 广告加载成功的回调 */
onLoad: _AdDrawOnLoad;
/** 广告加载失败的回调 */
onError: _AdDrawOnError;
}>;

/** 沉浸视频流广告 */
type _AdDraw = DefineComponent<_AdDrawProps>;
Expand Down
46 changes: 24 additions & 22 deletions packages/uni-app-types/src/ad/ad-fullscreen-video.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

type _AdFullscreenVideoOnLoadEvent = BaseEvent;
Expand Down Expand Up @@ -29,28 +30,29 @@ type _AdFullscreenVideoOnClose = (
) => void;

/** 全屏视频广告属性 */
type _AdFullscreenVideoProps = Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 false
*/
loadnext: boolean;
/** 广告加载成功的回调 */
onLoad: _AdFullscreenVideoOnLoad;
/** 广告加载失败的回调 */
onError: _AdFullscreenVideoOnError;
/** 广告关闭的回调 */
onClose: _AdFullscreenVideoOnClose;
}>;
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>;
Expand Down
22 changes: 12 additions & 10 deletions packages/uni-app-types/src/ad/ad-interactive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

type _AdInteractiveOnLoadEvent = BaseEvent;
Expand All @@ -19,16 +20,17 @@ type _AdInteractiveOnErrorEvent = CustomEvent<_AdInteractiveOnErrorDetail>;
type _AdInteractiveOnError = (event: _AdInteractiveOnErrorEvent) => void;

/** 互动广告属性 */
type _AdInteractiveProps = Partial<{
/** APP 广告位 id */
adpid: string;
/** 点击广告后打开的页面路径 */
openPagePath: string;
/** 广告加载成功的回调 */
onLoad: _AdInteractiveOnLoad;
/** 广告加载失败的回调 */
onError: _AdInteractiveOnError;
}>;
type _AdInteractiveProps = CommonProps &
Partial<{
/** APP 广告位 id */
adpid: string;
/** 点击广告后打开的页面路径 */
openPagePath: string;
/** 广告加载成功的回调 */
onLoad: _AdInteractiveOnLoad;
/** 广告加载失败的回调 */
onError: _AdInteractiveOnError;
}>;

/** 互动广告 */
type _AdInteractive = DefineComponent<_AdInteractiveProps>;
Expand Down
46 changes: 24 additions & 22 deletions packages/uni-app-types/src/ad/ad-interstitial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

type _AdInterstitialOnLoadEvent = BaseEvent;
Expand All @@ -24,28 +25,29 @@ type _AdInterstitialOnCloseEvent = BaseEvent;
type _AdInterstitialOnClose = (event: _AdInterstitialOnCloseEvent) => void;

/** 插屏广告属性 */
type _AdInterstitialProps = Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 `false`
*/
loadnext: boolean;
/** 广告加载成功的回调 */
onLoad: _AdInterstitialOnLoad;
/** 广告加载失败的回调 */
onError: _AdInterstitialOnError;
/** 广告关闭的回调 */
onClose: _AdInterstitialOnClose;
}>;
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>;
Expand Down
50 changes: 26 additions & 24 deletions packages/uni-app-types/src/ad/ad-rewarded-video.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DefineComponent } from "vue";
import type { CommonProps } from "../common";
import type { BaseEvent, CustomEvent } from "../events";

/** 服务器回调透传数据 */
Expand Down Expand Up @@ -30,30 +31,31 @@ type _AdRewardedVideoOnCloseEvent = BaseEvent;
type _AdRewardedVideoOnClose = (event: _AdRewardedVideoOnCloseEvent) => void;

/** 激励视频广告属性 */
type _AdRewardedVideoProps = Partial<{
/** APP 广告位 id */
adpid: string | number | (string | number)[];
/**
* 是否在页面就绪后加载广告数据
*
* 默认为 `true`
*/
preload: boolean;
/**
* 是否自动加载下一条广告数据
*
* 默认为 `false`
*/
loadnext: boolean;
/** 服务器回调透传数据 */
urlCallback: _AdRewardedVideoUrlCallback;
/** 广告加载成功的回调 */
onLoad: _AdRewardedVideoOnLoad;
/** 广告加载失败的回调 */
onError: _AdRewardedVideoOnError;
/** 广告关闭的回调 */
onClose: _AdRewardedVideoOnClose;
}>;
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>;
Expand Down
Loading

0 comments on commit 3ed358f

Please sign in to comment.