import { MyopMessageKey } from "./MyopMessages"; export * from './MyopElementRef'; export * from './baseMessageHandler'; export * from './BaseMyopSDK'; export type CleanupHandler = () => void; export type Dictionary = { [key: string]: T; }; export declare const SkinLoaders: { readonly IframeLoader: "IframeLoader"; readonly WebComponentLoader: "WebComponentLoader"; readonly HTMLLoader: "HTMLLoader"; readonly MinimizedLoader: "MinimizedLoader"; }; export type SkinLoaderType = keyof typeof SkinLoaders; export type PropType = 'any' | 'string' | 'number' | string; export type RefSelectorType = 'id-attribute' | 'css-selector' | 'xpath' | string; export declare const LoaderFrameworks: { readonly react: "react"; readonly vue: "vue"; readonly angular: "angular"; }; export type LoaderFrameworkType = keyof typeof LoaderFrameworks; export interface IWebComponentLoaderConfig extends ISkinLoaderConfig { type: "WebComponentLoader"; url: string; tag: string; framework?: LoaderFrameworkType; } export interface IIframeLoaderConfig extends ISkinLoaderConfig { type: "IframeLoader"; url: string; autoHeight: boolean; height?: string; width?: string; } export declare const ShadowRootModeType: { readonly open: "open"; readonly closed: "closed"; readonly none: "none"; readonly localFrame: "localFrame"; }; export interface IHTMLLoaderConfig extends ISkinLoaderConfig { type: "HTMLLoader"; HTML: string; shadowRootMode?: keyof typeof ShadowRootModeType; autoHeight?: boolean; height?: string; width?: string; } export interface IMinimizedLoaderConfig extends ISkinLoaderConfig { type: "MinimizedLoader"; } interface DashboardObject { _temp_client_id?: string; } type ExtendRecursively = { [K in keyof E]: E[K]; } & { [K in keyof T]: T[K] extends object ? ExtendRecursively : T[K]; }; export type IDashboard = ExtendRecursively; export interface ISkinLoaderConfig { type: SkinLoaderType; [key: string]: any; } export interface v2_IReleaseMetadata { environmentId: string; environmentIdentifier: string; releasedOn?: string; releasedBy?: string; } export interface v2_IVariantConfig extends v2_IMyopStoredObject { loader: ISkinLoaderConfig; componentId: string; releases?: v2_IReleaseMetadata[]; } export interface ISkinConfig { id: string; name: string; description: string; loader: ISkinLoaderConfig; createdBy?: string; createdOn?: string; } export interface v2_ISkinConfig extends ISkinConfig { componentId: string; } export interface IMessagePropConfig extends IPropConfig { type: PropType; messageType: MyopMessageKey; } export interface IBindMessagePropConfig extends IPropConfig { type: PropType; messageType: MyopMessageKey; } export declare const PropMessageModes: { readonly input: "input"; readonly output: "output"; }; export declare const PropConfigBehaviorTypes: { readonly message: "message"; readonly code: "code"; }; export interface IPropMessageBehaviorParam { value: string; } export interface IPropBehavior { type: keyof typeof PropConfigBehaviorTypes; } export interface IPropCodeBehavior extends IPropBehavior { type: "code"; remap?: string; } export interface IPropMessageBehavior extends IPropBehavior { type: "message"; message: MyopMessageKey; ref: string; params: IPropMessageBehaviorParam[]; mode: keyof typeof PropMessageModes; } export interface IPropConfig { id: string; name: string; description: string; type: PropType; behavior: IPropBehavior; } export declare class RefBehaviorType { static code: "code"; static component: "component"; } export type IRefBehaviorType = 'code' | 'component'; export interface IRefBehavior { type: IRefBehaviorType; } export interface IComponentRefBehavior extends IRefBehavior { type: 'component'; componentId: string; /** * @deprecated * Property instance is deprecated and will be removed in future versions. */ instance: IComponentInstanceConfig; } export interface ICodeRefBehavior extends IRefBehavior { type: 'code'; } export interface IRefConfig { id: string; name: string; description: string; selectorType: RefSelectorType; selector: string; behavior: IRefBehavior; } /** * Experience segment rule */ export interface IExperienceSegmentRule { property: string; operator: string; value: string; } /** * Experience A/B split version */ export interface IExperienceABSplitVersion { id: string; percentage: number; } /** * Experience A/B split configuration */ export interface IExperienceABSplit { versions: IExperienceABSplitVersion[]; } /** * Experience segment configuration */ export interface IExperienceSegment { id: string; name: string; description: string; rules: IExperienceSegmentRule[]; useAb: boolean; componentVariants: Record>; abSplit?: IExperienceABSplit; stickyProperties?: string[]; } /** * Experience definition config (v2) */ export interface IExperienceDefinitionConfig extends v2_IMyopStoredObject { /** Selected component IDs */ components: string[]; /** Segment configurations */ segments: IExperienceSegment[]; /** Fallback variant per component */ fallback: Record; /** Tags */ tags: string[]; } export interface IComponentDefinitionConfig { id: string; name: string; description: string; props: IPropConfig[]; refs: IRefConfig[]; skins: ISkinConfig[]; defaultSkin: number; createdOn?: string; createdBy?: string; updatedBy?: string; } export interface v2_IBaseMyopObject { id: string; name: string; description: string; } export interface v2_IMyopStoredObject extends v2_IBaseMyopObject { updatedOn?: string; updatedBy?: string; } export interface ComponentAccess { visibility: 'private' | 'unlisted' | 'public'; unlisted?: { slug: string; }; marketplace?: { status: 'draft' | 'submitted' | 'claimed' | 'closed'; description: string; contactEmail: string; deadline: string; }; } export interface v2_IComponentDefinitionConfig extends v2_IMyopStoredObject { variants_ids: string[]; DTOs: v2_IDTO[]; tags: string[]; access?: ComponentAccess; variants_names: string[]; variants_data: { name: string; id: string; description?: string; updatedOn?: string; updatedBy?: string; has_releases?: boolean; }[]; preview_variant: v2_IVariantConfig; extra?: { firstVariant: v2_IVariantConfig; }; } export interface v2_IDTO extends v2_IMyopStoredObject { data: object; methodName: string; } export interface ISkinInstanceConfig { id: string; } export interface ISkinSelectorConfig { type: keyof typeof SkinSelectorTypes; } export declare const SegmentType: { readonly FunctionResult: "FunctionResult"; }; export interface ISegmentInstance { segmentId: string; skinSelector: ISkinSelectorConfig; } export interface ISegmentDefinition { id: string; type: keyof typeof SegmentType; } export interface IFunctionResultsSegment extends ISegmentDefinition { id: string; type: typeof SegmentType.FunctionResult; name: string; description: string; function: string; } export declare const SkinSelectorTypes: { readonly Segmented: "Segmented"; readonly Dedicated: "Dedicated"; /** * This Selector Type is not yet supported but will be added in a future release. * Please check the documentation for updates. * * @type {string} */ readonly Default: "Default"; }; /** * This Skin Config Type is not yet supported but will be added in a future release. * Please check the documentation for updates. * * @type {IDefaultSkinConfig} */ export interface IDefaultSkinConfig extends ISkinSelectorConfig { type: typeof SkinSelectorTypes.Default; } export interface ISegmentedSkinConfig extends ISkinSelectorConfig { type: typeof SkinSelectorTypes.Segmented; segments: ISegmentInstance[]; } export interface IDedicatedSkinConfig extends ISkinSelectorConfig { type: typeof SkinSelectorTypes.Dedicated; /** * @deprecated Use {@link skin} instead. * Property skins is deprecated and will be removed in future versions. * Please update your code to use {@link skin} for better compatibility. * * @type {string} */ skins?: ISkinInstanceConfig[]; skin: ISkinInstanceConfig; } export interface IComponentInstanceConfig { id: string; componentId: string; componentName: string; skinSelector: ISkinSelectorConfig; nestedComponents?: IComponentInstanceConfig[]; resolvedExperiences?: IExperience[]; resolvedNestedComponents?: IComponentConfig[]; } export declare const ExperienceTypes: { readonly Segment: "Segment"; readonly Promo: "Promo"; readonly AB: "AB"; }; export interface IExperience { id: string; name: string; description: string; type: keyof typeof ExperienceTypes; experiences: IExperience[]; } export interface IABExperience extends IExperience { type: typeof ExperienceTypes.AB; experiences: IExperience[]; percentage: number; } export interface IDateRange { id: string; start: Date; end: Date; timezone: string; } export interface ISegmentExperience extends IExperience { type: keyof typeof ExperienceTypes; segment: ISegmentDefinition; dateRange?: IDateRange; } export interface IUserFlowDefinition { id: string; name: string; description: string; components: IComponentInstanceConfig[]; origins: string[]; experiences: IExperience[]; branch?: string; } export interface IComponentConfig { instance: IComponentInstanceConfig; type: IComponentDefinitionConfig; name: string; } interface IBranchable { branch?: string; } export interface IUserFlow extends Omit, IBranchable { components: IComponentConfig[]; } export declare class RootRef { container: HTMLElement; shadowRoot?: ShadowRoot; constructor(container: HTMLElement, shadowRoot?: ShadowRoot); getRootDiv: () => HTMLDivElement; getRoot: () => HTMLElement | ShadowRoot; }