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