@@ -3,6 +3,51 @@ import { Batch } from "@mparticle/event-models";
33// Placeholder for Dictionary-like Types
44export type Dictionary < V = any > = Record < string , V > ;
55
6+ // Rokt Manager Types
7+ export type RoktPartnerAttributes = Dictionary < string | number | boolean | undefined | null > ;
8+
9+ export interface RoktPartnerExtensionData < T > {
10+ [ extensionName : string ] : T ;
11+ }
12+
13+ export interface RoktSelectPlacementsOptions {
14+ attributes : RoktPartnerAttributes ;
15+ identifier ?: string ;
16+ }
17+
18+ export interface RoktPlacementEvent < T = void > {
19+ body : T ;
20+ event : string ;
21+ placement : RoktPlacement ;
22+ }
23+
24+ export interface RoktSubscriber < T > {
25+ subscribe ( handler : T ) : RoktUnsubscriber ;
26+ }
27+
28+ export interface RoktUnsubscriber {
29+ unsubscribe ( ) : void ;
30+ }
31+
32+ export interface RoktPlacement {
33+ id : string ;
34+ element : HTMLIFrameElement ;
35+ close ( ) : Promise < void > ;
36+ on ( event : string ) : RoktSubscriber < RoktPlacementEvent < unknown > > ;
37+ ready ( ) : Promise < void > ;
38+ send ( event : string , data ?: unknown ) : Promise < void > ;
39+ onClose ( ) : Promise < void > ;
40+ }
41+
42+ export interface RoktSelection {
43+ close : ( ) => void ;
44+ getPlacements : ( ) => Promise < Array < RoktPlacement > > ;
45+ on ( eventName : string ) : RoktSubscriber < RoktPlacementEvent < unknown > > ;
46+ ready ( ) : Promise < void > ;
47+ send ( event : string , data ?: unknown ) : Promise < void > ;
48+ setAttributes ( attributes : RoktPartnerAttributes ) : Promise < void > ;
49+ }
50+
651export as namespace mParticle ;
752export { } ;
853export interface MPConfiguration {
@@ -309,6 +354,19 @@ interface GetSession {
309354 ( ) : string ;
310355}
311356
357+ // Rokt Manager Method Interfaces
358+ interface SelectPlacements {
359+ ( options : RoktSelectPlacementsOptions ) : Promise < RoktSelection > ;
360+ }
361+
362+ interface HashAttributes {
363+ ( attributes : RoktPartnerAttributes ) : Promise < Record < string , string > > ;
364+ }
365+
366+ interface SetExtensionData {
367+ ( extensionData : RoktPartnerExtensionData < unknown > ) : void ;
368+ }
369+
312370export const endSession : EndSession ;
313371export const getAppName : GetAppName ;
314372export const getAppVersion : GetAppVersion ;
@@ -491,6 +549,12 @@ export namespace eCommerce {
491549 const Cart : Cart ;
492550}
493551
552+ export namespace Rokt {
553+ const selectPlacements : SelectPlacements ;
554+ const hashAttributes : HashAttributes ;
555+ const setExtensionData : SetExtensionData ;
556+ }
557+
494558export interface IdentifyRequest {
495559 userIdentities : UserIdentities ;
496560}
@@ -744,6 +808,11 @@ declare class mParticleInstance {
744808 setCurrencyCode : SetCurrencyCode ;
745809 Cart : Cart ;
746810 } ;
811+ Rokt : {
812+ selectPlacements : SelectPlacements ;
813+ hashAttributes : HashAttributes ;
814+ setExtensionData : SetExtensionData ;
815+ } ;
747816 PromotionType : {
748817 Unknown : PromotionType . Unknown ;
749818 PromotionClick : PromotionType . PromotionClick ;
0 commit comments