import * as vue from 'vue'; import { PropType, Component, HTMLAttributes, App } from 'vue'; import { PersonalizedVariant, VariationMatchMetadata, TestVariant, EnrichmentData, Context, Quirks, ScoreVector } from '@uniformdev/context'; interface PersonalizedVariationComponentProps extends PersonalizedVariant { personalizationResult: { variation: PersonalizedVariant; personalizationOccurred: boolean; }; } type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) => Component; type PersonalizeComponentProps = { /** * Name of the personalized placement. Should be unique to this placement location and set of variants. * This name is emitted to analytics after personalization executes. */ name: string; /** The possible variations of the content to render depending on personalization conditions */ variations: PersonalizedVariant[]; /** A Vue component to use to render a selected variant. */ component: PersonalizedVariationComponent; /** The number of variations to select. Use for personalized lists where the `count` most relevant should be shown. */ count?: number; /** The algorithm to use for personalization, if not the default. */ algorithm?: string; }; declare const Personalize: vue.DefineComponent; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; count: { type: PropType; default: number; }; algorithm: { type: PropType; default: string; }; }>, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; count: { type: PropType; default: number; }; algorithm: { type: PropType; default: string; }; }>> & Readonly<{}>, { count: number | undefined; algorithm: string | undefined; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; declare const PersonalizeEdge: vue.DefineComponent; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; count: { type: PropType; default: number; }; algorithm: { type: PropType; default: string; }; }>, () => (vue.VNode | vue.VNode[][])[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; count: { type: PropType; default: number; }; algorithm: { type: PropType; default: string; }; }>> & Readonly<{}>, { count: number | undefined; algorithm: string | undefined; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; interface TestComponentProps { /** Name of the test that is running. */ name: string; /** Variation list that this test will selected from. */ variations: TestVariant[]; /** A Vue component to use to render the test variant. */ component: Component; } declare const Test: vue.DefineComponent; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; }>, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; variations: { type: PropType; required: true; }; component: { type: PropType; required: true; }; }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; interface TrackProps extends HTMLAttributes { /** Behavior that will be pushed when tracking occurs. */ behavior: EnrichmentData | EnrichmentData[] | undefined; /** * Element tag that will be used for tracking. * * @defaultValue div */ tagName?: string; /** * Disables visiblity checking on this component, will trigger behavior immediately on page load. * * @defaultValue If supported, `false`. `true` when window is undefined or when IntersectionObserver is not supported by browser. */ disableVisibilityTrigger?: boolean; /** * Trigger behavior when this element is at least `threshold` visible. * * @defaultValue 0.5 */ threshold?: number | number[]; } /** * Tracks visitor behavior by adding enrichment score when they view content wrapped in this component. * When the Track component is sufficiently in the viewport, it will trigger the enrichment values specified * in `behavior` to the current visitor. If the browser does not support IntersectionObserver, the behavior will * be triggered immediately on page load instead. * * NOTE: this component necessarily renders a wrapping tag to attach the IntersectionObserver to; this can result * in DOM changes when personalization is added. If that's undesirable use TrackSlot instead which tracks * only on page load, but does not render a wrapping tag. */ declare const Track: vue.DefineComponent; }; tagName: { type: PropType; default: string; }; disableVisibilityTrigger: { type: PropType; default: boolean; }; threshold: { type: PropType; default: number; }; }>, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; }; tagName: { type: PropType; default: string; }; disableVisibilityTrigger: { type: PropType; default: boolean; }; threshold: { type: PropType; default: number; }; }>> & Readonly<{}>, { tagName: string | undefined; disableVisibilityTrigger: boolean | undefined; threshold: number | number[] | undefined; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; type TrackFragmentProps = { behavior: EnrichmentData | EnrichmentData[] | undefined; }; /** * Tracks visitor behavior by adding enrichment score when they are shown a route with this component on it. * * NOTE: if you wish to track on the visitor seeing the content in the browser viewport instead, * use Track instead of TrackFragment. */ declare const TrackSlot: vue.DefineComponent; }; }>, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; }; }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; type VariantOutputType = 'edge' | 'standard'; type UniformContextProps = { /** The configured Uniform Context instance to provide */ context: Context; /** The output type to emit. * - `standard` - Emits selected variants as HTML suitable for SSR or SSG * - `edge` - Emits all variants suitable for Edge-side personalization selection * * @defaultValue standard */ outputType?: VariantOutputType; /** * Whether to track a route change to the current URL when this component is rendered. * * @defaultValue true */ trackRouteOnRender?: boolean; }; declare const uniformContextInjectionKey = "uniformContextInjectionKey"; declare const provideUniformContext: ({ context, outputType, trackRouteOnRender, vueAppInstance, }: UniformContextProps & { vueAppInstance?: App; }) => void; declare function onRouteChange(context: Context): void; declare const useUniformContext: () => UniformContextProps; declare function isUsingUniformContext(): boolean; declare const UniformContextProvider: vue.DefineComponent; required: true; }; outputType: { type: PropType; default: string; }; trackRouteOnRender: { type: PropType; default: boolean; }; }>, () => (vue.VNode | (() => vue.VNode))[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; outputType: { type: PropType; default: string; }; trackRouteOnRender: { type: PropType; default: boolean; }; }>> & Readonly<{}>, { outputType: VariantOutputType | undefined; trackRouteOnRender: boolean | undefined; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; declare const provideIsPersonalized: (isPersonalized?: boolean) => void; declare const useIsPersonalized: () => boolean | undefined; /** * Provides reactive access to the Uniform Context's current visitor quirks values * This can be used when you want to read current quirk values directly. */ declare const useQuirks: () => vue.Ref; /** * Provides reactive access to the Uniform Context's current visitor scores values. * This can be used when you want to read current score values directly. */ declare const useScores: () => vue.Ref; export { Personalize, type PersonalizeComponentProps, PersonalizeEdge, type PersonalizedVariationComponent, type PersonalizedVariationComponentProps, Test, type TestComponentProps, Track, TrackSlot, type UniformContextProps, UniformContextProvider, type VariantOutputType, isUsingUniformContext, onRouteChange, provideIsPersonalized, provideUniformContext, uniformContextInjectionKey, useIsPersonalized, useQuirks, useScores, useUniformContext };