Skip to content

Commit 68abfaa

Browse files
🤖 Merge PR DefinitelyTyped#73316 Update RoktPartnerAttributes type to support nested objects by @alexs-mparticle
1 parent 9d7245f commit 68abfaa

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

‎types/mparticle__web-sdk/index.d.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ import { Batch } from "@mparticle/event-models";
44
export type Dictionary<V = any> = Record<string, V>;
55

66
// Rokt Manager Types
7-
export type RoktPartnerAttributes = Dictionary<string | number | boolean | undefined | null>;
8-
export type RoktAttributeValueArray = Array<string | number | boolean>;
7+
export type RoktAttributeValueArray = Array<string | number | boolean | Dictionary>;
98
export type RoktAttributeValueType = string | number | boolean | undefined | null;
109
export type RoktAttributeValue = RoktAttributeValueType | RoktAttributeValueArray;
11-
export type RoktAttributeCollection = Record<string, RoktAttributeValue>;
10+
export type RoktPartnerAttributes = Record<string, RoktAttributeValue>;
1211

1312
export interface RoktPartnerExtensionData<T> {
1413
[extensionName: string]: T;
1514
}
1615

1716
export interface RoktSelectPlacementsOptions {
18-
attributes: RoktAttributeCollection;
17+
attributes: RoktPartnerAttributes;
1918
identifier?: string;
2019
}
2120

‎types/mparticle__web-sdk/test/mparticle__web-sdk-tests.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,19 @@ mParticle.Rokt.selectPlacements({
200200
price: 100,
201201
taxes: 6.75,
202202
excessbaggage: true,
203-
cartItems: ["item1", "item2"],
203+
products: [ 'product1', 'product2' ],
204+
cartItems: [
205+
{
206+
name: "item",
207+
price: 100,
208+
quantity: 1,
209+
},
210+
{
211+
name: "item2",
212+
price: 200,
213+
quantity: 2,
214+
},
215+
],
204216
},
205217
});
206218

0 commit comments

Comments
 (0)