import { CSSResult } from 'lit'; import { ObjectType } from 'arktype/internal/variants/object.ts'; import { PropertyValues } from 'lit'; import type { SerializedError } from '@reduxjs/toolkit'; import type shaka from 'shaka-player'; import { TemplateResult } from 'lit'; export declare interface Ad { sessionId: string; id: string; /** @internal */ companion?: Companion; adFormat: AdFormat | `${AdFormat}`; duration?: number; positionIndex: number; breakIndex: number; breakName: AdBreakName | `${AdBreakName}`; mimetype: string; /** @internal */ maxDuration?: number; totalAds: number; /** @internal */ externalId: string; /** @internal */ lineItemId: string; /** @internal */ waterfallIndex?: number; /** @internal */ waterfallLength?: number; adUrl?: string; nonLinearWidth?: number; nonLinearHeight?: number; title?: string; advertiserName?: string; width?: number; height?: number; adSystem?: string; universalAdIds?: { id: string; registry: string; }[]; creativeId?: string; skippable: boolean; clickThroughUrl?: string; } /** Name of ad break - when the ad appears, `OVERLAY` is deprecated */ export declare enum AdBreakName { PREROLL = "preroll", MIDROLL = "midroll", POSTROLL = "postroll", /** * TODO: OVERLAY can be deleted when everyone upgraded to latest turbo-event-tracker (>2.3.1) * @internal * @deprecated use {@link AdFormat} instead */ OVERLAY = "overlay" } /** @interface */ declare type AdConfig = typeof AdConfigSchema.infer; /** * Ad configuration */ declare const AdConfigSchema: ObjectType< { enable: boolean; player: "ads-sdk" | "ima"; palSdk: boolean; autoPauseWhenInvisible: boolean; maxRedirectCount: number; videoLoadTimeout: number; vastLoadTimeout: number; maxDuration?: number | undefined; bidding: boolean; prebidTimeout: number; apsTimeout: number; intensity: number; imaUi: boolean; customClickButton: boolean; maxWaterfallLength: number; pauseButton: boolean; tagConfig?: string | { name?: string | undefined; maxDuration?: number | undefined; maxFallbackAttempts?: number | undefined; lineItems: { id?: string | undefined; url: string; externalId?: string | undefined; errorPixels?: string[] | undefined; }[]; }[] | { id?: string | undefined; url: string; externalId?: string | undefined; errorPixels?: string[] | undefined; } | undefined; }, {}>; /** * A broad error shape accepted by AD_ERROR events. * Any `Error` with a `name` and `code` satisfies this contract, * so domain-specific errors can flow through without normalisation * while preserving their origin. */ export declare interface AdError extends Error { name: string; message: string; code: string; } /** Format of the ad - how it is presented */ export declare enum AdFormat { LINEAR = "linear", OVERLAY = "overlay", CUTIN = "cutin", PAUSE = "pause" } declare type AdPlayer = new () => IBaseAdPlayerElement; declare type AdPlayerLoader = () => Promise<{ default: AdPlayer; }>; declare type AdPlayerMap = { ima: AdPlayerLoader; } & { [key: string]: AdPlayerLoader | undefined; }; declare const ALLOWED_UI_ACTIONS: readonly ['play', 'pause', 'openEpg', 'startAgeSetup', 'forgotPin', 'upgradeToHigherTier', 'register', 'login']; /** @interface */ declare type AnalyticsConfig = typeof AnalyticsConfigSchema.infer; /** * Analytics configuration */ declare const AnalyticsConfigSchema: ObjectType< { scriptUrl?: string | undefined; }, {}>; /** * An additional API script definition that should be executed for this media-item. * * @example * ``` * { * name: 'some-name', * url: 'https://content-owner.com/tracking/script.js', * conditions: [ * { startMethods: ['click-to-play'], muted: false, requiredVendors: [967], requiredPurposes: [1], probability: 1 }, * { startMethods: ['autoplay-scroll'], muted: undefined, requiredVendors: undefined, requiredPurposes: undefined, probability: 1 } // undefined = no filtering * ] * } * ``` */ declare interface ApiScript { /** Name of the API script that should be exposed to tracking */ name: string; /** URL of the API script that should be executed. Must implement {@link ConnectIntegration}. */ url: string; /** * Conditions under which the API script should be executed. Undefined means always. */ conditions?: { startMethods?: StartMethod[]; muted?: boolean | undefined; requiredVendors?: number[]; requiredPurposes?: number[]; probability: number; }[]; } declare interface Article { title: string; description: string; language: string; publishedTime?: string; top: number; left: number; } /** * Represents an audio track. */ export declare interface AudioTrack extends MediaTrack { /** The type of audio track. */ kind: 'main' | string; } /** * A collection of audio tracks with selection support. * A selected track is available when track info is exposed; otherwise null. * * **Note:** Audio tracks are available after the {@link IntegrationElement.ready | integration.ready} promise resolves. * * The list is iterable and can be converted to an array: * @example * ```ts * for (const track of integration.audioTracks) { console.log(track); } * const tracks = Array.from(integration.audioTracks); * ``` */ export declare interface AudioTrackList extends MediaTrackList { /** The currently selected audio track, or `null` if unavailable. */ readonly selected: AudioTrack | null; /** * Selects an audio track. * @param trackOrId - The track or track ID to select. */ select(trackOrId: AudioTrack | string): void; } declare class BaseMediaError extends Error { code: T; name: string; constructor(message: string, code: T); } /** * Base Shaka configurator applied to every source. * * Contains default retry parameters (optimized settings coordinated with * Wolfgang Dworzak), streaming defaults and DRM configuration derived from * the context's source data. Provider-specific configurators should * extend this class so that the defaults are always included. */ declare class BaseShakaConfigurator implements ShakaConfigurator { #private; getPlayerConfig(context: ShakaSourceContext): Record; getNetworkFilters(_context: ShakaSourceContext): ShakaNetworkFilters; } declare type BrowserType = 'safari-ios' | 'safari-webview' | 'safari-ios-chrome' | 'safari-ios-firefox' | 'safari-ios-opera' | 'samsung' | 'edge' | 'chrome' | 'firefox' | 'opera' | 'safari' | 'android-webview' | 'unknown'; export declare interface Channel { /** Human-readable channel title shown in the player UI */ name?: string; /** Stable machine-facing code used for lookups or analytics */ code?: string; /** Provider-specific identifier when it differs from `code` */ id?: string; /** Canonical playback or landing URL clients should open */ url?: string; /** Square channel-logo URL (ideally 96x96) used wherever icons appear */ logo?: string; } declare interface Companion { start: number; end: number; renderingMode: string; companions: { id: number | null; html: string; width: number; height: number; }[]; } /** * Inject an implementation into a concrete integration instance to customise config loading. * * @example * ```ts * class MyIntegration extends IntegrationElement { * constructor() { * super({ * config: { * async fetchConfig({ integrationId }) { * return fetch(`/my-proxy/${integrationId}`).then(r => r.json()); * }, * }, * }); * } * } * ``` */ declare interface ConfigAdapter { /** * Fetch the player configuration for the given integration ID. * Called once per player initialisation. */ fetchConfig(params: { integrationId: string; env?: string | null; }): Promise; /** * Optional, tenant-specific. Merges context-derived adjustments into the * resolved config (never replaces). The `context` is the opportunistic * context produced by the media provider during resolution; it may be * absent, in which case a tenant may fetch it itself. */ refineConfig?(config: PlayerConfig): Promise; /** * Optional. Returns the styles URL pattern for the given environment. * `{id}` in the returned string is replaced with the integration ID at load time. * When provided, this takes precedence over any statically configured styles URL. */ getStylesUrl?(env: string | null): string | undefined; /** * Optional. Called by the integration element after the internal * {@link MediaResolver} is created, for adapters that need to * resolve media context during {@link refineConfig}. */ setContextResolver?(registry: MediaResolver): void; } /** * Describes the contract that an external API tracking script must implement so that it can be * imported and executed by the integration. The API script must be hosted on the remote server * with CORS enabled. * * @example * ```ts * import { IntegrationEvent } from '@turbo-player/integration-web-component'; * export const connectIntegration: ConnectIntegration = ( * integration, * // userId will be undefined when no consent is given * { userCountryCode, userId, integrationEnvironment } * ) => { * integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => { * console.log('play', integration.content); * }); * }; * ``` * * @example * ```js * export const connectIntegration = ( * integration, * // userId will be undefined when no consent is given * { userCountryCode, userId, integrationEnvironment } * ) => { * const { IntegrationEvent } = integration.constructor; * integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => { * console.log('play', integration.content); * }); * }; * ``` */ export declare type ConnectIntegration = (integration: IntegrationElement, context: { userCountryCode?: string; userId?: string; integrationEnvironment?: string; }, options?: { warnCallback?: (error: Error) => void; }) => (() => void) | undefined; export declare interface Consent { gdprApplies: boolean; consentString?: string; /** @internal */ cacheFriendlyConsentString?: string; /** @internal */ tcfVersion?: TcfVersion; cmpId?: number; policyVersion?: number; vendorListVersion?: number; hasPurpose1Consent?: boolean; vendorConsents?: Record; vendorLegitimateInterests?: Record; purposeConsents?: Record; purposeLegitimateInterests?: Record; specialFeatureOptins?: Record; lastUpdated?: number; publisherRestrictions?: Record; pubPurposeConsents?: Record; pubPurposeLegitimateInterests?: Record; ready: boolean; addtlConsent?: string; } declare interface ConsentAdapter { getGvlId?(): number | undefined; } /** * Playback metrics for the current content item. * Updated continuously as playback progresses. */ export declare interface ContentMetrics { /** Seconds content was playing while viewable for the current content item. */ contentViewableTime: number; /** Seconds content was playing while not viewable for the current content item. */ contentNonviewableTime: number; /** Seconds content was playing while audible for the current content item. */ contentAudibleTime: number; /** Seconds content was playing while not audible for the current content item. */ contentNonaudibleTime: number; /** Total seconds content was playing for the current content item. */ contentTotalTime: number; /** Seconds ads were playing while viewable for the current content item. */ adViewableTime: number; /** Seconds ads were playing while not viewable for the current content item. */ adNonviewableTime: number; /** Seconds ads were playing while audible for the current content item. */ adAudibleTime: number; /** Seconds ads were playing while not audible for the current content item. */ adNonaudibleTime: number; /** Total seconds ads were playing for the current content item. */ adTotalTime: number; /** Time in ms from initiating playback to first Ad or Content Begin for the current content item. */ timeToPlay: number | undefined; /** Whether an ad was active when the user first unmuted. Only set if the player was unmuted. */ adActiveWhenUnmuted?: boolean; /** The reason the player was first unmuted. Only set if the player was unmuted. */ unmuteReason?: 'document-click' | 'tap-to-unmute'; } export declare enum ContentStopReason { CLEAR_PLAYLIST = "clearPlaylist", SELECT_PLAYLIST_ITEM = "selectPlaylistItem", ENDED = "ended", CONTENT_ERROR = "contentError", API_STOP = "apiStop", LIVESTREAM_STOP = "livestreamStop", LIVESTREAM_NOT_STARTED = "livestreamNotStarted", PAGE_HIDE = "pageHide", BEFORE_UNLOAD = "beforeUnload" } declare interface Context { integrationVersion: string; } /** * Server-derived context for the resolved integration + content. * Use `extra` for additional tenant-specific signals. * @inline */ declare interface ContextConfig { userCountryCode?: string; deviceType?: string; publisherId?: string; publisherCountryCode?: string; partnerId?: string; partnerName?: string; productName?: string; productFormat?: string; extra?: Record; } export declare function createIntegrationClient(config: IntegrationConfig): { /** * Returns the custom element name for the configured component. */ getComponentName: () => string; /** * Returns the CSS URL for a given integration using the configured settings. */ getCssUrl: (integrationId: string) => string; /** * Loads the integration custom element using the configured settings. */ loadComponent: () => void; /** * Loads the variant CSS for the given integration ID using the configured settings. */ loadStyles: (integrationId: string, doc?: Document | ShadowRoot) => void; /** * Returns the {@link HostContext} singleton from the loaded integration. */ getHostContext: () => Promise; }; export declare interface CustomMarker extends Omit { /** {@inheritDoc Marker.name} */ name: string; } declare interface Datetime { hourOfDay: number; dayOfMonth: number; dayOfWeek: number; } /** * Development-only flags — gated to allowed domains and not forwarded to production. * Set via the inline config, the `?turboConfig=` URL parameter, or `localStorage` (debug mode). * @inline */ declare interface DevelopmentFlags { [key: string]: unknown; /** Enable debug mode. Can also be set via the `?turboDebug=true` URL parameter. */ debug?: boolean; /** Target the stage environment instead of production. */ environment?: 'stage'; /** Final-layer config override — applied on top of defaults, remote, and inline config. */ configOverrides?: PlayerConfigInput; /** Override the styles URL. */ stylesUrl?: string; } declare interface Device { browserType?: BrowserType; browserLanguage: string; osVersion?: string; osType: OsType; type: DeviceType; runtimeEnvironment: RuntimeEnvironment; isTouchDevice?: boolean; viewport: { width: number; height: number; }; } /** * Identifier names for device IDs that can be passed via {@link HostContextData.deviceId}. */ export declare enum DeviceIdName { /** Android Advertising ID (Google) */ AAID = "aaid", /** Amazon Fire OS Advertising ID */ AFAI = "afai", /** Android App Set ID — scope: app */ ASIA = "asia", /** Android App Set ID — scope: developer */ ASID = "asid", /** Tizen Identifier for Advertising (Samsung) */ TIFA = "tifa", /** VIDAA Advertising ID (Hisense) */ VAID = "vaid", /** Apple Identifier for Advertisers */ IDFA = "idfa", /** Apple Identifier for Vendors */ IDFV = "idfv", /** LG Unique Device ID */ LGUDID = "lgudid", /** Microsoft Advertising ID */ MSAI = "msai", /** Huawei Open Advertising ID */ OAID = "oaid", /** PlayStation Advertising ID */ PSNAI = "psnai", /** Roku Identifier for Advertising */ RIDA = "rida", /** Vizio Advertising ID */ VIDA = "vida", /** TitanOS Advertising ID (Walmart) */ WAID = "waid" } declare type DeviceType = 'connectedtv' | 'desktop' | 'mobile' | 'settopbox' | 'tablet'; /** @interface */ declare type DockConfig = typeof DockConfigSchema.infer; /** * Dock (formerly sticky) configuration */ declare const DockConfigSchema: ObjectType< { enable: boolean; position: "bottom" | "bottomLeft" | "bottomRight" | "left" | "right" | "stickyTop" | "stickyTopExpanded" | "top" | "topLeft" | "topRight"; top: string; right: string; bottom: string; left: string; allowAdClose: boolean; snapTop: string; targetSelector?: string | undefined; }, {}>; export declare enum DockPosition { TOP = "top", BOTTOM = "bottom", LEFT = "left", RIGHT = "right", BOTTOM_LEFT = "bottomLeft", BOTTOM_RIGHT = "bottomRight", TOP_LEFT = "topLeft", TOP_RIGHT = "topRight", STICKY_TOP = "stickyTop", STICKY_TOP_EXPANDED = "stickyTopExpanded" } /** * Generic DRM fields for a single DRM system. */ declare interface DrmSourceData { /** {@inheritDoc SourceMediaItemDrm.drmSystem} */ drmSystem?: DrmSystem; /** {@inheritDoc SourceMediaItemDrm.licenseUrl} */ licenseUrl?: string; /** {@inheritDoc SourceMediaItemDrm.certificateUrl} */ certificateUrl?: string; /** {@inheritDoc SourceMediaItemDrm.token} */ token?: string; } declare type DrmSupport = ReadonlySet; /** * Standard EME key system identifiers for the DRM systems supported by the player. * * Set by the content service after DRM-support detection and source * selection so that the video element only needs to know *which* DRM * system is in use — without license URIs, tokens or certificates. */ export declare enum DrmSystem { FAIRPLAY = "com.apple.fps", WIDEVINE = "com.widevine.alpha", PLAYREADY = "com.microsoft.playready" } /** * A dynamic content ES module must export a `create` function matching this * interface. Sources of this type are identified by the * {@link Mimetype.DYNAMIC_CONTENT} mimetype. * * The player dynamically `import()`s the module and awaits the promise * returned by `create()` before starting playback. The resolved object's * `destroy` is called when the player unloads the content. * * The module runs in the embedding page's realm — `window` and `document` * are the page's globals. `container` is an element rendered inside a * dedicated shadow root, so DOM and CSS appended to it are isolated in both * directions. * * When a TCF consent string is available it is appended as the `consent` * query parameter to the module URL; read it via * `new URL(import.meta.url).searchParams.get('consent')`. * * @example The module itself * ```js * export async function create({ mediaElement, container }) { * // render into container, listen to mediaElement events … * return { destroy() { /* tear down *\/ } }; * } * ``` * * @example Attaching the module to an integration * * Dynamic content is delivered as a regular media item source whose * `mimetype` is `application/x-turbo-dynamic-content` and whose `src` points * to the ES module URL. The simplest way to wire it up is via * {@link ExternalMediaItemElement}. The media item's `duration` (in seconds) * controls playback length — the player‑supplied `mediaElement` reports it as * its duration. * * ```html * * * * * * ``` */ export declare interface DynamicContent { create(context: { /** * The player's media element, proxied so that listeners added via * `addEventListener()` are removed automatically on destroy. Listeners * attached to other objects, or via handler properties (`onplay = ...`), * are not cleaned up automatically. */ mediaElement: HTMLMediaElement; /** * Element to render into. Lives inside its own shadow root, so DOM and * CSS appended here are isolated from the embedding page and the player * UI in both directions. Sized to the player viewport — use * `getBoundingClientRect()` or a `ResizeObserver`, not `window.innerWidth`. */ container: HTMLElement; }): Promise<{ /** Tear down: remove DOM, cancel animations, close audio contexts, etc. */ destroy(): void; }>; } /** @interface */ declare type EarlyRecommendationsConfig = typeof EarlyRecommendationsConfigSchema.infer; /** * Early recommendations configuration */ declare const EarlyRecommendationsConfigSchema: ObjectType< { enable: boolean; showAfterSeconds: number; minimumContentDurationSeconds: number; buttonCountdownSeconds: number; maximumVisibility: number; }, {}>; export declare enum Endscreen { CONTINUE = "continue", NONE = "none" } declare interface EnvironmentState { device: Device; page: Page; article: Article; context: Context; datetime: Datetime; otherIntegrations: OtherIntegrations; allowDocking: boolean; enableSingleDockMode: boolean; } export declare interface EpgEntry { startDate: number; endDate: number; name: string; title?: string; poster?: string; currentProgram?: boolean; } /** @interface */ declare type Experiment = typeof ExperimentSchema.infer; /** * A single experiment definition. * * Mirrors the experiment configuration used by the CloudFront Function * to roll A/B experiment assignments. * * @see turbo-platform-infrastructure/.../config-viewer-request.js * @see packages/integration/src/integration/experiments.ts */ declare const ExperimentSchema: ObjectType< { name: string; enabled: boolean; type: "integration"; participantPercentage: number; variants: { [x: string]: { weight: number; }; }; persist: boolean; exclusive: boolean; }, {}>; export declare interface ExtendedVideoPlaybackQuality extends VideoPlaybackQuality { bitrate: number; liveLatency: number; throughput: number; bytes: number; bandwidth: number; width: number; height: number; } /** @ignore */ export declare const EXTERNAL_PLAYER_NAME = "turbo-player"; /** * Legacy publisher-facing context object for static page/app context and * publisher-supplied user ids. Replaced by {@link HostContextData}; accepted * on the integration element for backward compatibility only. * * @deprecated Use {@link HostContextData} via {@link IntegrationElement.hostContext} instead. */ export declare interface ExtraContext { /** {@link HostContextData.presentationalContext} */ presentationalContext?: 'curated-list' | 'discovery-page'; /** {@link HostContextData.appVersion} */ appVersion?: string; /** {@link HostContextData.appName} */ appName?: string; /** {@link HostContextData.appBundleId} */ appBundleId?: string; /** {@link HostContextData.appStoreId} */ appStoreId?: string; /** {@link HostContextData.appStoreUrl} */ appStoreUrl?: string; /** {@link HostContextData.b2bContext} */ b2bContext?: string; /** {@link HostContextData.deviceId} */ deviceId?: { id: string; name: DeviceIdName | `${DeviceIdName}`; }; /** * User ids to expose. Each entry is translated to a static * `hostContextData.userIds` registration. */ userIds?: { id: string; name: UserIdName | `${UserIdName}`; ext?: Record; }[]; } /** * Global context singleton shared by every integration element on the page. * * @example JavaScript * ```ts * await customElements.whenDefined('my-integration'); * const integration = document.querySelector('my-integration'); * const { hostContext } = integration.constructor; * * hostContext.set({ * appVersion: '2.3.0', * deviceId: { id: '...', name: 'idfa' }, * providers: { 'my-provider': async () => ({ token: await myAuth.getFreshToken() }) }, * userIds: { netId: async ({ consent }) => consent ? { id: await getNetId() } : null }, * }); * ``` * * @example React * ```tsx * consent ? { id: await getNetId() } : null }, * }} * /> * ``` */ export declare interface HostContext { /** Merge context data. Static fields are replaced; `providers` and `userIds` are merged per-name. */ set(data: HostContextData): void; /** Read a static value. Returns `undefined` when not set. */ get>(key: K): HostContextData[K] | undefined; /** Whether a static value has been set. */ has(key: Exclude): boolean; /** Whether a user-id resolver has been registered. */ hasUserId(name: string): boolean; } /** * Data object accepted by {@link HostContext.set}. * * - **Static fields** — last write wins. * - **`providers`** — merged per-name; pass `null` to remove. * - **`userIds`** — merged per-name; pass `null` to remove. */ export declare interface HostContextData { /** * Presentational context of the integration. * Omit when not applicable. */ presentationalContext?: 'curated-list' | 'discovery-page'; /** Deployed version of the app or website. */ appVersion?: string; /** Name of the app or website project. */ appName?: string; /** Bundle id — required for iOS apps. */ appBundleId?: string; /** * App store id — required for apps. * {@link https://iabtechlab.com/wp-content/uploads/2020/08/IAB-Tech-Lab-OTT-store-assigned-App-Identification-Guidelines-2020.pdf IAB Tech Lab App Identification Guidelines} */ appStoreId?: string; /** * App store URL — required for apps. * {@link https://iabtechlab.com/wp-content/uploads/2020/08/IAB-Tech-Lab-OTT-store-assigned-App-Identification-Guidelines-2020.pdf IAB Tech Lab App Identification Guidelines} */ appStoreUrl?: string; /** Business-to-business context identifier. */ b2bContext?: string; /** Device id — required for app environments. Use a `ppid` user id when no device id is available. */ deviceId?: { id: string; name: DeviceIdName | `${DeviceIdName}`; }; /** * Media-provider resolvers keyed by provider name. Merged per-name; pass `null` to remove. * * @example * ```ts * hostContext.set({ * providers: { myProvider: async () => ({ token: await myAuth.getFreshToken() }) }, * }); * ``` */ providers?: { [providerName: string]: ((context: { consent?: Consent; environment?: string; }) => MediaProviderContext | Promise) | null; }; /** * User-id resolvers keyed by {@link HostContextUserIdKey}. Merged per-name; pass `null` to remove. * Each entry may be a static value or a sync/async resolver that receives `{ consent, environment }`. * * Resolvers are invoked fresh each time the player needs user IDs, so they always reflect the * current consent state. Return `null` or `undefined` if the value isn't available yet; call * `hostContext.set()` again once it is — because entries are merged per-name, the replacement * is picked up on the next resolution. * * @example * ```ts * hostContext.set({ * userIds: { * ppid: { id: 'abc-…' }, // static * netId: () => ({ id: window.netId }), // sync resolver * liverampId: async ({ consent }) => { // async, consent-aware * if (!consent?.vendorConsents[97]) return null; * return { id: await ats.getEnvelope() }; * }, * }, * }); * * // Once an async SDK resolves, re-register as a static value so the next * // resolution picks it up immediately instead of calling the resolver again. * ats.retrieveEnvelope().then((envelope) => { * if (envelope) hostContext.set({ userIds: { liverampId: { id: envelope } } }); * }); * ``` */ userIds?: HostContextUserIds; } /** Static (non-registry) keys of {@link HostContextData}. */ declare type HostContextStaticKey = Exclude; /** Snapshot of every static value currently held in the shared context. */ declare type HostContextStaticSnapshot = { [K in HostContextStaticKey]?: HostContextData[K]; }; /** * Publisher-facing shape of a user ID entry. * * Internal ortb2 metadata (`atype`, `gvlId`) is applied centrally by the consumer. * `source` may be overridden by the resolver; pass `''` to suppress the EID entirely. */ export declare interface HostContextUserIdDefinition { id: string; /** Optional ortb2 `ext` payload merged into the resulting EID. */ ext?: Record; /** Optional ortb2 EID `source` override. Pass `''` to keep the id internal-only. */ source?: string; /** * Additional UIDs for the same EID source (ortb2 `uids[1..]`). * The `atype` for each entry is inherited from the registry, matching the * primary uid. Useful when an id vendor returns multiple IDs per source * (e.g. Prebid.js EIDs with more than one uid). */ additionalUids?: { id: string; ext?: Record; }[]; } /** * Allowed keys for {@link HostContextData.userIds}. * * Includes well-known ids (`netId`, `ppid`, …) for autocomplete, plus any string * for internal resolvers. Unknown names are silently ignored by the consumer. */ export declare type HostContextUserIdKey = UserIdName | `${UserIdName}` | (string & {}); export declare type HostContextUserIdResolver = (context: { consent?: Consent; environment?: string; }) => HostContextUserIdDefinition | null | undefined | Promise; /** * User-id resolver map accepted by {@link HostContextData.userIds}. * * Each entry is either a static {@link HostContextUserIdDefinition} or a * {@link HostContextUserIdResolver} function. Pass `null` to remove a previously * registered entry. */ export declare type HostContextUserIds = { [name in HostContextUserIdKey]?: HostContextUserIdDefinition | HostContextUserIdResolver | null; }; declare interface IBaseAdPlayerElement extends HTMLElement { OmidPartnerName: string; OmidPartnerVersion: string; adPlayerType: string; volume: number; muted: boolean; adActive: string; /** Mirrors `state.ui.userInteracting`; used to defer transient ad overlays (e.g. pause ads) while a popup is open. */ userInteracting: boolean; readonly paused: boolean | undefined; readonly supportsFullscreen: boolean; readonly isCustomPlaybackUsed: boolean; readonly adSchedulingMode: 'internal' | 'external'; /** * A DOM element that receives ad click events, enabling custom UI for ad click-throughs. * * Enable via `ad.enableCustomClickButton` configuration. * * When enabled, this element can be positioned in the UI layer (e.g., inside an advertiser button) * to receive trusted click events that trigger the ad click-through URL and tracking. * * **IMA:** Only works on mobile browsers. The element must be passed during * AdDisplayContainer initialization, which is the only way IMA allows custom click handling. * * **ads-sdk:** Works on all browsers. * * @returns The click element if enabled and in use, otherwise `null`. */ readonly customClickElement: HTMLElement | null; activate(): void; setup(params: MonetizationParams): Promise; start(): Promise; play(): Promise; pause(): void | Promise; stop(): void; requestAds(adRequestParams: MonetizationAdRequestParams, pod: VastPod | null): Promise; requestVideoFullscreen(): Promise; } declare abstract class IBaseMediaProvider { static providerName: string; providerName: string; protected _params: MediaProviderParams; protected _hostContext: InternalHostContext; protected _integrationElement: Element; protected _window: Window; context?: ContextConfig; constructor(window: Window, { hostContext, integrationElement }: { hostContext: InternalHostContext; integrationElement: Element; }); setParams(params: MediaProviderParams): void; getRecommendations(_mediaItem: MediaItemResolved, _signal: AbortSignal): Promise>>; abstract resolve(items: MediaItemReference[], signal: AbortSignal): Promise<(MediaItem & { originalId: string; })[]>; abstract getSources(mediaItem: MediaItemResolved, signal: AbortSignal, onTerminated: (error: MediaItemError, reload?: boolean) => void, context: { getDrmSupport: () => Promise; getNonceString: () => Promise; getUserIds: () => Promise>; getConsent: () => Promise; getPin: () => string | undefined; }): Promise; } /** * Name of the shadow-DOM `` that the inline player-config ` * * * * ``` * * @example of a custom media item that returns multiple items * * The `data` getter can also return an array of {@link MediaItemReference} objects * to define a playlist from a single element. * * ```html * * * * * ``` */ export declare abstract class MediaItemElement extends HTMLElement { /** * The content ID used by the provider to look up the media item. * @attribute id */ id: string; /** * The environment to use for the provider. * @attribute {stage|prod} environment * @defaultValue 'prod' */ environment?: 'stage' | 'prod'; /** @internal */ static get observedAttributes(): string[]; /** @internal */ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void; /** * Parses inline JSON from a child `