From c2b8026e7d6fba3407ba35ffac92dbf10fd96a9c Mon Sep 17 00:00:00 2001 From: Akansha Arora <> Date: Wed, 25 Jun 2025 17:59:56 +0530 Subject: [PATCH] Adding types in Personalize.js and Parseinstructions.js --- src/Personalize/ParseInstructions.ts | 18 +++++++++++++++++- src/Personalize/Personalize.ts | 9 ++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Personalize/ParseInstructions.ts b/src/Personalize/ParseInstructions.ts index 4360f33..209efb0 100644 --- a/src/Personalize/ParseInstructions.ts +++ b/src/Personalize/ParseInstructions.ts @@ -1,6 +1,22 @@ import { PersonalizationData } from "./Personalize"; -export type Instruction = unknown; +export type Instruction = { + fragments: Array<{ + selector: string; + val: string; + action: string; + manifestId: string; + targetManifestId: string | undefined; + }>; + commands: Array<{ + action: string; + selector: string; + content: string; + selectorType: string; + manifestId: string; + targetManifestId: string | undefined; + }>; +}; export const parseInstructionsFrom = async ( personalizationData: PersonalizationData diff --git a/src/Personalize/Personalize.ts b/src/Personalize/Personalize.ts index 9566b32..66d52e6 100644 --- a/src/Personalize/Personalize.ts +++ b/src/Personalize/Personalize.ts @@ -1,6 +1,13 @@ import { AuthState } from "../Auth/Auth"; -export type PersonalizationData = unknown; +export type PersonalizationData = { + requestId: string; + handle: Array<{ + payload: any[]; + type: string; + [key: string]: any; + }>; +}; export const getPersonalizationData = async ( request: EW.ResponseProviderRequest,