@jolibox/ads 1.1.19-beta.6 → 1.1.19
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/dist/afv/adrequest-async-proxy.d.ts +2 -2
- package/dist/afv/ads-interface.d.ts +6 -5
- package/dist/afv/ima/ima-impl.d.ts +2 -2
- package/dist/afv/ima/index.d.ts +3 -2
- package/dist/afv/ima/type.d.ts +1 -1
- package/dist/afv/index.d.ts +7 -2
- package/dist/afv/okspin/index.d.ts +3 -2
- package/dist/index.js +1114 -1263
- package/package.json +10 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAdsContext } from '../type/base';
|
|
2
|
-
import type { IAbstractAFVProvider,
|
|
2
|
+
import type { IAbstractAFVProvider, IAFVRequestAdParams, AFVWrappedError } from './ads-interface';
|
|
3
3
|
import type { IAFVRequestAdServerParams } from './type';
|
|
4
4
|
export declare class AdRequestAsyncProxy {
|
|
5
5
|
private context;
|
|
@@ -14,5 +14,5 @@ export declare class AdRequestAsyncProxy {
|
|
|
14
14
|
private wrapAdPlaying;
|
|
15
15
|
private wrapAdCompleted;
|
|
16
16
|
private wrapAdError;
|
|
17
|
-
callAdRequestAndContinue(adsProvider: IAbstractAFVProvider, params:
|
|
17
|
+
callAdRequestAndContinue(adsProvider: IAbstractAFVProvider, params: IAFVRequestAdParams<any>, serverParams: IAFVRequestAdServerParams): Promise<[boolean, AFVWrappedError<"GOOGLE_IMA_ERROR" | "JOLIBOX_IMA_ERROR", Error | import("./ima/ima").google.ima.AdError> | null]>;
|
|
18
18
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { google } from './ima/ima';
|
|
2
2
|
import type { IAFVInitServerParams, IAFVRequestAdServerParams } from './type';
|
|
3
3
|
type WrappedErrorType = 'GOOGLE_IMA_ERROR' | 'JOLIBOX_IMA_ERROR';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class AFVWrappedError<T extends WrappedErrorType = WrappedErrorType, R extends T extends 'GOOGLE_IMA_ERROR' ? google.ima.AdError : Error = T extends 'GOOGLE_IMA_ERROR' ? google.ima.AdError : Error> extends Error {
|
|
5
5
|
name: 'AFVRequestError';
|
|
6
6
|
type: T;
|
|
7
7
|
raw: R;
|
|
8
8
|
constructor(error: R, type: T);
|
|
9
|
-
static from(error: Error | google.ima.AdError, type: WrappedErrorType):
|
|
9
|
+
static from(error: Error | google.ima.AdError, type: WrappedErrorType): AFVWrappedError<"GOOGLE_IMA_ERROR", google.ima.AdError> | AFVWrappedError<"JOLIBOX_IMA_ERROR", Error>;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface IAFVRequestAdParams<AdEvent = any> {
|
|
12
12
|
onAdRequested?: () => void;
|
|
13
13
|
onAdLoaded?: (event: AdEvent) => void;
|
|
14
14
|
onAdPlaying?: (event: AdEvent) => void;
|
|
15
15
|
onAdCompleted?: (event: AdEvent) => void;
|
|
16
|
-
onAdError?: (error:
|
|
16
|
+
onAdError?: (error: AFVWrappedError<'GOOGLE_IMA_ERROR' | 'JOLIBOX_IMA_ERROR', google.ima.AdError | Error>) => void;
|
|
17
17
|
}
|
|
18
18
|
export interface IAbstractAFVProvider<AdEvent = any, AdInitServerParams extends IAFVInitServerParams = any, AdRequestServerParams extends IAFVRequestAdServerParams = any> {
|
|
19
19
|
name: string;
|
|
20
20
|
init: (serverParams: AdInitServerParams) => Promise<void>;
|
|
21
|
-
|
|
21
|
+
destroy: () => void;
|
|
22
|
+
requestAd: (clientParams: IAFVRequestAdParams<AdEvent>, serverParam: AdRequestServerParams) => void;
|
|
22
23
|
}
|
|
23
24
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IAFVRequestAdParams } from '../ads-interface';
|
|
2
2
|
import type { google } from './ima';
|
|
3
3
|
import type { IGoogleIMARequestAdServerParams } from './type';
|
|
4
4
|
declare global {
|
|
@@ -27,7 +27,7 @@ export declare class GoogleIMAImpl {
|
|
|
27
27
|
/**
|
|
28
28
|
* Sets up IMA ad display container, ads loader, and makes an ad request.
|
|
29
29
|
*/
|
|
30
|
-
requestAds: (clientParams:
|
|
30
|
+
requestAds: (clientParams: IAFVRequestAdParams<google.ima.AdEvent>, serverParams: IGoogleIMARequestAdServerParams) => Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* Sets the 'adContainer' div as the IMA ad display container.
|
|
33
33
|
*/
|
package/dist/afv/ima/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IGoogleIMAInitServerParams, IGoogleIMARequestAdServerParams } from './type';
|
|
2
2
|
import type { google } from './ima';
|
|
3
3
|
import type { IAdsContext } from '@/type/base';
|
|
4
|
-
import { type IAbstractAFVProvider, type
|
|
4
|
+
import { type IAbstractAFVProvider, type IAFVRequestAdParams } from '../ads-interface';
|
|
5
5
|
export declare class GoogleIMAProvider implements IAbstractAFVProvider<google.ima.AdEvent> {
|
|
6
6
|
name: string;
|
|
7
7
|
private context;
|
|
@@ -11,5 +11,6 @@ export declare class GoogleIMAProvider implements IAbstractAFVProvider<google.im
|
|
|
11
11
|
private state;
|
|
12
12
|
constructor(context: IAdsContext);
|
|
13
13
|
init: (params: IGoogleIMAInitServerParams) => Promise<void>;
|
|
14
|
-
|
|
14
|
+
destroy: () => void;
|
|
15
|
+
requestAd: (clientParams: IAFVRequestAdParams<google.ima.AdEvent>, serverParams: IGoogleIMARequestAdServerParams) => void;
|
|
15
16
|
}
|
package/dist/afv/ima/type.d.ts
CHANGED
package/dist/afv/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IAdsContext } from '../type/base';
|
|
2
|
-
import { type
|
|
2
|
+
import { type IAFVRequestAdParams } from './ads-interface';
|
|
3
3
|
export * from './ima';
|
|
4
4
|
export * from './okspin';
|
|
5
|
+
export * from './ads-interface';
|
|
5
6
|
export declare class JoliboxAdsForVideo {
|
|
6
7
|
private context;
|
|
7
8
|
private contextInfo;
|
|
@@ -12,5 +13,9 @@ export declare class JoliboxAdsForVideo {
|
|
|
12
13
|
private getRequestContextData;
|
|
13
14
|
private getRequestBizParams;
|
|
14
15
|
init(): Promise<void>;
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Destroy all providers and reset the initialized state.
|
|
18
|
+
*/
|
|
19
|
+
destroy(): void;
|
|
20
|
+
requestAd(params: IAFVRequestAdParams<any>): Promise<void>;
|
|
16
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAdsContext } from '../../type/base';
|
|
2
2
|
import type { IOKSpinForVideoInitServerParams, IOKSpinForVideoRequestAdServerParams } from './type';
|
|
3
|
-
import { type IAbstractAFVProvider, type
|
|
3
|
+
import { type IAbstractAFVProvider, type IAFVRequestAdParams } from '../ads-interface';
|
|
4
4
|
export declare class OKSpinForVideoProvider implements IAbstractAFVProvider {
|
|
5
5
|
name: string;
|
|
6
6
|
private initialized;
|
|
@@ -11,5 +11,6 @@ export declare class OKSpinForVideoProvider implements IAbstractAFVProvider {
|
|
|
11
11
|
private state;
|
|
12
12
|
constructor(context: IAdsContext);
|
|
13
13
|
init: (serverParams: IOKSpinForVideoInitServerParams) => Promise<void>;
|
|
14
|
-
|
|
14
|
+
destroy: () => void;
|
|
15
|
+
requestAd: (clientParams: IAFVRequestAdParams<undefined>, serverParam: IOKSpinForVideoRequestAdServerParams) => void;
|
|
15
16
|
}
|