Skip to content

Commit 3ed358f

Browse files
committed
fix: add CommonProps, close #22
1 parent 4cb6832 commit 3ed358f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3098
-2997
lines changed

packages/uni-app-types/src/ad/ad-content-page.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

45
type _AdContentPageOnLoadEvent = BaseEvent;
@@ -124,22 +125,23 @@ type _AdContentPageOnCompleteEvent =
124125
type _AdContentPageOnComplete = (event: _AdContentPageOnCompleteEvent) => void;
125126

126127
/** 短视频内容联盟广告属性 */
127-
type _AdContentPageProps = Partial<{
128-
/** APP 广告位 id */
129-
adpid: string;
130-
/** 广告加载成功的回调 */
131-
onLoad: _AdContentPageOnLoad;
132-
/** 广告加载失败的回调 */
133-
onError: _AdContentPageOnError;
134-
/** 广告开始播放时触发 */
135-
onStart: _AdContentPageOnStart;
136-
/** 广告暂停播放时触发 */
137-
onPause: _AdContentPageOnPause;
138-
/** 广告恢复播放时触发 */
139-
onResume: _AdContentPageOnResume;
140-
/** 广告完成播放时触发 */
141-
onComplete: _AdContentPageOnComplete;
142-
}>;
128+
type _AdContentPageProps = CommonProps &
129+
Partial<{
130+
/** APP 广告位 id */
131+
adpid: string;
132+
/** 广告加载成功的回调 */
133+
onLoad: _AdContentPageOnLoad;
134+
/** 广告加载失败的回调 */
135+
onError: _AdContentPageOnError;
136+
/** 广告开始播放时触发 */
137+
onStart: _AdContentPageOnStart;
138+
/** 广告暂停播放时触发 */
139+
onPause: _AdContentPageOnPause;
140+
/** 广告恢复播放时触发 */
141+
onResume: _AdContentPageOnResume;
142+
/** 广告完成播放时触发 */
143+
onComplete: _AdContentPageOnComplete;
144+
}>;
143145

144146
/** 短视频内容联盟广告 */
145147
type _AdContentPage = DefineComponent<_AdContentPageProps>;

packages/uni-app-types/src/ad/ad-draw.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

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

2122
/** 沉浸视频流广告属性 */
22-
type _AdDrawProps = Partial<{
23-
/** APP 广告位 id */
24-
adpid: string;
25-
/** 广告数据 */
26-
data: Record<string, any>;
27-
/** 广告加载成功的回调 */
28-
onLoad: _AdDrawOnLoad;
29-
/** 广告加载失败的回调 */
30-
onError: _AdDrawOnError;
31-
}>;
23+
type _AdDrawProps = CommonProps &
24+
Partial<{
25+
/** APP 广告位 id */
26+
adpid: string;
27+
/** 广告数据 */
28+
data: Record<string, any>;
29+
/** 广告加载成功的回调 */
30+
onLoad: _AdDrawOnLoad;
31+
/** 广告加载失败的回调 */
32+
onError: _AdDrawOnError;
33+
}>;
3234

3335
/** 沉浸视频流广告 */
3436
type _AdDraw = DefineComponent<_AdDrawProps>;

packages/uni-app-types/src/ad/ad-fullscreen-video.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

45
type _AdFullscreenVideoOnLoadEvent = BaseEvent;
@@ -29,28 +30,29 @@ type _AdFullscreenVideoOnClose = (
2930
) => void;
3031

3132
/** 全屏视频广告属性 */
32-
type _AdFullscreenVideoProps = Partial<{
33-
/** APP 广告位 id */
34-
adpid: string | number | (string | number)[];
35-
/**
36-
* 是否在页面就绪后加载广告数据
37-
*
38-
* 默认为 `true`
39-
*/
40-
preload: boolean;
41-
/**
42-
* 是否自动加载下一条广告数据
43-
*
44-
* 默认为 false
45-
*/
46-
loadnext: boolean;
47-
/** 广告加载成功的回调 */
48-
onLoad: _AdFullscreenVideoOnLoad;
49-
/** 广告加载失败的回调 */
50-
onError: _AdFullscreenVideoOnError;
51-
/** 广告关闭的回调 */
52-
onClose: _AdFullscreenVideoOnClose;
53-
}>;
33+
type _AdFullscreenVideoProps = CommonProps &
34+
Partial<{
35+
/** APP 广告位 id */
36+
adpid: string | number | (string | number)[];
37+
/**
38+
* 是否在页面就绪后加载广告数据
39+
*
40+
* 默认为 `true`
41+
*/
42+
preload: boolean;
43+
/**
44+
* 是否自动加载下一条广告数据
45+
*
46+
* 默认为 false
47+
*/
48+
loadnext: boolean;
49+
/** 广告加载成功的回调 */
50+
onLoad: _AdFullscreenVideoOnLoad;
51+
/** 广告加载失败的回调 */
52+
onError: _AdFullscreenVideoOnError;
53+
/** 广告关闭的回调 */
54+
onClose: _AdFullscreenVideoOnClose;
55+
}>;
5456

5557
/** 全屏视频广告 */
5658
type _AdFullscreenVideo = DefineComponent<_AdFullscreenVideoProps>;

packages/uni-app-types/src/ad/ad-interactive.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

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

2122
/** 互动广告属性 */
22-
type _AdInteractiveProps = Partial<{
23-
/** APP 广告位 id */
24-
adpid: string;
25-
/** 点击广告后打开的页面路径 */
26-
openPagePath: string;
27-
/** 广告加载成功的回调 */
28-
onLoad: _AdInteractiveOnLoad;
29-
/** 广告加载失败的回调 */
30-
onError: _AdInteractiveOnError;
31-
}>;
23+
type _AdInteractiveProps = CommonProps &
24+
Partial<{
25+
/** APP 广告位 id */
26+
adpid: string;
27+
/** 点击广告后打开的页面路径 */
28+
openPagePath: string;
29+
/** 广告加载成功的回调 */
30+
onLoad: _AdInteractiveOnLoad;
31+
/** 广告加载失败的回调 */
32+
onError: _AdInteractiveOnError;
33+
}>;
3234

3335
/** 互动广告 */
3436
type _AdInteractive = DefineComponent<_AdInteractiveProps>;

packages/uni-app-types/src/ad/ad-interstitial.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

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

2627
/** 插屏广告属性 */
27-
type _AdInterstitialProps = Partial<{
28-
/** APP 广告位 id */
29-
adpid: string | number | (string | number)[];
30-
/**
31-
* 是否在页面就绪后加载广告数据
32-
*
33-
* 默认为 `true`
34-
*/
35-
preload: boolean;
36-
/**
37-
* 是否自动加载下一条广告数据
38-
*
39-
* 默认为 `false`
40-
*/
41-
loadnext: boolean;
42-
/** 广告加载成功的回调 */
43-
onLoad: _AdInterstitialOnLoad;
44-
/** 广告加载失败的回调 */
45-
onError: _AdInterstitialOnError;
46-
/** 广告关闭的回调 */
47-
onClose: _AdInterstitialOnClose;
48-
}>;
28+
type _AdInterstitialProps = CommonProps &
29+
Partial<{
30+
/** APP 广告位 id */
31+
adpid: string | number | (string | number)[];
32+
/**
33+
* 是否在页面就绪后加载广告数据
34+
*
35+
* 默认为 `true`
36+
*/
37+
preload: boolean;
38+
/**
39+
* 是否自动加载下一条广告数据
40+
*
41+
* 默认为 `false`
42+
*/
43+
loadnext: boolean;
44+
/** 广告加载成功的回调 */
45+
onLoad: _AdInterstitialOnLoad;
46+
/** 广告加载失败的回调 */
47+
onError: _AdInterstitialOnError;
48+
/** 广告关闭的回调 */
49+
onClose: _AdInterstitialOnClose;
50+
}>;
4951

5052
/** 插屏广告 */
5153
type _AdInterstitial = DefineComponent<_AdInterstitialProps>;

packages/uni-app-types/src/ad/ad-rewarded-video.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefineComponent } from "vue";
2+
import type { CommonProps } from "../common";
23
import type { BaseEvent, CustomEvent } from "../events";
34

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

3233
/** 激励视频广告属性 */
33-
type _AdRewardedVideoProps = Partial<{
34-
/** APP 广告位 id */
35-
adpid: string | number | (string | number)[];
36-
/**
37-
* 是否在页面就绪后加载广告数据
38-
*
39-
* 默认为 `true`
40-
*/
41-
preload: boolean;
42-
/**
43-
* 是否自动加载下一条广告数据
44-
*
45-
* 默认为 `false`
46-
*/
47-
loadnext: boolean;
48-
/** 服务器回调透传数据 */
49-
urlCallback: _AdRewardedVideoUrlCallback;
50-
/** 广告加载成功的回调 */
51-
onLoad: _AdRewardedVideoOnLoad;
52-
/** 广告加载失败的回调 */
53-
onError: _AdRewardedVideoOnError;
54-
/** 广告关闭的回调 */
55-
onClose: _AdRewardedVideoOnClose;
56-
}>;
34+
type _AdRewardedVideoProps = CommonProps &
35+
Partial<{
36+
/** APP 广告位 id */
37+
adpid: string | number | (string | number)[];
38+
/**
39+
* 是否在页面就绪后加载广告数据
40+
*
41+
* 默认为 `true`
42+
*/
43+
preload: boolean;
44+
/**
45+
* 是否自动加载下一条广告数据
46+
*
47+
* 默认为 `false`
48+
*/
49+
loadnext: boolean;
50+
/** 服务器回调透传数据 */
51+
urlCallback: _AdRewardedVideoUrlCallback;
52+
/** 广告加载成功的回调 */
53+
onLoad: _AdRewardedVideoOnLoad;
54+
/** 广告加载失败的回调 */
55+
onError: _AdRewardedVideoOnError;
56+
/** 广告关闭的回调 */
57+
onClose: _AdRewardedVideoOnClose;
58+
}>;
5759

5860
/** 激励视频广告 */
5961
type _AdRewardedVideo = DefineComponent<_AdRewardedVideoProps>;

0 commit comments

Comments
 (0)