import type { Message, Options, SerializedLLM, ServiceName } from './types'; /** * Interface for LLM instance (to avoid circular dependency) */ export interface SerializableLLM { readonly service: ServiceName; readonly model: string; readonly messages: Message[]; readonly options: Partial; } /** * Factory function type for creating LLM instances */ export type LLMFactory = (messages: Message[], options: Options) => SerializableLLM; /** * Handles serialization and deserialization of LLM instances and messages */ export declare class Serializer { private static llmFactory; /** * Register the LLM factory for deserialization * This should be called by the LLM class during initialization */ static registerFactory(factory: LLMFactory): void; /** * Serialize an LLM instance to a SerializedLLM object */ static serializeLLM(llm: SerializableLLM): SerializedLLM; /** * Deserialize a SerializedLLM object back to an LLM instance * @throws ValidationError if no factory is registered or data is invalid */ static deserializeLLM(data: SerializedLLM): SerializableLLM; /** * Serialize messages to a JSON string */ static serializeMessages(messages: Message[]): string; /** * Deserialize a JSON string to messages * @throws ValidationError if JSON is invalid or messages are malformed */ static deserializeMessages(json: string): Message[]; /** * Validate a SerializedLLM object */ private static validateSerializedLLM; /** * Validate a single message */ private static validateMessage; /** * Deep clone messages array */ private static cloneMessages; /** * Clone options (excluding non-serializable properties) */ private static cloneOptions; /** * Convert SerializedLLM to JSON string */ static toJSON(llm: SerializableLLM): string; /** * Parse JSON string to SerializedLLM */ static fromJSON(json: string): SerializedLLM; } //# sourceMappingURL=serializer.d.ts.map