@playcraft/adsdk 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/defines.d.ts +130 -130
- package/dist/esm/index.js +113 -2
- package/dist/iife/index.js +111 -2
- package/dist/index.d.mts +55 -2
- package/dist/index.d.ts +55 -2
- package/dist/index.js +115 -2
- package/package.json +56 -56
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025-present Smoud
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Smoud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/defines.d.ts
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
declare const mraid: {
|
|
2
|
-
getVersion: () => string; // MRAID 规范必需:返回 MRAID 版本(如 "3.0")
|
|
3
|
-
isReady: () => boolean;
|
|
4
|
-
isViewable: () => boolean;
|
|
5
|
-
getState: () => string;
|
|
6
|
-
addEventListener: (
|
|
7
|
-
event: 'viewableChange' | 'sizeChange' | 'ready' | 'audioVolumeChange' | 'stateChange' | 'error' | 'orientationChange' | 'resize',
|
|
8
|
-
callback: (...args: any[]) => void
|
|
9
|
-
) => void;
|
|
10
|
-
removeEventListener: (
|
|
11
|
-
event: 'viewableChange' | 'sizeChange' | 'ready' | 'audioVolumeChange' | 'stateChange' | 'error' | 'orientationChange' | 'resize',
|
|
12
|
-
callback: (...args: any[]) => void
|
|
13
|
-
) => void;
|
|
14
|
-
getMaxSize: () => { width: number; height: number };
|
|
15
|
-
openStoreUrl: () => void;
|
|
16
|
-
open: (url: string) => void;
|
|
17
|
-
close: () => void; // Unity Ads 必需:关闭广告
|
|
18
|
-
getAudioVolume: () => number;
|
|
19
|
-
fireTrackingEvent?: (event: string) => void; // Unity Ads 可选:跟踪事件
|
|
20
|
-
preloadStore?: () => void;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
declare const dapi: {
|
|
24
|
-
addEventListener: (
|
|
25
|
-
event: 'viewableChange' | 'adResized' | 'ready' | 'audioVolumeChange' | 'error',
|
|
26
|
-
callback: (...args: any[]) => void
|
|
27
|
-
) => void;
|
|
28
|
-
removeEventListener: (
|
|
29
|
-
event: 'viewableChange' | 'adResized' | 'ready' | 'audioVolumeChange' | 'error',
|
|
30
|
-
callback: (...args: any[]) => void
|
|
31
|
-
) => void;
|
|
32
|
-
getScreenSize: () => { width: number; height: number };
|
|
33
|
-
openStoreUrl: () => void;
|
|
34
|
-
getAudioVolume: () => number;
|
|
35
|
-
isViewable: () => boolean;
|
|
36
|
-
isReady: () => boolean;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
declare const NUC: {
|
|
40
|
-
trigger: {
|
|
41
|
-
convert: (destinationUrl: string) => void;
|
|
42
|
-
tryAgain: Function;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
declare const ScPlayableAd: { onCTAClick: () => void };
|
|
47
|
-
|
|
48
|
-
// Adikteev 占位符变量
|
|
49
|
-
declare const AK_CLICK_DESTINATION_URL: string;
|
|
50
|
-
declare const AK_CLICK_PIXEL_URL: string;
|
|
51
|
-
declare const FbPlayableAd: { onCTAClick: () => void };
|
|
52
|
-
declare const smxTracking: { redirect: () => void };
|
|
53
|
-
declare const ExitApi: { exit: () => void };
|
|
54
|
-
|
|
55
|
-
declare const AD_NETWORK:
|
|
56
|
-
| 'preview'
|
|
57
|
-
| 'applovin'
|
|
58
|
-
| 'unity'
|
|
59
|
-
| 'google'
|
|
60
|
-
| 'ironsource'
|
|
61
|
-
| 'facebook'
|
|
62
|
-
| 'moloco'
|
|
63
|
-
| 'mintegral'
|
|
64
|
-
| 'vungle'
|
|
65
|
-
| 'adcolony'
|
|
66
|
-
| 'tapjoy'
|
|
67
|
-
| 'snapchat'
|
|
68
|
-
| 'tiktok'
|
|
69
|
-
| 'appreciate'
|
|
70
|
-
| 'chartboost'
|
|
71
|
-
| 'pangle'
|
|
72
|
-
| 'mytarget'
|
|
73
|
-
| 'liftoff'
|
|
74
|
-
| 'smadex'
|
|
75
|
-
| 'adikteev'
|
|
76
|
-
| 'bigabid'
|
|
77
|
-
| 'inmobi'
|
|
78
|
-
| 'bigoads';
|
|
79
|
-
|
|
80
|
-
declare const AD_PROTOCOL: 'mraid' | 'dapi' | 'nucleo' | 'none';
|
|
81
|
-
declare const GOOGLE_PLAY_URL: string;
|
|
82
|
-
declare const APP_STORE_URL: string;
|
|
83
|
-
declare const BUILD_HASH: string;
|
|
84
|
-
|
|
85
|
-
interface Window {
|
|
86
|
-
PlayableSDK: any;
|
|
87
|
-
ADS_MRAID_CONFIG: {
|
|
88
|
-
landUrl: string;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// AppLovin Playable Analytics
|
|
92
|
-
// 文档: https://support.axon.ai/en/growth/promoting-your-apps/creatives/playable-analytics-integration
|
|
93
|
-
ALPlayableAnalytics?: {
|
|
94
|
-
trackEvent: (event: string) => void;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// BigoAds SDK
|
|
98
|
-
// 文档: https://www.bigoads.com/help/detail?id=143&moduleId=7¤tLan=CN
|
|
99
|
-
BGY_MRAID: {
|
|
100
|
-
open: () => void; // 打开应用商店/推广地址
|
|
101
|
-
gameReady: () => void; // 素材准备完毕时调用
|
|
102
|
-
gameEnd: () => void; // 游戏结束时调用
|
|
103
|
-
isViewable: () => boolean;
|
|
104
|
-
addEventListener: (event: string, callback: (...args: any[]) => void) => void;
|
|
105
|
-
removeEventListener: (event: string, callback: (...args: any[]) => void) => void;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// Mintegral functions
|
|
109
|
-
gameReady: Function;
|
|
110
|
-
gameEnd: Function;
|
|
111
|
-
gameRetry: Function;
|
|
112
|
-
install: Function;
|
|
113
|
-
mintGameStart: Function;
|
|
114
|
-
mintGameClose: Function;
|
|
115
|
-
|
|
116
|
-
// Tapjoy functions
|
|
117
|
-
TJ_API: {
|
|
118
|
-
objectiveComplete: Function;
|
|
119
|
-
playableFinished: Function;
|
|
120
|
-
gameplayFinished: Function;
|
|
121
|
-
setPlayableBuild: Function;
|
|
122
|
-
setPlayableAPI: Function;
|
|
123
|
-
click: Function;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
BIGABID_BIDTIMEMACROS?: Record<string, string>
|
|
127
|
-
INMOBI_DSPMACROS?: Record<string, string>
|
|
128
|
-
|
|
129
|
-
openAppStore: Function;
|
|
130
|
-
}
|
|
1
|
+
declare const mraid: {
|
|
2
|
+
getVersion: () => string; // MRAID 规范必需:返回 MRAID 版本(如 "3.0")
|
|
3
|
+
isReady: () => boolean;
|
|
4
|
+
isViewable: () => boolean;
|
|
5
|
+
getState: () => string;
|
|
6
|
+
addEventListener: (
|
|
7
|
+
event: 'viewableChange' | 'sizeChange' | 'ready' | 'audioVolumeChange' | 'stateChange' | 'error' | 'orientationChange' | 'resize',
|
|
8
|
+
callback: (...args: any[]) => void
|
|
9
|
+
) => void;
|
|
10
|
+
removeEventListener: (
|
|
11
|
+
event: 'viewableChange' | 'sizeChange' | 'ready' | 'audioVolumeChange' | 'stateChange' | 'error' | 'orientationChange' | 'resize',
|
|
12
|
+
callback: (...args: any[]) => void
|
|
13
|
+
) => void;
|
|
14
|
+
getMaxSize: () => { width: number; height: number };
|
|
15
|
+
openStoreUrl: () => void;
|
|
16
|
+
open: (url: string) => void;
|
|
17
|
+
close: () => void; // Unity Ads 必需:关闭广告
|
|
18
|
+
getAudioVolume: () => number;
|
|
19
|
+
fireTrackingEvent?: (event: string) => void; // Unity Ads 可选:跟踪事件
|
|
20
|
+
preloadStore?: () => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare const dapi: {
|
|
24
|
+
addEventListener: (
|
|
25
|
+
event: 'viewableChange' | 'adResized' | 'ready' | 'audioVolumeChange' | 'error',
|
|
26
|
+
callback: (...args: any[]) => void
|
|
27
|
+
) => void;
|
|
28
|
+
removeEventListener: (
|
|
29
|
+
event: 'viewableChange' | 'adResized' | 'ready' | 'audioVolumeChange' | 'error',
|
|
30
|
+
callback: (...args: any[]) => void
|
|
31
|
+
) => void;
|
|
32
|
+
getScreenSize: () => { width: number; height: number };
|
|
33
|
+
openStoreUrl: () => void;
|
|
34
|
+
getAudioVolume: () => number;
|
|
35
|
+
isViewable: () => boolean;
|
|
36
|
+
isReady: () => boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare const NUC: {
|
|
40
|
+
trigger: {
|
|
41
|
+
convert: (destinationUrl: string) => void;
|
|
42
|
+
tryAgain: Function;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare const ScPlayableAd: { onCTAClick: () => void };
|
|
47
|
+
|
|
48
|
+
// Adikteev 占位符变量
|
|
49
|
+
declare const AK_CLICK_DESTINATION_URL: string;
|
|
50
|
+
declare const AK_CLICK_PIXEL_URL: string;
|
|
51
|
+
declare const FbPlayableAd: { onCTAClick: () => void };
|
|
52
|
+
declare const smxTracking: { redirect: () => void };
|
|
53
|
+
declare const ExitApi: { exit: () => void };
|
|
54
|
+
|
|
55
|
+
declare const AD_NETWORK:
|
|
56
|
+
| 'preview'
|
|
57
|
+
| 'applovin'
|
|
58
|
+
| 'unity'
|
|
59
|
+
| 'google'
|
|
60
|
+
| 'ironsource'
|
|
61
|
+
| 'facebook'
|
|
62
|
+
| 'moloco'
|
|
63
|
+
| 'mintegral'
|
|
64
|
+
| 'vungle'
|
|
65
|
+
| 'adcolony'
|
|
66
|
+
| 'tapjoy'
|
|
67
|
+
| 'snapchat'
|
|
68
|
+
| 'tiktok'
|
|
69
|
+
| 'appreciate'
|
|
70
|
+
| 'chartboost'
|
|
71
|
+
| 'pangle'
|
|
72
|
+
| 'mytarget'
|
|
73
|
+
| 'liftoff'
|
|
74
|
+
| 'smadex'
|
|
75
|
+
| 'adikteev'
|
|
76
|
+
| 'bigabid'
|
|
77
|
+
| 'inmobi'
|
|
78
|
+
| 'bigoads';
|
|
79
|
+
|
|
80
|
+
declare const AD_PROTOCOL: 'mraid' | 'dapi' | 'nucleo' | 'none';
|
|
81
|
+
declare const GOOGLE_PLAY_URL: string;
|
|
82
|
+
declare const APP_STORE_URL: string;
|
|
83
|
+
declare const BUILD_HASH: string;
|
|
84
|
+
|
|
85
|
+
interface Window {
|
|
86
|
+
PlayableSDK: any;
|
|
87
|
+
ADS_MRAID_CONFIG: {
|
|
88
|
+
landUrl: string;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// AppLovin Playable Analytics
|
|
92
|
+
// 文档: https://support.axon.ai/en/growth/promoting-your-apps/creatives/playable-analytics-integration
|
|
93
|
+
ALPlayableAnalytics?: {
|
|
94
|
+
trackEvent: (event: string) => void;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// BigoAds SDK
|
|
98
|
+
// 文档: https://www.bigoads.com/help/detail?id=143&moduleId=7¤tLan=CN
|
|
99
|
+
BGY_MRAID: {
|
|
100
|
+
open: () => void; // 打开应用商店/推广地址
|
|
101
|
+
gameReady: () => void; // 素材准备完毕时调用
|
|
102
|
+
gameEnd: () => void; // 游戏结束时调用
|
|
103
|
+
isViewable: () => boolean;
|
|
104
|
+
addEventListener: (event: string, callback: (...args: any[]) => void) => void;
|
|
105
|
+
removeEventListener: (event: string, callback: (...args: any[]) => void) => void;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Mintegral functions
|
|
109
|
+
gameReady: Function;
|
|
110
|
+
gameEnd: Function;
|
|
111
|
+
gameRetry: Function;
|
|
112
|
+
install: Function;
|
|
113
|
+
mintGameStart: Function;
|
|
114
|
+
mintGameClose: Function;
|
|
115
|
+
|
|
116
|
+
// Tapjoy functions
|
|
117
|
+
TJ_API: {
|
|
118
|
+
objectiveComplete: Function;
|
|
119
|
+
playableFinished: Function;
|
|
120
|
+
gameplayFinished: Function;
|
|
121
|
+
setPlayableBuild: Function;
|
|
122
|
+
setPlayableAPI: Function;
|
|
123
|
+
click: Function;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
BIGABID_BIDTIMEMACROS?: Record<string, string>
|
|
127
|
+
INMOBI_DSPMACROS?: Record<string, string>
|
|
128
|
+
|
|
129
|
+
openAppStore: Function;
|
|
130
|
+
}
|