import type { EventSpecMetadata } from "../eventSpec/AvoEventSpecFetchTypes"; /** * Recursive type for schema children. * - For object properties: array of EventProperty objects * - For list properties: array of strings (primitive types) or nested structures */ export type SchemaChild = string | EventProperty | SchemaChild[]; /** * Property schema with optional validation results. */ export interface EventProperty { propertyName: string; propertyType: string; encryptedPropertyValue?: string; children?: SchemaChild[]; /** Event/variant IDs that FAILED validation (present if smaller or equal to passed) */ failedEventIds?: string[]; /** Event/variant IDs that PASSED validation (present if smaller than failed) */ passedEventIds?: string[]; } export interface BaseBody { apiKey: string; appName: string; appVersion: string; libVersion: string; env: string; libPlatform: "web"; messageId: string; trackingId: string; createdAt: string; sessionId: string; streamId: string; samplingRate: number; /** Event spec metadata from EventSpecResponse (moved from EventSchemaBody) */ eventSpecMetadata?: EventSpecMetadata; } export interface SessionStartedBody extends BaseBody { type: "sessionStarted"; } export interface EventSchemaBody extends BaseBody { type: "event"; /** ID of the base event from spec (null if no spec available) */ eventId: string | null; /** Name seen in code */ eventName?: string; eventProperties: EventProperty[]; avoFunction: boolean; eventHash: string | null; /** Branch ID from getEventSpec response when value validation was performed */ validatedBranchId?: string; } export declare class AvoNetworkCallsHandlerLite { private readonly apiKey; private readonly envName; private readonly appName; private readonly appVersion; private readonly libVersion; private samplingRate; private sending; private static readonly trackingEndpoint; constructor(apiKey: string, envName: string, appName: string, appVersion: string, libVersion: string); callInspectorWithBatchBody(inEvents: Array, onCompleted: (error: Error | null) => any): void; private fixStreamIds; bodyForSessionStartedCall(): SessionStartedBody; bodyForEventSchemaCall(eventName: string, eventProperties: EventProperty[], eventId: string | null, eventHash: string | null, eventSpecMetadata?: EventSpecMetadata, validatedBranchId?: string): EventSchemaBody; private createBaseCallBody; /** * Calls Inspector API immediately with a single event (bypasses batching). * Used when event spec validation is available. * Note: Does not drop due to sampling - validated events are always sent. */ callInspectorImmediately(eventBody: EventSchemaBody, onCompleted: (error: Error | null) => any): void; /** * Check if event should be dropped based on sampling rate. */ private shouldDropBySampling; /** * Core Inspector API call logic shared by batch and immediate calls. */ private callInspectorApi; } export { AvoNetworkCallsHandlerLite as AvoNetworkCallsHandler };