import { WebPlugin } from '@capacitor/core'; import type { AdUnitOptions, ConsentOptions, InitOptions, InitResult, IsReadyResult, LevelPlayPlugin, MetaDataOptions, ShowResult, TrackingResult, } from './definitions'; /** * Web stub. LevelPlay has no web SDK: init rejects with `unimplemented`, ads are never ready and every show resolves * as "not shown" so callers can treat the web like a no-fill platform without special casing. */ export class LevelPlayWeb extends WebPlugin implements LevelPlayPlugin { private static readonly NO_FILL: ShowResult = { shown: false, rewarded: false, error: { code: -1, message: 'LevelPlay is not available on the web' }, }; async initialize(_options: InitOptions): Promise { throw this.unimplemented('LevelPlay is not available on the web.'); } async getSdkVersion(): Promise { return { sdkVersion: 'web' }; } async setConsent(_options: ConsentOptions): Promise { /* nothing to forward */ } async setMetaData(_options: MetaDataOptions): Promise { /* nothing to forward */ } async requestTrackingAuthorization(): Promise { return { status: 'unavailable' }; } async getTrackingAuthorizationStatus(): Promise { return { status: 'unavailable' }; } async loadRewarded(_options: AdUnitOptions): Promise { /* never fills */ } async showRewarded(_options: AdUnitOptions): Promise { return { ...LevelPlayWeb.NO_FILL }; } async loadInterstitial(_options: AdUnitOptions): Promise { /* never fills */ } async showInterstitial(_options: AdUnitOptions): Promise { return { ...LevelPlayWeb.NO_FILL }; } async isReady(): Promise { return { ready: false }; } async launchTestSuite(): Promise { throw this.unimplemented('LevelPlay is not available on the web.'); } async validateIntegration(): Promise { /* nothing to validate */ } }