import { comscoreAnalytics } from '@comscore/analytics'; import { IntegrationElement } from '@turbo-player/integration-web-component'; /** * Comscore Streaming Analytics TypeScript Definitions * Types imported from @comscore/analytics package * @see https://www.npmjs.com/package/@comscore/analytics */ declare type Analytics = comscoreAnalytics['default']; /** * Configuration options for Comscore analytics integration */ export declare interface ComscoreOptions { /** * Comscore publisher ID * @example 'abc123' */ publisherId: string; /** * Publisher name (e.g. Joyn) * @example 'Joyn' */ publisherName: string; /** * Enable debug mode for implementation validation * @default false */ debug?: boolean; /** * Optional callback for warning messages. If not provided, warnings are logged to console. */ warnCallback?: (error: Error) => void; /** * Configure content metadata before tracking. * Called once per content when playback starts. * Use `integration.content` to access content data. * * @param metadata - The pre-configured Comscore content metadata instance with default values * @returns The metadata instance to use for tracking, or `null`/`undefined` to skip tracking this content * * @example * ```ts * configureContentMetadata: (metadata) => { * metadata.setGenreName('Drama'); * return metadata; * } * ``` */ configureContentMetadata?: (metadata: ContentMetadataInstance) => ContentMetadataInstance | null | undefined; } /** * Connects Comscore Streaming Analytics to a turbo player integration. * * This function sets up automatic tracking of playback events including: * - Content playback (play, pause, seek, buffer, end) * - Advertisement playback (pre-roll, mid-roll, post-roll) * - DVR window tracking for live content * * Tracking only occurs when the user has given consent (IAB TCF purpose 1 and vendor 77). * * @param integration - The turbo player integration element * @param options - Comscore configuration options * @returns A cleanup function to disconnect the analytics integration * * @example * ```ts * import { connectToComscore } from '@turbo-player/integration-analytics/comscore'; * * const disconnect = connectToComscore(integration, { * publisherId: 'your-publisher-id', * publisherName: 'Your Publisher Name', * debug: true * }); * * // When done, call disconnect to clean up * disconnect(); * ``` */ export declare const connectToComscore: (integration: IntegrationElement, options: ComscoreOptions) => (() => void); declare type ContentMetadataInstance = InstanceType; export { }