@ninetailed/experience.js-plugin-analytics
Version:
Ninetailed SDK plugin for analytics
131 lines (130 loc) • 4.37 kB
TypeScript
import { z } from 'zod';
export type ComponentViewEventComponentType = 'Entry' | 'Variable';
export declare const ElementSeenPayloadSchema: z.ZodObject<z.objectUtil.extendShape<{
variant: z.ZodObject<{
id: z.ZodString;
}, "strip", z.ZodUnknown, z.objectOutputType<{
id: z.ZodString;
}, z.ZodUnknown, "strip">, z.objectInputType<{
id: z.ZodString;
}, z.ZodUnknown, "strip">>;
variantIndex: z.ZodNumber;
}, {
element: z.ZodAny;
experience: z.ZodNullable<z.ZodOptional<z.ZodObject<{
id: z.ZodString;
type: z.ZodUnion<[z.ZodLiteral<"nt_experiment">, z.ZodLiteral<"nt_personalization">]>;
name: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
sticky: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
id: string;
type: "nt_experiment" | "nt_personalization";
sticky: boolean;
name?: string | undefined;
description?: string | undefined;
}, {
id: string;
type: "nt_experiment" | "nt_personalization";
name?: string | undefined;
description?: string | undefined;
sticky?: boolean | undefined;
}>>>;
audience: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodObject<{
id: z.ZodString;
name: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: string;
name?: string | undefined;
description?: string | undefined;
}, {
id: string;
name?: string | undefined;
description?: string | undefined;
}>>>>;
componentType: z.ZodDefault<z.ZodLiteral<"Entry">>;
seenFor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}>, "strip", z.ZodTypeAny, {
variant: {
id: string;
} & {
[k: string]: unknown;
};
variantIndex: number;
audience: {
id: string;
name?: string | undefined;
description?: string | undefined;
} | null;
componentType: "Entry";
seenFor: number;
element?: any;
experience?: {
id: string;
type: "nt_experiment" | "nt_personalization";
sticky: boolean;
name?: string | undefined;
description?: string | undefined;
} | null | undefined;
}, {
variant: {
id: string;
} & {
[k: string]: unknown;
};
variantIndex: number;
element?: any;
experience?: {
id: string;
type: "nt_experiment" | "nt_personalization";
name?: string | undefined;
description?: string | undefined;
sticky?: boolean | undefined;
} | null | undefined;
audience?: {
id: string;
name?: string | undefined;
description?: string | undefined;
} | null | undefined;
componentType?: "Entry" | undefined;
seenFor?: number | undefined;
}>;
export type ElementSeenPayload = Omit<z.input<typeof ElementSeenPayloadSchema>, 'element'> & {
element: Element;
};
export declare const VariableSeenPayloadSchema: z.ZodObject<z.objectUtil.extendShape<{
variant: z.ZodObject<{
id: z.ZodString;
}, "strip", z.ZodUnknown, z.objectOutputType<{
id: z.ZodString;
}, z.ZodUnknown, "strip">, z.objectInputType<{
id: z.ZodString;
}, z.ZodUnknown, "strip">>;
variantIndex: z.ZodNumber;
}, {
componentType: z.ZodDefault<z.ZodLiteral<"Variable">>;
variable: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
experienceId: z.ZodOptional<z.ZodString>;
}>, "strip", z.ZodTypeAny, {
variant: {
id: string;
} & {
[k: string]: unknown;
};
variantIndex: number;
componentType: "Variable";
variable: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
experienceId?: string | undefined;
}, {
variant: {
id: string;
} & {
[k: string]: unknown;
};
variantIndex: number;
componentType?: "Variable" | undefined;
variable?: unknown;
experienceId?: string | undefined;
}>;
export type VariableSeenPayload = z.input<typeof VariableSeenPayloadSchema>;