/** * Schema Manager * * Index mapping management, templates, and migrations */ import type { IndexSchema, IndexSettings, IndexMapping, SchemaMigration, MigrationHistoryEntry, SchemaManagerConfig, SchemaValidationResult, SchemaDiff, IndexTemplate, ComponentTemplate, SchemaManagerStats } from './types.js'; /** * Schema Manager */ export declare class SchemaManager { private config; private stats; private logger; private metrics; constructor(config?: SchemaManagerConfig); /** * Initialize schema manager */ initialize(): Promise; /** * Create an index with schema */ createIndex(schema: IndexSchema): Promise; /** * Update index mapping */ updateMapping(index: string, mapping: Partial): Promise; /** * Update index settings */ updateSettings(index: string, settings: Partial): Promise; /** * Get index schema */ getSchema(index: string): Promise; /** * Delete an index */ deleteIndex(index: string): Promise; /** * Check if index exists */ indexExists(index: string): Promise; /** * Run migrations */ migrate(migrations: SchemaMigration[]): Promise; /** * Run a single migration */ private runMigration; /** * Apply migration changes */ private applyMigration; /** * Rollback a migration */ rollback(version: number, migrations: SchemaMigration[]): Promise; /** * Get applied migrations */ getAppliedMigrations(): Promise; /** * Create or update index template */ putTemplate(template: IndexTemplate): Promise; /** * Get index template */ getTemplate(name: string): Promise; /** * Delete index template */ deleteTemplate(name: string): Promise; /** * Create or update component template */ putComponentTemplate(template: ComponentTemplate): Promise; /** * Update aliases */ updateAliases(index: string, aliases: { add?: Record; remove?: string[]; }): Promise; /** * Add alias */ addAlias(index: string, alias: string, config?: Record): Promise; /** * Remove alias */ removeAlias(index: string, alias: string): Promise; /** * Validate schema */ validateSchema(schema: IndexSchema): SchemaValidationResult; /** * Compare two schemas */ diffSchemas(oldSchema: IndexSchema, newSchema: IndexSchema): SchemaDiff; /** * Get statistics */ getStats(): SchemaManagerStats; /** * Ensure history index exists */ private ensureHistoryIndex; /** * Record migration in history */ private recordMigration; /** * Check if settings require closing the index */ private settingsRequireClose; /** * Validate fields recursively */ private validateFields; /** * Flatten nested fields */ private flattenFields; /** * Update average migration duration */ private updateAvgDuration; } /** * Create a schema manager */ export declare function createSchemaManager(config?: SchemaManagerConfig): SchemaManager;