@jolibox/ads 1.3.0 → 1.3.1
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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IAdsContext } from '@/type/base';
|
|
2
|
+
import type { IAbstractAFGProvider, IAdBreakParams, IAdConfigParams } from '../ads-interface';
|
|
3
|
+
import type { IBannerAsAFGAdBreakServerParams, IBannerAsAFGInitServerParams } from './type';
|
|
4
|
+
export declare class BannerAsAFGProvider implements IAbstractAFGProvider<IBannerAsAFGInitServerParams, IBannerAsAFGAdBreakServerParams> {
|
|
5
|
+
name: string;
|
|
6
|
+
private initialized;
|
|
7
|
+
private initCompleter;
|
|
8
|
+
private context;
|
|
9
|
+
private contextInfo;
|
|
10
|
+
private initParams;
|
|
11
|
+
private defaultCountdown;
|
|
12
|
+
private adsOverlay;
|
|
13
|
+
private adsIsShowing;
|
|
14
|
+
private lastUnDisplayedAdBreak;
|
|
15
|
+
private requestCounter;
|
|
16
|
+
private scriptPromise;
|
|
17
|
+
private scriptReady;
|
|
18
|
+
private scriptFailed;
|
|
19
|
+
private state;
|
|
20
|
+
constructor(context: IAdsContext, initParams: IBannerAsAFGInitServerParams['params']);
|
|
21
|
+
init(): Promise<void>;
|
|
22
|
+
private ensureAdSenseScript;
|
|
23
|
+
adConfig(params: IAdConfigParams): void;
|
|
24
|
+
private resolveOverlayConfig;
|
|
25
|
+
private canDisplay;
|
|
26
|
+
private showBannerOverlay;
|
|
27
|
+
adBreak(params: IAdBreakParams, serverParam: IBannerAsAFGAdBreakServerParams): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface IBannerAsAFGInitServerParams {
|
|
2
|
+
provider: 'ADSENSE_BANNER_AS_AFG';
|
|
3
|
+
params: {
|
|
4
|
+
clientId: string;
|
|
5
|
+
channelId: string;
|
|
6
|
+
rewardUnitId: string;
|
|
7
|
+
interstitialUnitId: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface IBannerAsAFGAdBreakServerParams {
|
|
11
|
+
provider: 'ADSENSE_BANNER_AS_AFG';
|
|
12
|
+
params?: {
|
|
13
|
+
countdown?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
package/dist/afg/type.d.ts
CHANGED
|
@@ -5,12 +5,15 @@ import type { IOKSpinAdBreakServerParams, IOKSpinInitServerParams } from './oksp
|
|
|
5
5
|
import type { OKSpinForGameProvider } from './okspin';
|
|
6
6
|
import type { IGoogleGPTAdBreakServerParams, IGoogleGPTInitServerParams } from './googlegpt/type';
|
|
7
7
|
import type { GoogleGPTProvider } from './googlegpt';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import type { IBannerAsAFGAdBreakServerParams, IBannerAsAFGInitServerParams } from './banner-as-afg/type';
|
|
9
|
+
import type { BannerAsAFGProvider } from './banner-as-afg';
|
|
10
|
+
export type IAFGInitServerParams = IGoogleAdSenseInitServerParams | IOKSpinInitServerParams | IAppsRocketsInitServerParams | IGoogleGPTInitServerParams | IBannerAsAFGInitServerParams;
|
|
11
|
+
export type IAFGAdBreakServerParams = IGoogleAdSenseAdBreakServerParams | IOKSpinAdBreakServerParams | IAppsRocketsAdBreakServerParams | IGoogleGPTAdBreakServerParams | IBannerAsAFGAdBreakServerParams;
|
|
10
12
|
export interface IAFGProviders {
|
|
11
13
|
ADSENSE?: GoogleAdSenseProvider;
|
|
12
14
|
ADSENSE_ADMOB?: GoogleAdSenseProvider;
|
|
13
15
|
OKSPIN?: OKSpinForGameProvider;
|
|
14
16
|
APPSROCKETS?: AppsRocketsForGameProvider;
|
|
15
17
|
GOOGLE_GPT?: GoogleGPTProvider;
|
|
18
|
+
ADSENSE_BANNER_AS_AFG?: BannerAsAFGProvider;
|
|
16
19
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IBannerAsAFGPayload {
|
|
2
|
+
requestId: number;
|
|
3
|
+
clientId: string;
|
|
4
|
+
unitId: string;
|
|
5
|
+
channelId?: string;
|
|
6
|
+
countdown: number;
|
|
7
|
+
mode: 'interstitial' | 'reward';
|
|
8
|
+
testMode?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const createState: () => {
|
|
11
|
+
afterAd: import("@preact/signals").Signal<(() => void) | null>;
|
|
12
|
+
adDismissed: import("@preact/signals").Signal<(() => void) | null>;
|
|
13
|
+
adViewed: import("@preact/signals").Signal<(() => void) | null>;
|
|
14
|
+
adBreakDone: import("@preact/signals").Signal<(() => void) | null>;
|
|
15
|
+
adLoaded: import("@preact/signals").Signal<(() => void) | null>;
|
|
16
|
+
adError: import("@preact/signals").Signal<(() => void) | null>;
|
|
17
|
+
visible: import("@preact/signals").Signal<boolean>;
|
|
18
|
+
payload: import("@preact/signals").Signal<IBannerAsAFGPayload | null>;
|
|
19
|
+
};
|
|
20
|
+
type State = ReturnType<typeof createState>;
|
|
21
|
+
export declare const JoliboxAFGOverlay: ({ state }: {
|
|
22
|
+
state: State;
|
|
23
|
+
}) => JSX.Element | null;
|
|
24
|
+
export {};
|